Skip to content

Commit

Permalink
feat: DMG — use bzip2 compression (old: 40MB, new: 36MB)
Browse files Browse the repository at this point in the history
Also, compression=store is respected — DMG NONE will be used (speed up tests)
  • Loading branch information
develar committed Apr 28, 2016
1 parent 1970550 commit e0c3b92
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/develar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ osx_image: xcode7.3

env:
- NODE_VERSION=4
- NODE_VERSION=5
- NODE_VERSION=6

language: ruby

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"typescript": "1.9.0-dev.20160425"
},
"optionalDependencies": {
"appdmg": "^0.3.7"
"appdmg-tf": "^0.3.11"
},
"config": {
"pre-git": {
Expand Down
23 changes: 20 additions & 3 deletions src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,30 @@ export default class OsXPackager extends PlatformPackager<OsXBuildOptions> {
if (this.target.includes("dmg") || this.target.includes("default")) {
promises.push(new BluebirdPromise<any>(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`)))
}
Expand Down
2 changes: 1 addition & 1 deletion typings/appdmg.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare namespace appdmg {
}
}

declare module "appdmg" {
declare module "appdmg-tf" {
import { EventEmitter } from "events"

function appdmg(options: appdmg.Options): EventEmitter
Expand Down

0 comments on commit e0c3b92

Please sign in to comment.