app-builder-lib 27.0.0-alpha.2 → 27.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Framework.d.ts +2 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js.map +1 -1
- package/dist/asar/asarFileChecker.d.ts +4 -2
- package/dist/asar/asarFileChecker.d.ts.map +1 -1
- package/dist/asar/asarFileChecker.js +2 -3
- package/dist/asar/asarFileChecker.js.map +1 -1
- package/dist/codeSign/certInfo.d.ts +14 -0
- package/dist/codeSign/certInfo.d.ts.map +1 -1
- package/dist/codeSign/certInfo.js +49 -0
- package/dist/codeSign/certInfo.js.map +1 -1
- package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +40 -14
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
- package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/hsmSignManager.js +50 -0
- package/dist/codeSign/win/hsmSignManager.js.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.js +82 -0
- package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
- package/dist/codeSign/{signManager.d.ts → win/signManager.d.ts} +8 -6
- package/dist/codeSign/win/signManager.d.ts.map +1 -0
- package/dist/codeSign/win/signManager.js +19 -0
- package/dist/codeSign/win/signManager.js.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +71 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js +407 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.js +9 -4
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +9 -3
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +130 -36
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
- package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.js +3 -363
- package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
- package/dist/configuration.d.ts +19 -120
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +0 -2
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +15 -27
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/injectFFMPEG.js +2 -2
- package/dist/electron/injectFFMPEG.js.map +1 -1
- package/dist/electron/mac/electronMac.js +10 -8
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/electron/win/electronWin.js +1 -2
- package/dist/electron/win/electronWin.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +2 -2
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +1 -1
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts +14 -10
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +114 -121
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts +7 -1
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +2 -2
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +48 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +216 -17
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/options/FuseOptionsV1.d.ts +137 -0
- package/dist/options/FuseOptionsV1.d.ts.map +1 -0
- package/dist/options/FuseOptionsV1.js +2 -0
- package/dist/options/FuseOptionsV1.js.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +93 -126
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +137 -63
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js +12 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/platformPackager.d.ts +4 -2
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +11 -7
- package/dist/platformPackager.js.map +1 -1
- package/dist/targets/ArchiveTarget.js +2 -2
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +10 -2
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +25 -6
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/linux/snap/core24.d.ts +2 -0
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +48 -8
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +2 -2
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +3 -4
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
- package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapCommand.js +27 -0
- package/dist/targets/linux/snap/snapCommand.js.map +1 -0
- package/dist/targets/mac/MacTargetHelper.d.ts +12 -12
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +72 -67
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +4 -4
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/AppxTarget.d.ts.map +1 -1
- package/dist/targets/win/AppxTarget.js +4 -4
- package/dist/targets/win/AppxTarget.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +2 -2
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +2 -2
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/toolsets/custom.d.ts +1 -0
- package/dist/toolsets/custom.d.ts.map +1 -1
- package/dist/toolsets/custom.js +19 -8
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/icons.js +1 -1
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/toolsets/winCodeSign.d.ts +36 -0
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +84 -30
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +20 -12
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/config/schemaValidator.d.ts.map +1 -1
- package/dist/util/config/schemaValidator.js +1 -1
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +8 -25
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +107 -87
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +0 -3
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +0 -9
- package/dist/util/flags.js.map +1 -1
- package/dist/util/license.d.ts.map +1 -1
- package/dist/util/license.js +4 -1
- package/dist/util/license.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/vm/ParallelsVm.d.ts.map +1 -1
- package/dist/vm/ParallelsVm.js +13 -2
- package/dist/vm/ParallelsVm.js.map +1 -1
- package/dist/vm/vm.d.ts.map +1 -1
- package/dist/vm/vm.js +4 -1
- package/dist/vm/vm.js.map +1 -1
- package/dist/winPackager.d.ts +1 -2
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +17 -22
- package/dist/winPackager.js.map +1 -1
- package/package.json +15 -14
- package/scheme.json +484 -432
- package/dist/codeSign/signManager.d.ts.map +0 -1
- package/dist/codeSign/signManager.js +0 -2
- package/dist/codeSign/signManager.js.map +0 -1
package/dist/macPackager.d.ts
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import { SignOptions } from "@electron/osx-sign
|
|
2
|
-
import type { Identity } from "@electron/osx-sign/dist/cjs/util-identities";
|
|
1
|
+
import type { SignOptions } from "@electron/osx-sign";
|
|
3
2
|
import { Arch, AsyncTaskManager } from "builder-util";
|
|
4
3
|
import { MemoLazy, Nullish } from "builder-util-runtime";
|
|
5
4
|
import { AppInfo } from "./appInfo.js";
|
|
6
|
-
import { CodeSigningInfo, CreateKeychainOptions } from "./codeSign/mac/macCodeSign.js";
|
|
5
|
+
import { CodeSigningInfo, CreateKeychainOptions, Identity } from "./codeSign/mac/macCodeSign.js";
|
|
7
6
|
import { Target } from "./core.js";
|
|
8
|
-
import { AfterPackContext } from "./index.js";
|
|
9
|
-
import { MacTargetHelper } from "./targets/mac/MacTargetHelper.js";
|
|
7
|
+
import { AfterPackContext, ElectronPlatformName } from "./index.js";
|
|
8
|
+
import { MacTargetHelper, PlatformType } from "./targets/mac/MacTargetHelper.js";
|
|
10
9
|
import { MacConfiguration, MasConfiguration } from "./options/macOptions.js";
|
|
11
10
|
import { Packager } from "./packager.js";
|
|
12
11
|
import { DoPackOptions, PlatformPackager } from "./platformPackager.js";
|
|
13
12
|
export type CustomMacSignOptions = SignOptions;
|
|
14
13
|
export type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>;
|
|
14
|
+
interface PlatformConfig {
|
|
15
|
+
type: PlatformType;
|
|
16
|
+
config: MacConfiguration | MasConfiguration;
|
|
17
|
+
platformName: ElectronPlatformName;
|
|
18
|
+
}
|
|
15
19
|
export declare class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {
|
|
16
20
|
readonly codeSigningInfo: MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>;
|
|
17
21
|
private _iconPath;
|
|
18
|
-
private _activePackConfig;
|
|
19
22
|
readonly helper: MacTargetHelper;
|
|
20
23
|
constructor(info: Packager);
|
|
21
24
|
get defaultTarget(): Array<string>;
|
|
22
25
|
/**
|
|
23
26
|
* Get the merged configuration for a specific platform type
|
|
24
27
|
*/
|
|
25
|
-
|
|
28
|
+
getPlatformConfig(platformType: PlatformType): PlatformConfig;
|
|
26
29
|
expandArch(pattern: string, arch?: Arch | null): string[];
|
|
27
30
|
protected prepareAppInfo(appInfo: AppInfo): AppInfo;
|
|
28
31
|
getIconPath(): Promise<string | null>;
|
|
@@ -40,11 +43,12 @@ export declare class MacPackager extends PlatformPackager<MacConfiguration | Mas
|
|
|
40
43
|
* Main signing method with platform awareness
|
|
41
44
|
*/
|
|
42
45
|
private sign;
|
|
43
|
-
protected doSign(opts: SignOptions,
|
|
46
|
+
protected doSign(opts: SignOptions, signConfig: MacConfiguration["sign"], identity: Identity | null): Promise<void>;
|
|
44
47
|
doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any>;
|
|
45
48
|
getElectronSrcDir(dist: string): string;
|
|
46
49
|
getElectronDestinationDir(appOutDir: string): string;
|
|
47
|
-
applyCommonInfo(appPlist: any, contentsPath: string): Promise<void>;
|
|
48
|
-
protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean>;
|
|
50
|
+
applyCommonInfo(appPlist: any, contentsPath: string, cascadedOptions: MacConfiguration | MasConfiguration): Promise<void>;
|
|
51
|
+
protected signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<boolean>;
|
|
49
52
|
}
|
|
53
|
+
export {};
|
|
50
54
|
//# sourceMappingURL=macPackager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macPackager.d.ts","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"macPackager.d.ts","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"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"}
|
package/dist/macPackager.js
CHANGED
|
@@ -14,10 +14,13 @@ import { chooseNotNull, PlatformPackager } from "./platformPackager.js";
|
|
|
14
14
|
import { ArchiveTarget } from "./targets/ArchiveTarget.js";
|
|
15
15
|
import { PkgTarget, prepareProductBuildArgs } from "./targets/mac/pkg.js";
|
|
16
16
|
import { createCommonTarget, NoOpTarget } from "./targets/targetFactory.js";
|
|
17
|
-
import { dynamicImport } from "./util/dynamicImport.js";
|
|
18
17
|
import { isMacOsHighSierra } from "./util/mac/macosVersion.js";
|
|
19
18
|
import { expandMacro as doExpandMacro } from "./util/macroExpander.js";
|
|
20
19
|
import { resolveFunction } from "./util/resolve.js";
|
|
20
|
+
import { makeUniversalApp } from "@electron/universal";
|
|
21
|
+
function isElectronSignOptions(sign) {
|
|
22
|
+
return typeof sign === "object" && sign !== null;
|
|
23
|
+
}
|
|
21
24
|
export class MacPackager extends PlatformPackager {
|
|
22
25
|
constructor(info) {
|
|
23
26
|
super(info, Platform.MAC);
|
|
@@ -48,9 +51,6 @@ export class MacPackager extends PlatformPackager {
|
|
|
48
51
|
return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null });
|
|
49
52
|
});
|
|
50
53
|
this._iconPath = new Lazy(() => this.getOrConvertIcon("icns"));
|
|
51
|
-
// Set/cleared in doPack so applyCommonInfo can read the per-pack platformSpecificBuildOptions
|
|
52
|
-
// (the framework call chain doesn't thread it through to applyCommonInfo). Fixes #8909.
|
|
53
|
-
this._activePackConfig = null;
|
|
54
54
|
this.helper = new MacTargetHelper(this);
|
|
55
55
|
}
|
|
56
56
|
get defaultTarget() {
|
|
@@ -61,29 +61,25 @@ export class MacPackager extends PlatformPackager {
|
|
|
61
61
|
*/
|
|
62
62
|
getPlatformConfig(platformType) {
|
|
63
63
|
let config;
|
|
64
|
-
let isDevelopment = false;
|
|
65
64
|
let platformName;
|
|
66
65
|
switch (platformType) {
|
|
67
66
|
case "mas":
|
|
68
67
|
config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas);
|
|
69
|
-
isDevelopment = false;
|
|
70
68
|
platformName = "mas";
|
|
71
69
|
break;
|
|
72
70
|
case "mas-dev":
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
isDevelopment = true;
|
|
71
|
+
// `mas-dev` cascades mac → mas → masDev. The development/distribution distinction is no longer
|
|
72
|
+
// carried as a config field; it is derived from `platformType` wherever signing happens.
|
|
73
|
+
config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev);
|
|
77
74
|
platformName = "mas";
|
|
78
75
|
break;
|
|
79
76
|
case "mac":
|
|
80
77
|
default:
|
|
81
78
|
config = this.platformSpecificBuildOptions;
|
|
82
|
-
isDevelopment = false;
|
|
83
79
|
platformName = this.platform.nodeName;
|
|
84
80
|
break;
|
|
85
81
|
}
|
|
86
|
-
return { type: platformType, config,
|
|
82
|
+
return { type: platformType, config, platformName };
|
|
87
83
|
}
|
|
88
84
|
expandArch(pattern, arch) {
|
|
89
85
|
if (arch === Arch.universal) {
|
|
@@ -130,95 +126,80 @@ export class MacPackager extends PlatformPackager {
|
|
|
130
126
|
if (config.arch === Arch.universal) {
|
|
131
127
|
return this.doUniversalPack(config);
|
|
132
128
|
}
|
|
133
|
-
|
|
134
|
-
// framework stack (doPack → beforeCopyExtraFiles → createMacApp → applyCommonInfo) without it.
|
|
135
|
-
this._activePackConfig = config.platformSpecificBuildOptions;
|
|
136
|
-
try {
|
|
137
|
-
return await super.doPack(config);
|
|
138
|
-
}
|
|
139
|
-
finally {
|
|
140
|
-
this._activePackConfig = null;
|
|
141
|
-
}
|
|
129
|
+
return await super.doPack(config);
|
|
142
130
|
}
|
|
143
131
|
/**
|
|
144
132
|
* Handle universal build packing
|
|
145
133
|
*/
|
|
146
134
|
async doUniversalPack(config) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
await this.info.emitAfterPack(packContext);
|
|
210
|
-
if (this.info.cancellationToken.cancelled) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
await this.doAddElectronFuses(packContext);
|
|
214
|
-
// Mirror the base-class guard: skip signing when the caller explicitly set sign:false
|
|
215
|
-
// (e.g. packMasTargets passes sign:false so that signMas() is the sole signing step).
|
|
216
|
-
if (config.options?.sign ?? true) {
|
|
217
|
-
await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets);
|
|
218
|
-
}
|
|
135
|
+
const { outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets } = config;
|
|
136
|
+
const outDirName = (arch) => `${appOutDir}-${Arch[arch]}-temp`;
|
|
137
|
+
const options = {
|
|
138
|
+
...config,
|
|
139
|
+
options: {
|
|
140
|
+
sign: false,
|
|
141
|
+
disableAsarIntegrity: true,
|
|
142
|
+
disableFuses: true,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
const x64Arch = Arch.x64;
|
|
146
|
+
const x64AppOutDir = outDirName(x64Arch);
|
|
147
|
+
await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch });
|
|
148
|
+
if (this.info.cancellationToken.cancelled) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const arm64Arch = Arch.arm64;
|
|
152
|
+
const arm64AppOutPath = outDirName(arm64Arch);
|
|
153
|
+
await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch });
|
|
154
|
+
if (this.info.cancellationToken.cancelled) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const framework = this.info.framework;
|
|
158
|
+
log.info({
|
|
159
|
+
platform: platformName,
|
|
160
|
+
arch: Arch[arch],
|
|
161
|
+
[`${framework.name}`]: framework.version,
|
|
162
|
+
appOutDir: log.filePath(appOutDir),
|
|
163
|
+
}, `packaging`);
|
|
164
|
+
const appFile = `${this.appInfo.productFilename}.app`;
|
|
165
|
+
// Make sure the Assets.car file is the same for both architectures
|
|
166
|
+
const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir);
|
|
167
|
+
const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath);
|
|
168
|
+
const safeAppOutDir = sanitizeDirPath(appOutDir);
|
|
169
|
+
const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, "Contents/Resources/Assets.car");
|
|
170
|
+
if (await exists(sourceCatalogPath)) {
|
|
171
|
+
const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, "Contents/Resources/Assets.car");
|
|
172
|
+
await fs.copyFile(sourceCatalogPath, targetCatalogPath);
|
|
173
|
+
}
|
|
174
|
+
const universalOpts = platformSpecificBuildOptions.universal;
|
|
175
|
+
await makeUniversalApp({
|
|
176
|
+
mergeASARs: true, // preserve electron-builder v2 default; user can override via mac.universal.mergeASARs
|
|
177
|
+
...universalOpts,
|
|
178
|
+
x64AppPath: path.join(safeX64AppOutDir, appFile),
|
|
179
|
+
arm64AppPath: path.join(safeArm64AppOutPath, appFile),
|
|
180
|
+
outAppPath: path.join(safeAppOutDir, appFile),
|
|
181
|
+
force: true,
|
|
182
|
+
});
|
|
183
|
+
await fs.rm(x64AppOutDir, { recursive: true, force: true });
|
|
184
|
+
await fs.rm(arm64AppOutPath, { recursive: true, force: true });
|
|
185
|
+
// Give users a final opportunity to perform things on the combined universal package before signing
|
|
186
|
+
const packContext = {
|
|
187
|
+
appOutDir,
|
|
188
|
+
outDir,
|
|
189
|
+
arch,
|
|
190
|
+
targets,
|
|
191
|
+
packager: this,
|
|
192
|
+
electronPlatformName: platformName,
|
|
193
|
+
};
|
|
194
|
+
await this.info.emitAfterPack(packContext);
|
|
195
|
+
if (this.info.cancellationToken.cancelled) {
|
|
196
|
+
return;
|
|
219
197
|
}
|
|
220
|
-
|
|
221
|
-
|
|
198
|
+
await this.doAddElectronFuses(packContext);
|
|
199
|
+
// Mirror the base-class guard: skip signing when the caller explicitly set sign:false
|
|
200
|
+
// (e.g. packMasTargets passes sign:false so that signMas() is the sole signing step).
|
|
201
|
+
if (config.options?.sign ?? true) {
|
|
202
|
+
await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets);
|
|
222
203
|
}
|
|
223
204
|
}
|
|
224
205
|
async pack(outDir, arch, targets, taskManager) {
|
|
@@ -247,22 +228,24 @@ export class MacPackager extends PlatformPackager {
|
|
|
247
228
|
if (relativeTargetOutDir.startsWith("..") || path.isAbsolute(relativeTargetOutDir)) {
|
|
248
229
|
throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`);
|
|
249
230
|
}
|
|
250
|
-
|
|
231
|
+
let appPath = path.join(targetOutDir, `${this.appInfo.productFilename}.app`);
|
|
232
|
+
if (prepackaged != null) {
|
|
233
|
+
appPath = prepackaged;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
251
236
|
await this.doPack({
|
|
252
237
|
outDir: resolvedOutDir,
|
|
253
238
|
appOutDir: targetOutDir,
|
|
254
239
|
platformName: platformConfig.platformName,
|
|
240
|
+
platformType: platformConfig.type,
|
|
255
241
|
arch,
|
|
256
242
|
platformSpecificBuildOptions: platformConfig.config,
|
|
257
243
|
targets: [target],
|
|
258
244
|
options: { sign: false },
|
|
259
245
|
});
|
|
260
246
|
MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, "product filename");
|
|
261
|
-
await this.signMas(path.resolve(targetOutDir, `${path.basename(this.appInfo.productFilename)}.app`), targetOutDir, platformConfig, arch);
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
await this.signMas(prepackaged, targetOutDir, platformConfig, arch);
|
|
265
247
|
}
|
|
248
|
+
await this.signMas(appPath, targetOutDir, arch, platformType);
|
|
266
249
|
}
|
|
267
250
|
}
|
|
268
251
|
async packMacTargets(outDir, arch, targets, prepackaged, taskManager) {
|
|
@@ -273,6 +256,7 @@ export class MacPackager extends PlatformPackager {
|
|
|
273
256
|
outDir,
|
|
274
257
|
appOutDir: path.dirname(appPath),
|
|
275
258
|
platformName: platformConfig.platformName,
|
|
259
|
+
platformType: platformConfig.type,
|
|
276
260
|
arch,
|
|
277
261
|
platformSpecificBuildOptions: platformConfig.config,
|
|
278
262
|
targets,
|
|
@@ -280,38 +264,46 @@ export class MacPackager extends PlatformPackager {
|
|
|
280
264
|
}
|
|
281
265
|
this.packageInDistributableFormat(appPath, arch, targets, taskManager);
|
|
282
266
|
}
|
|
283
|
-
async signMas(appPath, outDir,
|
|
284
|
-
const signed = await this.sign(appPath, outDir,
|
|
267
|
+
async signMas(appPath, outDir, arch, targetPlatform) {
|
|
268
|
+
const signed = await this.sign(appPath, outDir, arch, targetPlatform);
|
|
285
269
|
return signed;
|
|
286
270
|
}
|
|
287
271
|
/**
|
|
288
272
|
* Main signing method with platform awareness
|
|
289
273
|
*/
|
|
290
|
-
async sign(appPath, outDir,
|
|
274
|
+
async sign(appPath, outDir, arch, targetPlatform) {
|
|
291
275
|
if (!isSignAllowed()) {
|
|
292
276
|
return false;
|
|
293
277
|
}
|
|
294
|
-
|
|
295
|
-
const
|
|
278
|
+
// getPlatformConfig cascades mac → mas → masDev, so `sign` (and `sign.identity`) is already merged for this flavor.
|
|
279
|
+
const config = this.getPlatformConfig(targetPlatform).config.sign;
|
|
280
|
+
// sign: null → user explicitly disabled signing
|
|
281
|
+
if (config === null) {
|
|
282
|
+
return this.helper.handleNullIdentity();
|
|
283
|
+
}
|
|
284
|
+
const signOpts = isElectronSignOptions(config) ? config : undefined;
|
|
285
|
+
// sign.identity: null → explicit skip; undefined → auto-discover
|
|
286
|
+
const qualifier = signOpts?.identity;
|
|
296
287
|
if (qualifier === null) {
|
|
297
288
|
return this.helper.handleNullIdentity();
|
|
298
289
|
}
|
|
299
290
|
const keychainFile = (await this.codeSigningInfo.value).keychainFile;
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const
|
|
291
|
+
// `config` is a custom fn/string module path when it's non-null and not an options object
|
|
292
|
+
const hasCustomSign = config != null && !signOpts;
|
|
293
|
+
const isMas = MacTargetHelper.isMasTarget(targetPlatform);
|
|
294
|
+
const isDevelopment = MacTargetHelper.isMasDevelopment(targetPlatform);
|
|
295
|
+
const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts);
|
|
304
296
|
if (!identity) {
|
|
305
297
|
return false;
|
|
306
298
|
}
|
|
307
299
|
if (!isMacOsHighSierra()) {
|
|
308
300
|
throw new InvalidConfigurationError("macOS High Sierra 10.13.6 is required to sign");
|
|
309
301
|
}
|
|
310
|
-
const signOptions = await this.helper.buildSignOptions(appPath, identity,
|
|
302
|
+
const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform);
|
|
311
303
|
await this.doSign(signOptions, config, identity);
|
|
312
304
|
// Handle MAS installer creation
|
|
313
305
|
if (isMas && !isDevelopment && outDir) {
|
|
314
|
-
await this.helper.createMasInstaller(appPath, outDir, config, keychainFile,
|
|
306
|
+
await this.helper.createMasInstaller(appPath, outDir, this.getPlatformConfig(targetPlatform).config, keychainFile, targetPlatform, arch, qualifier);
|
|
315
307
|
}
|
|
316
308
|
// Handle notarization for non-MAS builds
|
|
317
309
|
if (!isMas) {
|
|
@@ -320,8 +312,10 @@ export class MacPackager extends PlatformPackager {
|
|
|
320
312
|
return true;
|
|
321
313
|
}
|
|
322
314
|
//noinspection JSMethodCanBeStatic
|
|
323
|
-
async doSign(opts,
|
|
324
|
-
|
|
315
|
+
async doSign(opts, signConfig, identity) {
|
|
316
|
+
// Resolve a custom signer only when signConfig is a function or string module path.
|
|
317
|
+
// ElectronSignOptions objects and undefined use @electron/osx-sign directly.
|
|
318
|
+
const customSign = signConfig == null || isElectronSignOptions(signConfig) ? null : await resolveFunction(this.appInfo.type, signConfig, "sign", await this.info.getWorkspaceRoot());
|
|
325
319
|
const { app, platform, type, provisioningProfile } = opts;
|
|
326
320
|
log.info({
|
|
327
321
|
file: log.filePath(app),
|
|
@@ -351,7 +345,7 @@ export class MacPackager extends PlatformPackager {
|
|
|
351
345
|
return path.join(appOutDir, this.info.framework.distMacOsAppName);
|
|
352
346
|
}
|
|
353
347
|
// todo fileAssociations
|
|
354
|
-
async applyCommonInfo(appPlist, contentsPath) {
|
|
348
|
+
async applyCommonInfo(appPlist, contentsPath, cascadedOptions) {
|
|
355
349
|
const appInfo = this.appInfo;
|
|
356
350
|
const appFilename = appInfo.productFilename;
|
|
357
351
|
// https://github.com/electron-userland/electron-builder/issues/1278
|
|
@@ -392,9 +386,9 @@ export class MacPackager extends PlatformPackager {
|
|
|
392
386
|
if (minimumSystemVersion != null) {
|
|
393
387
|
appPlist.LSMinimumSystemVersion = minimumSystemVersion;
|
|
394
388
|
}
|
|
395
|
-
const activeOpts = this.
|
|
396
|
-
appPlist.CFBundleShortVersionString =
|
|
397
|
-
appPlist.CFBundleVersion =
|
|
389
|
+
// const activeOpts = this.getPlatformConfig(distType).config
|
|
390
|
+
appPlist.CFBundleShortVersionString = cascadedOptions.bundleShortVersion || appInfo.version;
|
|
391
|
+
appPlist.CFBundleVersion = cascadedOptions.bundleVersion || appInfo.buildVersion;
|
|
398
392
|
use(this.platformSpecificBuildOptions.category || this.config.category, it => (appPlist.LSApplicationCategoryType = it));
|
|
399
393
|
appPlist.NSHumanReadableCopyright = appInfo.copyright;
|
|
400
394
|
if (this.platformSpecificBuildOptions.darkModeSupport) {
|
|
@@ -410,9 +404,8 @@ export class MacPackager extends PlatformPackager {
|
|
|
410
404
|
}
|
|
411
405
|
}
|
|
412
406
|
}
|
|
413
|
-
async signApp(packContext, isAsar) {
|
|
414
|
-
const
|
|
415
|
-
const activeConfig = this._activePackConfig ?? this.platformSpecificBuildOptions;
|
|
407
|
+
async signApp(packContext, isAsar, platformType) {
|
|
408
|
+
const targetPlatform = platformType ?? (packContext.electronPlatformName === "mas" ? "mas" : "mac");
|
|
416
409
|
const readDirectoryAndSign = async (sourceDirectory, directories, shouldSign) => {
|
|
417
410
|
const normalizedSourceDirectory = path.resolve(sourceDirectory);
|
|
418
411
|
MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, "application output directory");
|
|
@@ -424,7 +417,7 @@ export class MacPackager extends PlatformPackager {
|
|
|
424
417
|
}
|
|
425
418
|
const signTarget = path.resolve(normalizedSourceDirectory, entryName);
|
|
426
419
|
const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory);
|
|
427
|
-
await this.sign(safeSignTarget, null,
|
|
420
|
+
await this.sign(safeSignTarget, null, packContext.arch, targetPlatform);
|
|
428
421
|
}
|
|
429
422
|
}));
|
|
430
423
|
return true;
|