Skip to content

Commit

Permalink
fix: don't try to build OS X x64
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Jun 12, 2016
1 parent 63c2529 commit ee64432
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dist/
/typings/browser/
/typings/browser.d.ts
/typings/main.d.ts
.DS_Store
.DS_Store
.idea/shelf/
9 changes: 7 additions & 2 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
}

if (types.length === 0) {
for (let arch of commonArch()) {
archToType.set(arch, [])
if (platform === Platform.OSX) {
archToType.set(Arch.x64, [])
}
else {
for (let arch of commonArch()) {
archToType.set(arch, [])
}
}
return
}
Expand Down
4 changes: 4 additions & 0 deletions src/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ export class Platform {

createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>> {
const archToType = new Map()
if (this === Platform.OSX) {
archs = [Arch.x64]
}

for (let arch of (archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs)) {
archToType.set(arch, type == null ? [] : (Array.isArray(type) ? type : [type]))
}
Expand Down
1 change: 1 addition & 0 deletions test/src/BuildTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ test("cli", () => {
}

assertThat(parse("--platform osx")).isEqualTo(expected({targets: Platform.OSX.createTarget()}))
assertThat(parse("-owl --x64 --ia32")).isEqualTo(expected({targets: new Map([...Platform.OSX.createTarget(null, Arch.x64), ...Platform.WINDOWS.createTarget(null, Arch.x64, Arch.ia32), ...Platform.LINUX.createTarget(null, Arch.x64, Arch.ia32)])}))
assertThat(parse("--osx")).isEqualTo(expected({targets: Platform.OSX.createTarget()}))
assertThat(parse("--arch x64")).isEqualTo(expected({targets: Platform.current().createTarget(null, Arch.x64)}))
assertThat(parse("--ia32 --x64")).isEqualTo(expected({targets: Platform.current().createTarget(null, Arch.x64, Arch.ia32)}))
Expand Down

0 comments on commit ee64432

Please sign in to comment.