Skip to content

Commit aa05ac0

Browse files
committed
chore: remove "osx" name support — use "mac" instead
BREAKING CHANGE: remove "osx" name support — use "mac" instead
1 parent b1ea8cd commit aa05ac0

File tree

9 files changed

+7
-44
lines changed

9 files changed

+7
-44
lines changed

src/builder.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
148148
delete r.l
149149
delete r.w
150150
delete r.windows
151-
delete r.osx
152151
delete r.macos
153152
delete r.$0
154153
delete r._

src/cliOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function createYargs(): any {
1414
.example("build --em.foo=bar", "set application package.json property `foo` to `bar`")
1515
.option("mac", {
1616
group: buildGroup,
17-
alias: ["m", "o", "osx", "macos"],
17+
alias: ["m", "o", "macos"],
1818
describe: `Build for MacOS, accepts target list (see ${underline("https://goo.gl/HAnnq8")}).`,
1919
type: "array",
2020
})
@@ -71,7 +71,7 @@ export function createYargs(): any {
7171
.option("platform", {
7272
group: deprecated,
7373
describe: "The target platform (preferred to use --mac, --win or --linux)",
74-
choices: ["mac", "osx", "win", "linux", "darwin", "win32", "all"],
74+
choices: ["mac", "win", "linux", "darwin", "win32", "all"],
7575
})
7676
.option("arch", {
7777
group: deprecated,

src/macPackager.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export default class MacPackager extends PlatformPackager<MacOptions> {
3939
return iconPath == null ? await this.getDefaultIcon("icns") : path.resolve(this.projectDir, iconPath)
4040
}
4141

42-
normalizePlatformSpecificBuildOptions(options: MacOptions | n): MacOptions {
43-
return super.normalizePlatformSpecificBuildOptions(options == null ? (<any>this.info.devMetadata.build).osx : options)
44-
}
45-
4642
createTargets(targets: Array<string>, mapper: (name: string, factory: () => Target) => void, cleanupTasks: Array<() => Promise<any>>): void {
4743
for (let name of targets) {
4844
switch (name) {

src/metadata.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ export interface BuildMetadata {
157157
*/
158158
readonly dmg?: DmgOptions | null
159159

160-
// deprecated
161-
readonly osx?: MacOptions | null
162-
163160
/*
164161
See [.build.mas](#MasBuildOptions).
165162
*/
@@ -377,7 +374,6 @@ export class Platform {
377374
switch (name) {
378375
case Platform.MAC.nodeName:
379376
case Platform.MAC.name:
380-
case "osx":
381377
return Platform.MAC
382378

383379
case Platform.WINDOWS.nodeName:

src/packager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ export class Packager implements BuildInfo {
201201
if (build["osx-sign"] != null) {
202202
throw new Error("osx-sign is deprecated and not supported — please see https://github.com/electron-userland/electron-builder/wiki/Code-Signing")
203203
}
204+
if (build["osx"] != null) {
205+
throw new Error(`"osx" in the "build" is deprecated and not supported — please see use "mac" instead`)
206+
}
204207

205208
const author = appMetadata.author
206209
if (author == null) {

src/targets/dmg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class DmgTarget extends TargetEx {
178178
x: 400,
179179
y: 100,
180180
},
181-
}, Object.assign({}, this.packager.devMetadata.build.osx, packager.devMetadata.build.dmg))
181+
}, packager.devMetadata.build.dmg)
182182

183183
// appdmg
184184
const oldPosition = specification.window.position

test/src/BuildTest.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test("cli", () => {
2626
return normalizeOptions(yargs.parse(input.split(" ")))
2727
}
2828

29-
assertThat(parse("--platform osx")).isEqualTo(expected({targets: Platform.MAC.createTarget()}))
3029
assertThat(parse("--platform mac")).isEqualTo(expected({targets: Platform.MAC.createTarget()}))
3130

3231
const all = expected({targets: new Map([...Platform.MAC.createTarget(null, Arch.x64), ...Platform.WINDOWS.createTarget(null, Arch.x64, Arch.ia32), ...Platform.LINUX.createTarget(null, Arch.x64, Arch.ia32)])})
@@ -38,7 +37,6 @@ test("cli", () => {
3837
assertThat(parse("--ia32 --dir")).isEqualTo(expected({targets: Platform.current().createTarget(DIR_TARGET, Arch.ia32)}))
3938
assertThat(parse("--platform linux --dir")).isEqualTo(expected({targets: Platform.LINUX.createTarget(DIR_TARGET)}))
4039

41-
assertThat(parse("--osx")).isEqualTo(expected({targets: Platform.MAC.createTarget()}))
4240
assertThat(parse("--arch x64")).isEqualTo(expected({targets: Platform.current().createTarget(null, Arch.x64)}))
4341
assertThat(parse("--ia32 --x64")).isEqualTo(expected({targets: Platform.current().createTarget(null, Arch.x64, Arch.ia32)}))
4442
assertThat(parse("--linux")).isEqualTo(expected({targets: Platform.LINUX.createTarget()}))

test/src/helpers/packTester.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export async function assertPack(fixtureName: string, packagerOptions: PackagerO
7070
const customTmpDir = process.env.TEST_APP_TMP_DIR
7171
let dirToDelete: string | null = null
7272
if (useTempDir) {
73-
// non-osx test uses the same dir as osx test, but we cannot share node_modules (because tests executed in parallel)
73+
// non-macOS test uses the same dir as macOS test, but we cannot share node_modules (because tests executed in parallel)
7474
const dir = customTmpDir == null ? path.join(testDir, `${(tmpDirCounter++).toString(16)}`) : path.resolve(customTmpDir)
7575
if (customTmpDir == null) {
7676
dirToDelete = dir

test/src/macPackagerTest.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -187,30 +187,6 @@ test.ifOsx("no build directory", app(platform(Platform.MAC), {
187187
projectDirCreated: projectDir => remove(path.join(projectDir, "build"))
188188
}))
189189

190-
test.ifOsx("custom background - old way", () => {
191-
let platformPackager: CheckingMacPackager = null
192-
const customBackground = "customBackground.tiff"
193-
return assertPack("test-app-one", {
194-
targets: Platform.MAC.createTarget(),
195-
platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager)
196-
}, {
197-
projectDirCreated: projectDir => BluebirdPromise.all([
198-
copy(path.join(__dirname, "..", "..", "templates", "dmg", "background.tiff"), path.join(projectDir, customBackground)),
199-
modifyPackageJson(projectDir, data => {
200-
data.build.osx = {
201-
background: customBackground,
202-
icon: "foo.icns",
203-
}
204-
})
205-
]),
206-
packed: () => {
207-
assertThat(platformPackager.effectiveDistOptions.background).isEqualTo(customBackground)
208-
assertThat(platformPackager.effectiveDistOptions.icon).isEqualTo("foo.icns")
209-
return BluebirdPromise.resolve(null)
210-
},
211-
})
212-
})
213-
214190
test.ifOsx("custom background - new way", () => {
215191
let platformPackager: CheckingMacPackager = null
216192
const customBackground = "customBackground.png"
@@ -229,11 +205,6 @@ test.ifOsx("custom background - new way", () => {
229205
background: customBackground,
230206
icon: "foo.icns",
231207
}
232-
233-
data.build.osx = {
234-
background: null,
235-
icon: "ignoreMe.icns",
236-
}
237208
})
238209
]),
239210
packed: async context => {

0 commit comments

Comments
 (0)