Skip to content

Commit ff7a8c3

Browse files
committed
feat(linux): lowercased linux executable
BREAKING CHANGE: Linux executable name is always lowercased
1 parent 8416ba5 commit ff7a8c3

18 files changed

+99
-96
lines changed

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
osx_image: xcode7.3
2-
31
matrix:
42
include:
53
- os: osx
6-
env: TEST_FILES=BuildTest,linuxPackagerTest,globTest NODE_VERSION=7 PUBLISH_TO_NPM=true
4+
env: TEST_FILES=BuildTest,extraMetadataTest,globTest,filesTest,ignoreTest,linux.* NODE_VERSION=7 PUBLISH_TO_NPM=true
75

86
- os: osx
9-
env: TEST_FILES=winPackagerTest,nsisTest,macPackagerTest NODE_VERSION=6
7+
env: TEST_FILES=windows.*,mac.* NODE_VERSION=7
108

119
- os: osx
12-
env: TEST_FILES=macPackagerTest,CodeSignTest NODE_VERSION=6
10+
env: TEST_FILES=mac.* NODE_VERSION=6
1311

1412
language: c
1513

test/src/BuildTest.ts

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -170,72 +170,6 @@ test("afterPack", () => {
170170
})
171171
})
172172

173-
test.ifDevOrLinuxCi("extra metadata", () => {
174-
const extraMetadata = {
175-
foo: {
176-
bar: 12,
177-
},
178-
build: {
179-
linux: {
180-
executableName: "NewName"
181-
}
182-
}
183-
}
184-
return assertPack("test-app-one", {
185-
targets: Platform.LINUX.createTarget(DIR_TARGET),
186-
extraMetadata: extraMetadata,
187-
}, {
188-
projectDirCreated: projectDir => modifyPackageJson(projectDir, data => {
189-
data.foo = {
190-
bar: 42,
191-
existingProp: 22,
192-
}
193-
}),
194-
packed: async context => {
195-
await assertThat(path.join(context.getContent(Platform.LINUX), "NewName")).isFile()
196-
assertThat(JSON.parse(extractFile(path.join(context.getResources(Platform.LINUX), "app.asar"), "package.json").toString())).hasProperties({
197-
foo: {
198-
bar: 12,
199-
existingProp: 22,
200-
}
201-
})
202-
}
203-
})
204-
})
205-
206-
test.ifDevOrLinuxCi("extra metadata - two", () => {
207-
const extraMetadata = {
208-
build: {
209-
linux: {
210-
executableName: "NewName"
211-
}
212-
}
213-
}
214-
return assertPack("test-app", {
215-
targets: Platform.LINUX.createTarget(DIR_TARGET),
216-
extraMetadata: extraMetadata,
217-
}, {
218-
packed: async context => {
219-
await assertThat(path.join(context.getContent(Platform.LINUX), "NewName")).isFile()
220-
}
221-
})
222-
})
223-
224-
test.ifMac("extra metadata - override icon", appTwoThrows(/ENOENT: no such file or directory/, {
225-
targets: Platform.MAC.createTarget(DIR_TARGET),
226-
extraMetadata: {
227-
build: {
228-
mac: {
229-
icon: "dev"
230-
}
231-
},
232-
},
233-
}, {
234-
packed: async context => {
235-
await assertThat(path.join(context.getContent(Platform.LINUX), "NewName")).isFile()
236-
}
237-
}))
238-
239173
// ifMac("app-executable-deps", () => {
240174
// return assertPack("app-executable-deps", {
241175
// targets: Platform.current().createTarget(DIR_TARGET),

test/src/extraMetadataTest.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { assertPack, modifyPackageJson, appTwoThrows } from "./helpers/packTester"
2+
import { Platform, DIR_TARGET } from "out"
3+
import { assertThat } from "./helpers/fileAssert"
4+
import * as path from "path"
5+
import { extractFile } from "asar-electron-builder"
6+
7+
test.ifDevOrLinuxCi("extra metadata", () => {
8+
const extraMetadata = {
9+
foo: {
10+
bar: 12,
11+
},
12+
build: {
13+
linux: {
14+
executableName: "new-name"
15+
}
16+
}
17+
}
18+
return assertPack("test-app-one", {
19+
targets: Platform.LINUX.createTarget(DIR_TARGET),
20+
extraMetadata: extraMetadata,
21+
}, {
22+
projectDirCreated: projectDir => modifyPackageJson(projectDir, data => {
23+
data.foo = {
24+
bar: 42,
25+
existingProp: 22,
26+
}
27+
}),
28+
packed: async context => {
29+
await assertThat(path.join(context.getContent(Platform.LINUX), "new-name")).isFile()
30+
assertThat(JSON.parse(extractFile(path.join(context.getResources(Platform.LINUX), "app.asar"), "package.json").toString())).hasProperties({
31+
foo: {
32+
bar: 12,
33+
existingProp: 22,
34+
}
35+
})
36+
}
37+
})
38+
})
39+
40+
test.ifDevOrLinuxCi("extra metadata - two", () => {
41+
const extraMetadata = {
42+
build: {
43+
linux: {
44+
executableName: "NewName"
45+
}
46+
}
47+
}
48+
return assertPack("test-app", {
49+
targets: Platform.LINUX.createTarget(DIR_TARGET),
50+
extraMetadata: extraMetadata,
51+
}, {
52+
packed: async context => {
53+
await assertThat(path.join(context.getContent(Platform.LINUX), "NewName")).isFile()
54+
}
55+
})
56+
})
57+
58+
test.ifMac("extra metadata - override icon", appTwoThrows(/ENOENT: no such file or directory/, {
59+
targets: Platform.MAC.createTarget(DIR_TARGET),
60+
extraMetadata: {
61+
build: {
62+
mac: {
63+
icon: "dev"
64+
}
65+
},
66+
},
67+
}, {
68+
packed: async context => {
69+
await assertThat(path.join(context.getContent(Platform.LINUX), "NewName")).isFile()
70+
}
71+
}))

