From e0c3b92d96311e50c5076b503e51d37e7bb6922e Mon Sep 17 00:00:00 2001 From: develar Date: Thu, 28 Apr 2016 09:34:25 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20DMG=20=E2=80=94=20use=20bzip2=20compres?= =?UTF-8?q?sion=20(old:=2040MB,=20new:=2036MB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, compression=store is respected — DMG NONE will be used (speed up tests) --- .idea/dictionaries/develar.xml | 1 + .travis.yml | 2 +- appveyor.yml | 2 +- package.json | 2 +- src/macPackager.ts | 23 ++++++++++++++++++++--- typings/appdmg.d.ts | 2 +- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.idea/dictionaries/develar.xml b/.idea/dictionaries/develar.xml index caa8feae166..a4b01e2d88d 100644 --- a/.idea/dictionaries/develar.xml +++ b/.idea/dictionaries/develar.xml @@ -36,6 +36,7 @@ templating testapp tsconfig + udbz userprofile veyor winstaller diff --git a/.travis.yml b/.travis.yml index 6d7be5f7e10..2a576eaf633 100755 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ osx_image: xcode7.3 env: - NODE_VERSION=4 - - NODE_VERSION=5 + - NODE_VERSION=6 language: ruby diff --git a/appveyor.yml b/appveyor.yml index 1a5c21d29bc..d0765bc8416 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ cache: - '%USERPROFILE%\.electron' install: - - ps: Install-Product node 5 x64 + - ps: Install-Product node 6 x64 - npm install npm -g - node -v - npm -v diff --git a/package.json b/package.json index b0c45093ce3..8d9153120ed 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "typescript": "1.9.0-dev.20160425" }, "optionalDependencies": { - "appdmg": "^0.3.7" + "appdmg-tf": "^0.3.11" }, "config": { "pre-git": { diff --git a/src/macPackager.ts b/src/macPackager.ts index 46cc1504a06..7606ddd0915 100644 --- a/src/macPackager.ts +++ b/src/macPackager.ts @@ -139,13 +139,30 @@ export default class OsXPackager extends PlatformPackager { if (this.target.includes("dmg") || this.target.includes("default")) { promises.push(new BluebirdPromise(async(resolve, reject) => { log("Creating DMG") - const emitter = require("appdmg")({ + const dmgOptions = { target: artifactPath, basepath: this.projectDir, - specification: await this.computeEffectiveDistOptions(appOutDir) + specification: await this.computeEffectiveDistOptions(appOutDir), + compression: this.devMetadata.build.compression === "store" ? "NONE" : "UDBZ" + } + + if (debug.enabled) { + debug(`appdmg: ${JSON.stringify(dmgOptions, null, 2)}`) + } + + const emitter = require("appdmg-tf")(dmgOptions) + emitter.on("error", (e: Error) => { + console.error(e) + reject(e) }) - emitter.on("error", reject) emitter.on("finish", () => resolve()) + if (debug.enabled) { + emitter.on("progress", (info: any) => { + if (info.type === "step-begin") { + debug(`appdmg: [${info.current}] ${info.title}`) + } + }) + } }) .then(() => this.dispatchArtifactCreated(artifactPath, `${this.metadata.name}-${this.metadata.version}.dmg`))) } diff --git a/typings/appdmg.d.ts b/typings/appdmg.d.ts index cd0cb00fe13..3f19b3b2db7 100644 --- a/typings/appdmg.d.ts +++ b/typings/appdmg.d.ts @@ -15,7 +15,7 @@ declare namespace appdmg { } } -declare module "appdmg" { +declare module "appdmg-tf" { import { EventEmitter } from "events" function appdmg(options: appdmg.Options): EventEmitter