本文整理匯總了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)
}
}
)
})
示例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")
},
})
})
示例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)
}
}
)
})
示例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)
},
})
})
示例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)
},
}
)
})
示例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)
},
})
})
示例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
})
})
示例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(),
]),
}))