Skip to content

Commit

Permalink
feat(mac): mac build zip file name does not follow build.artifactName
Browse files Browse the repository at this point in the history
Close #1398
  • Loading branch information
develar committed Mar 29, 2017
1 parent 55abc32 commit 1affc61
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 38 deletions.
1 change: 1 addition & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- Which version of electron-builder are you using? -->
<!-- Please always try to use latest version before report. -->
* **Version**:

<!-- Which version of electron-updater are you using (if applicable)? -->
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"///": "all dependencies for all packages (hoisted)",
"dependencies": {
"7zip-bin": "^2.0.4",
"ajv": "^5.0.4-beta.0",
"ajv": "^5.0.4-beta.2",
"ajv-keywords": "^2.0.1-beta.2",
"archiver": "^1.3.0",
"aws-sdk": "^2.33.0",
"aws-sdk": "^2.34.0",
"bluebird-lst": "^1.0.2",
"chalk": "^1.1.3",
"chromium-pickle-js": "^0.2.0",
Expand Down Expand Up @@ -77,7 +77,7 @@
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-plugin-transform-inline-imports-commonjs": "^1.2.0",
"catharsis": "^0.8.8",
"convert-source-map": "^1.4.0",
"convert-source-map": "^1.5.0",
"decompress-zip": "^0.3.0",
"depcheck": "^0.6.7",
"globby": "^6.1.0",
Expand All @@ -90,7 +90,7 @@
"ts-babel": "^3.0.0",
"tslint": "^4.5.1",
"typescript": "^2.2.2",
"typescript-json-schema": "0.10.0",
"typescript-json-schema": "0.11.0",
"whitespace": "^2.1.0",
"xml2js": "^0.4.17"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"homepage": "https://github.com/electron-userland/electron-builder",
"dependencies": {
"7zip-bin": "^2.0.4",
"ajv": "^5.0.4-beta.0",
"ajv": "^5.0.4-beta.2",
"ajv-keywords": "^2.0.1-beta.2",
"bluebird-lst": "^1.0.2",
"chalk": "^1.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class MacPackager extends PlatformPackager<MacOptions> {
break

default:
mapper(name, outDir => name === "mas" || name === "mas-dev" ? new NoOpTarget(name) : createCommonTarget(name, path.join(outDir, "mac"), this))
mapper(name, outDir => name === "mas" || name === "mas-dev" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this))
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/targets/ArchiveTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class ArchiveTarget extends Target {
const outFile = (() => {
switch (packager.platform) {
case Platform.MAC:
return path.join(outDir, packager.generateName2(format, "mac", false))
return path.join(outDir, packager.expandArtifactNamePattern(this.options, format, arch, "${productName}-${version}-${os}.${ext}"))
case Platform.WINDOWS:
return path.join(outDir, packager.generateName(format, arch, false, "win"))
case Platform.LINUX:
Expand Down
2 changes: 1 addition & 1 deletion packages/lint.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict"

const Linter = require("tslint").Linter
const { Linter } = require("tslint")
const path = require("path")

const configuration = {
Expand Down
2 changes: 1 addition & 1 deletion test/out/mac/__snapshots__/macPackagerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Object {
"mac": Array [
Object {
"arch": 1,
"file": "TestApp-1.1.0.dmg",
"file": "TestApp-1.1.0-mac.dmg",
"safeArtifactName": "TestApp-1.1.0.dmg",
},
Object {
Expand Down
2 changes: 1 addition & 1 deletion test/src/helpers/packTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export function createMacTargetTest(target: Array<MacOsTargetName>) {

const tempDir = path.join(context.outDir, getTempName())
await mkdir(tempDir)
await exec("tar", ["xf", path.join(context.outDir, "mac", "Test App ßW-1.1.0-mac.tar.gz")], {cwd: tempDir})
await exec("tar", ["xf", path.join(context.outDir, "Test App ßW-1.1.0-mac.tar.gz")], {cwd: tempDir})
await assertThat(path.join(tempDir, "Test App ßW.app")).isDirectory()
}
})
Expand Down
5 changes: 4 additions & 1 deletion test/src/mac/macPackagerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ test.ifMac("two-package", () => assertPack("test-app", {
appMetadata: {
repository: "foo/bar"
},
config: {
artifactName: "${name}-${version}-${os}.${ext}",
},
}, {
signed: true,
}))
Expand Down Expand Up @@ -60,7 +63,7 @@ test.ifMac("one-package", app({
await assertThat(path.join(appDir, "Contents", "Resources", "someFoo.icns")).isFile()
},
packed: async context => {
expect(convertUpdateInfo(await readJson(path.join(context.outDir, "mac", "latest-mac.json")))).toMatchSnapshot()
expect(convertUpdateInfo(await readJson(path.join(context.outDir, "latest-mac.json")))).toMatchSnapshot()
},
}))

Expand Down
60 changes: 33 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"7zip-bin-mac" "^1.0.1"
"7zip-bin-win" "^2.0.2"

"@types/electron@^1.4.34":
version "1.4.34"
resolved "https://registry.yarnpkg.com/@types/electron/-/electron-1.4.34.tgz#f9ff3d4b54c0abc80710f40f935c59b253da23ad"
"@types/electron@^1.4.35":
version "1.4.35"
resolved "https://registry.yarnpkg.com/@types/electron/-/electron-1.4.35.tgz#48e5e6ef0b49f27b9f78b87d80f796e3f0a4f33c"
dependencies:
"@types/node" "*"

Expand All @@ -45,8 +45,8 @@
resolved "https://registry.yarnpkg.com/@types/node-forge/-/node-forge-0.6.8.tgz#fb38ae420be9c9b679bed3f974201120947b920f"

"@types/node@*":
version "7.0.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.11.tgz#55680189f2335f080f0aeb57871f0b9823646d89"
version "7.0.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9"

"@types/source-map-support@^0.2.28":
version "0.2.28"
Expand Down Expand Up @@ -97,7 +97,7 @@ ajv@^4.9.1:
co "^4.6.0"
json-stable-stringify "^1.0.1"

ajv@^5.0.4-beta.0:
ajv@^5.0.4-beta.2:
version "5.0.4-beta.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.0.4-beta.2.tgz#2b1dbc09cbd69ee0797489894ab38d12c914e121"
dependencies:
Expand Down Expand Up @@ -271,9 +271,9 @@ asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"

aws-sdk@^2.32.0:
version "2.32.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.32.0.tgz#9fe278b2ec1b12fddd1afeb74439581cdc2e5990"
aws-sdk@^2.34.0:
version "2.34.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.34.0.tgz#bf96fb617aa0e1d8728760ca7f00d46d0d9c685c"
dependencies:
buffer "4.9.1"
crypto-browserify "1.0.9"
Expand Down Expand Up @@ -854,9 +854,9 @@ content-type-parser@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94"

convert-source-map@^1.1.0, convert-source-map@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.4.0.tgz#e3dad195bf61bfe13a7a3c73e9876ec14a0268f3"
convert-source-map@^1.1.0, convert-source-map@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5"

core-js@^2.4.0:
version "2.4.1"
Expand Down Expand Up @@ -2285,9 +2285,9 @@ node-emoji@^1.5.1:
dependencies:
string.prototype.codepointat "^0.2.0"

node-forge@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.0.tgz#5e0782a44e5e093fae3676d59f84ecfb38a4baad"
node-forge@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.1.tgz#9da611ea08982f4b94206b3beb4cc9665f20c300"

node-int64@^0.4.0:
version "0.4.0"
Expand Down Expand Up @@ -2324,8 +2324,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-
validate-npm-package-license "^3.0.1"

normalize-path@^2.0.0, normalize-path@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a"
version "2.1.1"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
dependencies:
remove-trailing-separator "^1.0.1"

npm-run-path@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -2608,8 +2610,8 @@ randomatic@^1.1.3:
kind-of "^3.0.2"

rc@^1.0.1, rc@^1.1.6, rc@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.7.tgz#c5ea564bb07aff9fd3a5b32e906c1d3a65940fea"
version "1.2.0"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.0.tgz#c7de973b7b46297c041366b2fd3d2363b1697c66"
dependencies:
deep-extend "~0.4.0"
ini "~1.3.0"
Expand Down Expand Up @@ -2702,6 +2704,10 @@ registry-url@^3.0.3:
dependencies:
rc "^1.0.1"

remove-trailing-separator@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4"

repeat-element@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a"
Expand Down Expand Up @@ -3207,16 +3213,16 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

typescript-json-schema@0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/typescript-json-schema/-/typescript-json-schema-0.10.0.tgz#e05a02c466e9f5998d09e9565dab76f1bf5d6bae"
typescript-json-schema@0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/typescript-json-schema/-/typescript-json-schema-0.11.0.tgz#58b8ca2697937bb99edc6662c7bbf39c6145b231"
dependencies:
glob "~7.1.1"
json-stable-stringify "^1.0.1"
typescript "~2.1.5"
yargs "^6.6.0"
yargs "^7.0.2"

typescript@^2.2.1:
typescript@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.2.tgz#606022508479b55ffa368b58fee963a03dfd7b0c"

Expand All @@ -3229,8 +3235,8 @@ typical@^2.4.2, typical@^2.6.0:
resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.0.tgz#89d51554ab139848a65bcc2c8772f8fb450c40ed"

uglify-js@^2.6:
version "2.8.16"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.16.tgz#d286190b6eefc6fd65eb0ecac6551e0b0e8839a4"
version "2.8.18"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.18.tgz#925d14bae48ab62d1883b41afe6e2261662adb8e"
dependencies:
source-map "~0.5.1"
yargs "~3.10.0"
Expand Down Expand Up @@ -3535,7 +3541,7 @@ yargs-parser@^5.0.0:
dependencies:
camelcase "^3.0.0"

yargs@^6.0.0, yargs@^6.3.0, yargs@^6.6.0:
yargs@^6.0.0, yargs@^6.3.0:
version "6.6.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208"
dependencies:
Expand Down

0 comments on commit 1affc61

Please sign in to comment.