本文整理汇总了TypeScript中builder-util.log.filePath方法的典型用法代码示例。如果您正苦于以下问题:TypeScript log.filePath方法的具体用法?TypeScript log.filePath怎么用?TypeScript log.filePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类builder-util.log
的用法示例。
在下文中一共展示了log.filePath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createBlockmap
export async function createBlockmap(file: string, target: Target, packager: PlatformPackager<any>, safeArtifactName: string | null): Promise<BlockMapDataHolder> {
const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`
log.info({blockMapFile: log.filePath(blockMapFile)}, "building block map")
const updateInfo: BlockMapDataHolder = JSON.parse(await exec(await getBlockMapTool(), ["-in", file, "-out", blockMapFile]))
packager.info.dispatchArtifactCreated({
file: blockMapFile,
safeArtifactName: `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,
target,
arch: null,
packager,
updateInfo,
})
return updateInfo
}
示例2: createBlockmap
export async function createBlockmap(file: string, target: Target, packager: PlatformPackager<any>, safeArtifactName: string | null): Promise<BlockMapDataHolder> {
const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`
log.info({blockMapFile: log.filePath(blockMapFile)}, "building block map")
const updateInfo = await executeAppBuilderAsJson<BlockMapDataHolder>(["blockmap", "--input", file, "--output", blockMapFile])
await packager.info.callArtifactBuildCompleted({
file: blockMapFile,
safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,
target,
arch: null,
packager,
updateInfo,
})
return updateInfo
}
示例3: appendBlockmap
export async function appendBlockmap(file: string): Promise<BlockMapDataHolder> {
log.info({file: log.filePath(file)}, "building embedded block map")
return JSON.parse(await exec(await getBlockMapTool(), ["-in", file, "-compression", "deflate"]))
}
示例4: sign
private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null): Promise<void> {
if (!isSignAllowed()) {
return
}
const isMas = masOptions != null
const macOptions = this.platformSpecificBuildOptions
const qualifier = (isMas ? masOptions!.identity : null) || macOptions.identity
if (!isMas && qualifier === null) {
if (this.forceCodeSigning) {
throw new Error("identity explicitly is set to null, but forceCodeSigning is set to true")
}
log.info({reason: "identity explicitly is set to null"}, "skipped macOS code signing")
return
}
const keychainName = (await this.codeSigningInfo).keychainName
const explicitType = isMas ? masOptions!.type : macOptions.type
const type = explicitType || "distribution"
const isDevelopment = type === "development"
const certificateType = getCertificateType(isMas, isDevelopment)
let identity = await findIdentity(certificateType, qualifier, keychainName)
if (identity == null) {
if (!isMas && !isDevelopment && explicitType !== "distribution") {
identity = await findIdentity("Mac Developer", qualifier, keychainName)
if (identity != null) {
log.warn("Mac Developer is used to sign app â it is only for development and testing, not for production")
}
}
if (identity == null) {
await reportError(isMas, certificateType, qualifier, keychainName, this.forceCodeSigning)
return
}
}
const signOptions: any = {
"identity-validation": false,
// https://github.com/electron-userland/electron-builder/issues/1699
// kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.
ignore: (file: string) => {
return file.endsWith(".kext") || file.startsWith("/Contents/PlugIns", appPath.length) ||
// https://github.com/electron-userland/electron-builder/issues/2010
file.includes("/node_modules/puppeteer/.local-chromium")
},
identity: identity!,
type,
platform: isMas ? "mas" : "darwin",
version: this.config.electronVersion,
app: appPath,
keychain: keychainName || undefined,
binaries: (isMas && masOptions != null ? masOptions.binaries : macOptions.binaries) || undefined,
requirements: isMas || macOptions.requirements == null ? undefined : await this.getResource(macOptions.requirements),
"gatekeeper-assess": appleCertificatePrefixes.find(it => identity!.name.startsWith(it)) != null
}
await this.adjustSignOptions(signOptions, masOptions)
log.info({
file: log.filePath(appPath),
identityName: identity.name,
identityHash: identity.hash,
}, "signing")
await this.doSign(signOptions)
// https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209
if (masOptions != null && !isDevelopment) {
const certType = isDevelopment ? "Mac Developer" : "3rd Party Mac Developer Installer"
const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainName)
if (masInstallerIdentity == null) {
throw new Error(`Cannot find valid "${certType}" identity to sign MAS installer, please see https://electron.build/code-signing`)
}
const artifactName = this.expandArtifactNamePattern(masOptions, "pkg")
const artifactPath = path.join(outDir!, artifactName)
await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainName)
this.dispatchArtifactCreated(artifactPath, null, Arch.x64, this.computeSafeArtifactName(artifactName, "pkg"))
}
}
示例5: appendBlockmap
export async function appendBlockmap(file: string): Promise<BlockMapDataHolder> {
log.info({file: log.filePath(file)}, "building embedded block map")
return await executeAppBuilderAsJson<BlockMapDataHolder>(["blockmap", "--input", file, "--compression", "deflate"])
}