-
-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(maker): use the target platform/arch API from Packager to de…
…termine "all" archs Adds arm64 support to `make --arch=all`
- Loading branch information
Showing
4 changed files
with
33 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { allOfficialArchsForPlatformAndVersion } from 'electron-packager/targets'; | ||
|
||
export default function parseArchs(platform, declaredArch, electronVersion) { | ||
if (declaredArch === 'all') { | ||
return allOfficialArchsForPlatformAndVersion(platform, electronVersion) || ['x64']; | ||
} | ||
|
||
return declaredArch.split(','); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { expect } from 'chai'; | ||
|
||
import parseArchs from '../../src/util/parse-archs'; | ||
|
||
describe('parse-archs', () => { | ||
it('should make an Array out of one arch', () => { | ||
expect(parseArchs('linux', 'x64', '1.7.0')).to.deep.equal(['x64']); | ||
}); | ||
|
||
it('should transform comma-separated values into an Array', () => { | ||
expect(parseArchs('linux', 'ia32,x64', '1.7.0')).to.deep.equal(['ia32', 'x64']); | ||
}); | ||
|
||
it('should use the official Electron arch list when arch is "all"', () => { | ||
expect(parseArchs('win32', 'all', '1.7.0')).to.deep.equal(['ia32', 'x64']); | ||
}); | ||
|
||
it('should default to [x64] when the platform is unknown', () => { | ||
expect(parseArchs('nonexistent', 'all', '1.7.0')).to.deep.equal(['x64']); | ||
}); | ||
}); |