當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Platform.WINDOWS.createTarget方法代碼示例

本文整理匯總了TypeScript中out.Platform.WINDOWS.createTarget方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Platform.WINDOWS.createTarget方法的具體用法?TypeScript Platform.WINDOWS.createTarget怎麽用?TypeScript Platform.WINDOWS.createTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在out.Platform.WINDOWS的用法示例。


在下文中一共展示了Platform.WINDOWS.createTarget方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: assertPack

test.ifNotCiOsx("nsis boring, MUI_HEADER", () => {
  let installerHeaderPath: string | null = null
  return assertPack("test-app-one", {
      targets: Platform.WINDOWS.createTarget(["nsis"]),
      devMetadata: {
        build: {
          nsis: {
            oneClick: false,
          }
        }
      },
      effectiveOptionComputed: options => {
        const defines = options[0]
        assertThat(defines.MUI_HEADERIMAGE).isEqualTo(null)
        assertThat(defines.MUI_HEADERIMAGE_BITMAP).isEqualTo(installerHeaderPath)
        assertThat(defines.MUI_HEADERIMAGE_RIGHT).isEqualTo(null)
        // speedup, do not build - another MUI_HEADER test will test build
        return true
      }
    }, {
      tempDirCreated: projectDir => {
        installerHeaderPath = path.join(projectDir, "build", "installerHeader.bmp")
        return copy(getTestAsset("installerHeader.bmp"), installerHeaderPath)
      }
    }
  )
})
開發者ID:amilajack,項目名稱:electron-builder,代碼行數:27,代碼來源:winPackagerTest.ts

示例2: test

test("detect install-spinner, certificateFile/password", () => {
  let platformPackager: CheckingWinPackager = null
  let loadingGifPath: string = null

  return assertPack("test-app-one", {
    targets: Platform.WINDOWS.createTarget("squirrel"),
    platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingWinPackager(packager),
    config: {
      win: {
        certificatePassword: "pass",
      }
    }
  }, {
    projectDirCreated: it => {
      loadingGifPath = path.join(it, "build", "install-spinner.gif")
      return BluebirdPromise.all([
        copyTestAsset("install-spinner.gif", loadingGifPath),
        modifyPackageJson(it, data => {
          data.build.win = {
            certificateFile: "secretFile",
            certificatePassword: "mustBeOverridden",
          }
        })])
    },
    packed: async () => {
      expect(platformPackager.effectiveDistOptions.loadingGif).toEqual(loadingGifPath)
      expect(platformPackager.signOptions.cert).toEqual("secretFile")
      expect(platformPackager.signOptions.password).toEqual("pass")
    },
  })
})
開發者ID:heinzbeinz,項目名稱:electron-builder,代碼行數:31,代碼來源:squirrelWindowsTest.ts

示例3: assertPack

test.ifNotCiOsx("nsis boring, MUI_HEADER as option", () => {
  let installerHeaderPath: string | null = null
  return assertPack("test-app-one", {
      targets: Platform.WINDOWS.createTarget(["nsis"]),
      devMetadata: {
        build: {
          nsis: {
            oneClick: false,
            installerHeader: "foo.bmp"
          }
        }
      },
      effectiveOptionComputed: options => {
        const defines = options[0]
        assertThat(defines.MUI_HEADERIMAGE).isEqualTo(null)
        assertThat(defines.MUI_HEADERIMAGE_BITMAP).isEqualTo(installerHeaderPath)
        assertThat(defines.MUI_HEADERIMAGE_RIGHT).isEqualTo(null)
        // test that we can build such installer
        return false
      }
    }, {
      tempDirCreated: projectDir => {
        installerHeaderPath = path.join(projectDir, "foo.bmp")
        return rename(path.join(projectDir, "installerHeader.bmp"), installerHeaderPath)
      }
    }
  )
})
開發者ID:mairanteodoro,項目名稱:electron-builder,代碼行數:28,代碼來源:winPackagerTest.ts

示例4: test

