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MAAR,EAAgB,YAAhB,EAA8B,YAA9B,EAA4C,cAA5C,CAAN;;AAEA,UAAI,KAAK,iBAAL,IAA0B,MAAM,KAAK,KAAzC,EAAgD;AAC9C,QAAA,UAAU,GAAG,MAAM,qDAAe,YAAf,CAAnB;AACD;AACF;;AAED,UAAM,QAAQ,CAAC,IAAT,CAAc,0BAAd,CAAyC;AAC7C,MAAA,UAD6C;AAE7C,MAAA,IAAI,EAAE,YAFuC;AAG7C;AACA,MAAA,gBAAgB,EAAE,QAAQ,CAAC,uBAAT,CAAiC,YAAjC,EAA+C,MAA/C,EAAuD,IAAvD,EAA6D,KAA7D,EAAoE,cAAc,CAAC,OAAf,CAAuB,gBAAvB,EAAyC,SAAzC,CAApE,CAJ2B;AAK7C,MAAA,MAAM,EAAE,IALqC;AAM7C,MAAA,IAN6C;AAO7C,MAAA,QAP6C;AAQ7C,MAAA,iBAAiB,EAAE,KAAK;AARqB,KAAzC,CAAN;AAUD;;AAtEsC,C","sourcesContent":["import { Arch } from \"builder-util\"\nimport * as path from \"path\"\nimport { Platform, Target, TargetSpecificOptions } from \"../core\"\nimport { copyFiles, getFileMatchers } from \"../fileMatcher\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { archive, tar } from \"./archive\"\nimport { appendBlockmap } from \"./differentialUpdateInfoBuilder\"\n\nexport class ArchiveTarget extends Target {\n readonly options: TargetSpecificOptions = (this.packager.config as any)[this.name]\n\n constructor(name: string, readonly outDir: string, private readonly packager: PlatformPackager<any>, private readonly isWriteUpdateInfo = false) {\n super(name)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const isMac = packager.platform === Platform.MAC\n const format = this.name\n\n let defaultPattern: string\n if (packager.platform === Platform.LINUX) {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${name}-${version}\" + (arch === Arch.x64 ? \"\" : \"-${arch}\") + \".${ext}\"\n }\n else {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${productName}-${version}\" + (arch === Arch.x64 ? \"\" : \"-${arch}\") + \"-${os}.${ext}\"\n }\n\n const artifactName = packager.expandArtifactNamePattern(this.options, format, arch, defaultPattern, false)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: `${isMac ? \"macOS \" : \"\"}${format}`,\n file: artifactPath,\n arch,\n })\n let updateInfo: any = null\n if (format.startsWith(\"tar.\")) {\n await tar(packager.compression, format, artifactPath, appOutDir, isMac, packager.info.tempDirManager)\n }\n else {\n let withoutDir = !isMac\n let dirToArchive = appOutDir\n if (isMac) {\n dirToArchive = path.dirname(appOutDir)\n const fileMatchers = getFileMatchers(packager.config, \"extraDistFiles\", dirToArchive, packager.createGetFileMatchersOptions(this.outDir, arch, packager.platformSpecificBuildOptions))\n if (fileMatchers == null) {\n dirToArchive = appOutDir\n }\n else {\n await copyFiles(fileMatchers, null, true)\n withoutDir = true\n }\n }\n\n const archiveOptions = {\n compression: packager.compression,\n withoutDir,\n }\n await archive(format, artifactPath, dirToArchive, archiveOptions)\n\n if (this.isWriteUpdateInfo && format === \"zip\") {\n updateInfo = await appendBlockmap(artifactPath)\n }\n }\n\n await packager.info.callArtifactBuildCompleted({\n updateInfo,\n file: artifactPath,\n // tslint:disable-next-line:no-invalid-template-strings\n safeArtifactName: packager.computeSafeArtifactName(artifactName, format, arch, false, defaultPattern.replace(\"${productName}\", \"${name}\")),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: this.isWriteUpdateInfo,\n })\n }\n}"],"sourceRoot":""}
|