Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/targets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { warning } from './common';
import { debug, warning } from './common';
import { getHostArch } from '@electron/get';
import semver from 'semver';
import {
Expand Down Expand Up @@ -68,6 +68,12 @@ export function createPlatformArchPairs(
const combinations: Array<[SupportedPlatform, SupportedArch]> = [];

for (const arch of selectedArchs) {
if (arch === 'universal' && process.platform !== 'darwin') {
debug(
`Skipping universal arch for ${process.platform} because @electron/universal only works on darwin`,
);
continue;
}
for (const platform of selectedPlatforms) {
if (usingOfficialElectronPackages(opts)) {
if (!validOfficialPlatformArch(platform, arch)) {
Expand Down
42 changes: 25 additions & 17 deletions test/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ test(
'build for all available official targets',
testMultiTarget(
{ all: true, electronVersion: config.version },
util.allPlatformArchCombosCount - 2,
util.allPlatformArchCombosCount -
2 -
(process.platform === 'darwin' ? 0 : 2),
'Packages should be generated for all possible platforms (except linux/ia32 and linux/mips64el)',
),
);
Expand Down Expand Up @@ -308,14 +310,17 @@ test(
),
);

test(
'platform=darwin and arch=universal with a supported official Electron version',
testMultiTarget(
{ arch: 'universal', platform: 'darwin' },
1,
'Package should be generated for darwin/universal',
),
);
if (process.platform === 'darwin') {
test(
'platform=darwin and arch=universal with a supported official Electron version',
testMultiTarget(
{ arch: 'universal', platform: 'darwin' },
1,
'Package should be generated for darwin/universal',
),
);
}

test(
'platform=darwin and arch=universal with an unsupported official Electron version',
testMultiTarget(
Expand All @@ -325,14 +330,17 @@ test(
),
);

test(
'platform=mas and arch=universal with a supported official Electron version',
testMultiTarget(
{ arch: 'universal', platform: 'mas' },
1,
'Package should be generated for mas/universal',
),
);
if (process.platform === 'darwin') {
test(
'platform=mas and arch=universal with a supported official Electron version',
testMultiTarget(
{ arch: 'universal', platform: 'mas' },
1,
'Package should be generated for mas/universal',
),
);
}

test(
'platform=mas and arch=universal with an unsupported official Electron version',
testMultiTarget(
Expand Down
Loading