test("detect install-spinner", () => {
  let platformPackager: CheckingWinPackager = null
  let loadingGifPath: string = null

  // todo all PackagerOptions should be optional otherwise it is not possible to pass only several to override dev package.json
  const devMetadata: any = {
    build: {
      win: {
        certificatePassword: "pass",
      }
    }
  }
  return assertPack("test-app-one", {
    targets: Platform.WINDOWS.createTarget(),
    platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingWinPackager(packager, cleanupTasks),
    devMetadata: devMetadata
  }, {
    tempDirCreated: it => {
      loadingGifPath = path.join(it, "build", "install-spinner.gif")
      return BluebirdPromise.all([
        move(path.join(it, "install-spinner.gif"), loadingGifPath),
        modifyPackageJson(it, data => {
          data.build.win = {
            certificateFile: "secretFile",
            certificatePassword: "mustBeOverridden",
          }
        })])
    },
    packed: () => {
      assertThat(platformPackager.effectiveDistOptions.loadingGif).equal(loadingGifPath)
      assertThat(platformPackager.effectiveDistOptions.certificateFile).equal("secretFile")
      return BluebirdPromise.resolve(null)
    },
  })
})
開發者ID:bright-spark,項目名稱:electron-builder,代碼行數:35,代碼來源:winPackagerTest.ts

示例5: assertPack

test.ifNotCiMac("boring, MUI_HEADER as option", () => {
  let installerHeaderPath: string | null = null
  return assertPack("test-app-one", {
    targets: Platform.WINDOWS.createTarget(["nsis"], Arch.ia32, Arch.x64),
    config: {
      nsis: {
        oneClick: false,
        installerHeader: "foo.bmp"
      }
    },
      effectiveOptionComputed: async (it) => {
        const defines = it[0]
        expect(defines.MUI_HEADERIMAGE).toBeNull()
        expect(defines.MUI_HEADERIMAGE_BITMAP).toEqual(installerHeaderPath)
        expect(defines.MUI_HEADERIMAGE_RIGHT).toBeNull()
        // test that we can build such installer
        return false
      }
    }, {
      projectDirCreated: projectDir => {
        installerHeaderPath = path.join(projectDir, "foo.bmp")
        return copyTestAsset("installerHeader.bmp", installerHeaderPath)
      },
    }
  )
})
開發者ID:heinzbeinz,項目名稱:electron-builder,代碼行數:26,代碼來源:nsisBoring.ts

示例6: test

test("detect install-spinner, certificateFile/password", () => {
  let platformPackager: CheckingWinPackager = null
  let loadingGifPath: string = null

  return assertPack("test-app-one", {
    targets: Platform.WINDOWS.createTarget(),
    platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingWinPackager(packager, cleanupTasks),
    devMetadata: {
        build: {
          win: {
            certificatePassword: "pass",
          }
        }
      }
  }, {
    tempDirCreated: it => {
      loadingGifPath = path.join(it, "build", "install-spinner.gif")
      return BluebirdPromise.all([
        move(path.join(it, "install-spinner.gif"), loadingGifPath),
        modifyPackageJson(it, data => {
          data.build.win = {
            certificateFile: "secretFile",
            certificatePassword: "mustBeOverridden",
          }
        })])
    },
    packed: () => {
      assertThat(platformPackager.effectiveDistOptions.loadingGif).isEqualTo(loadingGifPath)
      assertThat(platformPackager.signOptions.cert).isEqualTo("secretFile")
      assertThat(platformPackager.signOptions.password).isEqualTo("pass")
      return BluebirdPromise.resolve(null)
    },
  })
})
開發者ID:demetris-manikas,項目名稱:electron-builder,代碼行數:34,代碼來源:winPackagerTest.ts

示例7: assertPack

test.ifDevOrWinCi("beta version", () => {
  const metadata: any = {
    version: "3.0.0-beta.2"
  }
  return assertPack("test-app-one", {
    targets: Platform.WINDOWS.createTarget(["squirrel", "nsis"]),
    devMetadata: metadata
  })
})
開發者ID:demetris-manikas,項目名稱:electron-builder,代碼行數:9,代碼來源:winPackagerTest.ts

示例8: assertPack

test.ifDevOrLinuxCi("nsis - custom include", () => assertPack("test-app-one", {
  targets: Platform.WINDOWS.createTarget(["nsis"]),
}, {
  tempDirCreated: projectDir => copy(getTestAsset("installer.nsh"), path.join(projectDir, "build", "installer.nsh")),
  packed: projectDir => BluebirdPromise.all([
    assertThat(path.join(projectDir, "build", "customHeader")).isFile(),
    assertThat(path.join(projectDir, "build", "customInit")).isFile(),
    assertThat(path.join(projectDir, "build", "customInstall")).isFile(),
  ]),
}))
開發者ID:brave,項目名稱:electron-builder,代碼行數:10,代碼來源:winPackagerTest.ts


注:本文中的out.Platform.WINDOWS.createTarget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。