test/src/helpers/expectedContents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const expectedLinuxContents = ["/",
1515
"/opt/TestApp/LICENSES.chromium.html",
1616
"/opt/TestApp/natives_blob.bin",
1717
"/opt/TestApp/snapshot_blob.bin",
18-
"/opt/TestApp/TestApp",
18+
"/opt/TestApp/testapp",
1919
"/opt/TestApp/ui_resources_200_percent.pak",
2020
"/opt/TestApp/views_resources_200_percent.pak",
2121
"/usr/share/",

test/src/helpers/runTests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ async function runTests() {
9898
const circleNodeIndex = parseInt(process.env.CIRCLE_NODE_INDEX, 10)
9999
if (circleNodeIndex === 0 || circleNodeIndex === 2) {
100100
skipWin = true
101-
args.push("linuxPackagerTest.js", "linuxArchiveTest.js", "debTest.js", "fpmTest.js", "BuildTest.js", "mainEntryTest.js", "globTest.js", "filesTest.js", "ignoreTest.js")
101+
args.push("linux.*", "BuildTest.js", "extraMetadataTest.js", "mainEntryTest.js", "globTest.js", "filesTest.js", "ignoreTest.js")
102102
}
103103
else {
104-
args.push("winPackagerTest.js", "squirrelWindowsTest.js", "nsisTest.js", "nsisBoring.js", "squirrelWindowsTest.js", "macPackagerTest.js", "macArchiveTest.js", "masTest.js", "dmgTest.js")
104+
args.push("windows.*", "mac.*")
105105
args.push(...baseForLinuxTests)
106106
}
107107
console.log(`Test files for node ${circleNodeIndex}: ${args.join(", ")}`)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Platform, Arch } from "out"
2-
import { app } from "./helpers/packTester"
2+
import { app } from "../helpers/packTester"
33

44
test.ifNotWindows("deb", app({targets: Platform.LINUX.createTarget("deb")}))
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// "apk" is very slow, don't test for now
22
import { Platform } from "out"
3-
import { app } from "./helpers/packTester"
3+
import { app } from "../helpers/packTester"
44

55
test.ifDevOrLinuxCi("targets", app({targets: Platform.LINUX.createTarget(["sh", "freebsd", "pacman", "zip", "7z"])}))
66

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { Platform } from "out"
2-
import { app } from "./helpers/packTester"
2+
import { app } from "../helpers/packTester"
33

44
test.ifDevOrLinuxCi("tar", app({targets: Platform.LINUX.createTarget(["tar.xz", "tar.lz", "tar.bz2"])}))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { modifyPackageJson, app, appThrows } from "./helpers/packTester"
1+
import { modifyPackageJson, app, appThrows } from "../helpers/packTester"
22
import { remove } from "fs-extra-p"
33
import * as path from "path"
44
import { Platform } from "out"
55

66
test.ifDevOrLinuxCi("AppImage", app({targets: Platform.LINUX.createTarget()}))
77

8-
test.ifNotCi("snap", app({targets: Platform.LINUX.createTarget("snap")}))
8+
// test.ifNotCi("snap", app({targets: Platform.LINUX.createTarget("snap")}))
99

1010
test.ifDevOrLinuxCi("AppImage - default icon", app({
1111
targets: Platform.LINUX.createTarget("appimage"),
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createKeychain } from "out/codeSign"
2-
import { assertThat } from "./helpers/fileAssert"
3-
import { CSC_LINK } from "./helpers/codeSignData"
2+
import { assertThat } from "../helpers/fileAssert"
3+
import { CSC_LINK } from "../helpers/codeSignData"
44
import { removePassword } from "out/util/util"
55
import { TmpDir } from "out/util/tmp"
66

0 commit comments

Comments
 (0)