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,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;QAC3E,CAAC,CAAC,CAAA;IACJ,CAAC;AAGH,CAAC;AAlEqB,wBAAgB,mBAkErC,CAAA","sourcesContent":["import { AppMetadata, InfoRetriever, ProjectMetadataProvider, Metadata } from \"./repositoryInfo\"\nimport EventEmitter = NodeJS.EventEmitter\nimport { tsAwaiter } from \"./awaiter\"\nimport { Promise as BluebirdPromise } from \"bluebird\"\nimport * as path from \"path\"\nimport packager = require(\"electron-packager-tf\")\n\nconst __awaiter = tsAwaiter\nArray.isArray(__awaiter)\n\nexport interface DevMetadata extends Metadata {\n build: DevBuildMetadata\n}\n\nexport interface DevBuildMetadata {\n osx: appdmg.Specification\n win: any,\n linux: any\n}\n\nexport interface PackagerOptions {\n arch?: string\n\n dist?: boolean\n githubToken?: string\n\n sign?: string\n\n platform?: Array<string>\n target?: Array<string>\n\n appDir?: string\n\n projectDir?: string\n\n cscLink?: string\n cscKeyPassword?: string\n}\n\nexport interface BuildInfo extends ProjectMetadataProvider {\n options: PackagerOptions\n\n devMetadata: DevMetadata\n\n projectDir: string\n appDir: string\n\n electronVersion: string\n\n repositoryInfo: InfoRetriever\n eventEmitter: EventEmitter\n}\n\nexport abstract class PlatformPackager<DC> implements ProjectMetadataProvider {\n protected options: PackagerOptions\n\n protected projectDir: string\n\n metadata: AppMetadata\n devMetadata: Metadata\n\n customDistOptions: DC\n\n protected abstract getBuildConfigurationKey(): string\n\n constructor(protected info: BuildInfo) {\n this.options = info.options\n this.projectDir = info.projectDir\n this.metadata = info.metadata\n this.devMetadata = info.devMetadata\n\n if (this.options.dist) {\n const buildMetadata: any = info.devMetadata.build\n this.customDistOptions = buildMetadata == null ? buildMetadata : buildMetadata[this.getBuildConfigurationKey()]\n }\n }\n\n protected dispatchArtifactCreated(path: string) {\n this.info.eventEmitter.emit(\"artifactCreated\", path)\n }\n\n pack(platform: string, arch: string, outDir: string): Promise<any> {\n return new BluebirdPromise((resolve, reject) => {\n const version = this.metadata.version\n let buildVersion = version\n const buildNumber = process.env.TRAVIS_BUILD_NUMBER || process.env.APPVEYOR_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM\n if (buildNumber != null) {\n buildVersion += \".\" + buildNumber\n }\n\n const options = Object.assign({\n dir: this.info.appDir,\n out: path.dirname(outDir),\n name: this.metadata.name,\n platform: platform,\n arch: arch,\n version: this.info.electronVersion,\n icon: path.join(this.projectDir, \"build\", \"icon\"),\n asar: true,\n overwrite: true,\n \"app-version\": version,\n \"build-version\": buildVersion,\n \"version-string\": {\n CompanyName: this.metadata.author,\n FileDescription: this.metadata.description,\n ProductVersion: version,\n FileVersion: buildVersion,\n ProductName: this.metadata.name,\n InternalName: this.metadata.name,\n }\n }, this.metadata.build, {\"tmpdir\": false})\n\n // this option only for windows-installer\n delete options.iconUrl\n packager(options, error => error == null ? resolve(null) : reject(error))\n })\n }\n\n abstract packageInDistributableFormat(outDir: string, arch: string): Promise<any>\n}"]}
\No newline at end of file