当前位置: 首页>>代码示例>>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;未经允许,请勿转载。