@capacitor/cli 7.0.1 → 7.0.2-dev-20250212T193125.0

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.
Binary file
Binary file
Binary file
package/dist/config.js CHANGED
@@ -220,7 +220,7 @@ async function loadAndroidConfig(rootDir, extConfig, cliConfig) {
220
220
  };
221
221
  }
222
222
  async function loadIOSConfig(rootDir, extConfig) {
223
- var _a, _b, _c, _d;
223
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
224
224
  const name = 'ios';
225
225
  const platformDir = (_b = (_a = extConfig.ios) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : 'ios';
226
226
  const platformDirAbs = (0, path_1.resolve)(rootDir, platformDir);
@@ -235,6 +235,12 @@ async function loadIOSConfig(rootDir, extConfig) {
235
235
  const podPath = (0, promise_1.lazy)(() => determineGemfileOrCocoapodPath(rootDir, platformDirAbs, nativeProjectDirAbs));
236
236
  const webDirAbs = (0, promise_1.lazy)(() => determineIOSWebDirAbs(nativeProjectDirAbs, nativeTargetDirAbs, nativeXcodeProjDirAbs));
237
237
  const cordovaPluginsDir = 'capacitor-cordova-ios-plugins';
238
+ const buildOptions = {
239
+ xcodeExportMethod: (_f = (_e = extConfig.ios) === null || _e === void 0 ? void 0 : _e.buildOptions) === null || _f === void 0 ? void 0 : _f.exportMethod,
240
+ xcodeSigningStyle: (_h = (_g = extConfig.ios) === null || _g === void 0 ? void 0 : _g.buildOptions) === null || _h === void 0 ? void 0 : _h.signingStyle,
241
+ signingCertificate: (_k = (_j = extConfig.ios) === null || _j === void 0 ? void 0 : _j.buildOptions) === null || _k === void 0 ? void 0 : _k.signingCertificate,
242
+ provisioningProfile: (_m = (_l = extConfig.ios) === null || _l === void 0 ? void 0 : _l.buildOptions) === null || _m === void 0 ? void 0 : _m.provisioningProfile,
243
+ };
238
244
  return {
239
245
  name,
240
246
  minVersion: '14.0',
@@ -254,6 +260,7 @@ async function loadIOSConfig(rootDir, extConfig) {
254
260
  webDir: (0, promise_1.lazy)(async () => (0, path_1.relative)(platformDirAbs, await webDirAbs)),
255
261
  webDirAbs,
256
262
  podPath,
263
+ buildOptions,
257
264
  };
258
265
  }
259
266
  async function loadWebConfig(rootDir, webDir) {
@@ -431,6 +431,34 @@ export interface CapacitorConfig {
431
431
  * @default true
432
432
  */
433
433
  initialFocus?: boolean;
434
+ buildOptions?: {
435
+ /**
436
+ * The signing style to use when building the app for distribution.
437
+ *
438
+ * @since 7.0.0
439
+ * @default 'automatic'
440
+ */
441
+ signingStyle?: 'automatic' | 'manual';
442
+ /**
443
+ * The method used by xcodebuild to export the archive
444
+ *
445
+ * @since 7.0.0
446
+ * @default 'app-store-connect'
447
+ */
448
+ exportMethod?: string;
449
+ /**
450
+ * A certificate name, SHA-1 hash, or automatic selector to use for signing for iOS builds.
451
+ *
452
+ * @since 7.0.0
453
+ */
454
+ signingCertificate?: string;
455
+ /**
456
+ * A provisioning profile name or UUID for iOS builds.
457
+ *
458
+ * @since 7.0.0
459
+ */
460
+ provisioningProfile?: string;
461
+ };
434
462
  };
435
463
  server?: {
436
464
  /**
@@ -1,2 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XcodeExportMethod = void 0;
4
+ var XcodeExportMethod;
5
+ (function (XcodeExportMethod) {
6
+ XcodeExportMethod["AppStoreConnect"] = "app-store-connect";
7
+ XcodeExportMethod["ReleaseTesting"] = "release-testing";
8
+ XcodeExportMethod["Enterprise"] = "enterprise";
9
+ XcodeExportMethod["Debugging"] = "debugging";
10
+ XcodeExportMethod["DeveloperID"] = "developer-id";
11
+ XcodeExportMethod["MacApplication"] = "mac-application";
12
+ XcodeExportMethod["Validation"] = "validation";
13
+ })(XcodeExportMethod = exports.XcodeExportMethod || (exports.XcodeExportMethod = {}));
package/dist/index.js CHANGED
@@ -103,7 +103,20 @@ function runProgram(config) {
103
103
  'apksigner',
104
104
  'jarsigner',
105
105
  ]))
106
- .action((0, cli_1.wrapAction)((0, telemetry_1.telemetryAction)(config, async (platform, { scheme, flavor, keystorepath, keystorepass, keystorealias, keystorealiaspass, androidreleasetype, signingType, configuration, }) => {
106
+ .addOption(new commander_1.Option('--xcode-team-id <xcodeTeamID>', 'The Developer team to use for building and exporting the archive'))
107
+ .addOption(new commander_1.Option('--xcode-export-method <xcodeExportMethod>', 'Describes how xcodebuild should export the archive (default: app-store-connect)').choices([
108
+ 'app-store-connect',
109
+ 'release-testing',
110
+ 'enterprise',
111
+ 'debugging',
112
+ 'developer-id',
113
+ 'mac-application',
114
+ 'validation',
115
+ ]))
116
+ .addOption(new commander_1.Option('--xcode-signing-style <xcodeSigningStyle>', 'The iOS signing style to use when building the app for distribution (default: automatic)').choices(['automatic', 'manual']))
117
+ .addOption(new commander_1.Option('--xcode-signing-certificate <xcodeSigningCertificate>', 'A certificate name, SHA-1 hash, or automatic selector to use for signing for iOS builds'))
118
+ .addOption(new commander_1.Option('--xcode-provisioning-profile <xcodeProvisioningProfile>', 'A provisioning profile name or UUID for iOS builds'))
119
+ .action((0, cli_1.wrapAction)((0, telemetry_1.telemetryAction)(config, async (platform, { scheme, flavor, keystorepath, keystorepass, keystorealias, keystorealiaspass, androidreleasetype, signingType, configuration, xcodeTeamId, xcodeExportMethod, xcodeSigningStyle, xcodeSigningCertificate, xcodeProvisioningProfile, }) => {
107
120
  const { buildCommand } = await Promise.resolve().then(() => tslib_1.__importStar(require('./tasks/build')));
108
121
  await buildCommand(config, platform, {
109
122
  scheme,
@@ -115,6 +128,11 @@ function runProgram(config) {
115
128
  androidreleasetype,
116
129
  signingtype: signingType,
117
130
  configuration,
131
+ xcodeTeamId,
132
+ xcodeExportMethod,
133
+ xcodeSigningType: xcodeSigningStyle,
134
+ xcodeSigningCertificate,
135
+ xcodeProvisioningProfile,
118
136
  });
119
137
  })));
120
138
  commander_1.program
package/dist/ios/build.js CHANGED
@@ -5,11 +5,12 @@ const fs_extra_1 = require("fs-extra");
5
5
  const path_1 = require("path");
6
6
  const rimraf_1 = require("rimraf");
7
7
  const common_1 = require("../common");
8
+ const definitions_1 = require("../definitions");
8
9
  const log_1 = require("../log");
9
10
  const spm_1 = require("../util/spm");
10
11
  const subprocess_1 = require("../util/subprocess");
11
12
  async function buildiOS(config, buildOptions) {
12
- var _a;
13
+ var _a, _b, _c, _d;
13
14
  const theScheme = (_a = buildOptions.scheme) !== null && _a !== void 0 ? _a : 'App';
14
15
  const packageManager = await (0, spm_1.checkPackageManager)(config);
15
16
  let typeOfBuild;
@@ -22,7 +23,11 @@ async function buildiOS(config, buildOptions) {
22
23
  typeOfBuild = '-project';
23
24
  projectName = (0, path_1.basename)(await config.ios.nativeXcodeProjDirAbs);
24
25
  }
25
- await (0, common_1.runTask)('Building xArchive', async () => (0, subprocess_1.runCommand)('xcodebuild', [
26
+ if (buildOptions.xcodeSigningType == 'manual' &&
27
+ (!buildOptions.xcodeSigningCertificate || !buildOptions.xcodeProvisioningProfile)) {
28
+ throw 'Manually signed Xcode builds require a signing certificate and provisioning profile.';
29
+ }
30
+ const buildArgs = [
26
31
  typeOfBuild,
27
32
  projectName,
28
33
  '-scheme',
@@ -32,20 +37,37 @@ async function buildiOS(config, buildOptions) {
32
37
  '-archivePath',
33
38
  `${theScheme}.xcarchive`,
34
39
  'archive',
35
- ], {
40
+ ];
41
+ if (buildOptions.xcodeTeamId) {
42
+ buildArgs.push(`DEVELOPMENT_TEAM=${buildOptions.xcodeTeamId}`);
43
+ }
44
+ if (buildOptions.xcodeSigningType == 'manual') {
45
+ buildArgs.push(`PROVISIONING_PROFILE_SPECIFIER=${buildOptions.xcodeProvisioningProfile}`);
46
+ }
47
+ await (0, common_1.runTask)('Building xArchive', async () => (0, subprocess_1.runCommand)('xcodebuild', buildArgs, {
36
48
  cwd: config.ios.nativeProjectDirAbs,
37
49
  }));
50
+ const manualSigningContents = `<key>provisioningProfiles</key>
51
+ <dict>
52
+ <key>${config.app.appId}</key>
53
+ <string>${(_b = buildOptions.xcodeProvisioningProfile) !== null && _b !== void 0 ? _b : ''}</string>
54
+ </dict>
55
+ <key>signingCertificate</key>
56
+ <string>${(_c = buildOptions.xcodeSigningCertificate) !== null && _c !== void 0 ? _c : ''}</string>`;
38
57
  const archivePlistContents = `<?xml version="1.0" encoding="UTF-8"?>
39
58
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
40
59
  <plist version="1.0">
41
60
  <dict>
42
61
  <key>method</key>
43
- <string>app-store-connect</string>
62
+ <string>${(_d = buildOptions.xcodeExportMethod) !== null && _d !== void 0 ? _d : definitions_1.XcodeExportMethod.AppStoreConnect}</string>
63
+ <key>signingStyle</key>
64
+ <string>${buildOptions.xcodeSigningType}</string>
65
+ ${buildOptions.xcodeSigningType == 'manual' ? manualSigningContents : ''}
44
66
  </dict>
45
67
  </plist>`;
46
68
  const archivePlistPath = (0, path_1.join)(`${config.ios.nativeProjectDirAbs}`, 'archive.plist');
47
69
  (0, fs_extra_1.writeFileSync)(archivePlistPath, archivePlistContents);
48
- await (0, common_1.runTask)('Building IPA', async () => (0, subprocess_1.runCommand)('xcodebuild', [
70
+ const archiveArgs = [
49
71
  'archive',
50
72
  '-archivePath',
51
73
  `${theScheme}.xcarchive`,
@@ -54,10 +76,13 @@ async function buildiOS(config, buildOptions) {
54
76
  'archive.plist',
55
77
  '-exportPath',
56
78
  'output',
57
- '-allowProvisioningUpdates',
58
79
  '-configuration',
59
80
  buildOptions.configuration,
60
- ], {
81
+ ];
82
+ if (buildOptions.xcodeSigningType == 'automatic') {
83
+ archiveArgs.push('-allowProvisioningUpdates');
84
+ }
85
+ await (0, common_1.runTask)('Building IPA', async () => (0, subprocess_1.runCommand)('xcodebuild', archiveArgs, {
61
86
  cwd: config.ios.nativeProjectDirAbs,
62
87
  }));
63
88
  await (0, common_1.runTask)('Cleaning up', async () => {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.build = exports.buildCommand = void 0;
4
4
  const build_1 = require("../android/build");
5
5
  const common_1 = require("../common");
6
+ const definitions_1 = require("../definitions");
6
7
  const errors_1 = require("../errors");
7
8
  const build_2 = require("../ios/build");
8
9
  async function buildCommand(config, selectedPlatformName, buildOptions) {
@@ -25,6 +26,11 @@ async function buildCommand(config, selectedPlatformName, buildOptions) {
25
26
  androidreleasetype: buildOptions.androidreleasetype || config.android.buildOptions.releaseType || 'AAB',
26
27
  signingtype: buildOptions.signingtype || config.android.buildOptions.signingType || 'jarsigner',
27
28
  configuration: buildOptions.configuration || 'Release',
29
+ xcodeTeamId: buildOptions.xcodeTeamId || config.ios.buildOptions.teamId,
30
+ xcodeExportMethod: buildOptions.xcodeExportMethod || config.ios.buildOptions.exportMethod || definitions_1.XcodeExportMethod.AppStoreConnect,
31
+ xcodeSigningType: buildOptions.xcodeSigningType || config.ios.buildOptions.xcodeSigningStyle || 'automatic',
32
+ xcodeSigningCertificate: buildOptions.xcodeSigningCertificate || config.ios.buildOptions.signingCertificate,
33
+ xcodeProvisioningProfile: buildOptions.xcodeProvisioningProfile || config.ios.buildOptions.provisioningProfile,
28
34
  };
29
35
  try {
30
36
  await build(config, platformName, buildCommandOptions);
@@ -123,8 +123,9 @@ async function copyCapacitorConfig(config, nativeAbsDir) {
123
123
  const nativeConfigFile = 'capacitor.config.json';
124
124
  const nativeConfigFilePath = (0, path_1.join)(nativeAbsDir, nativeConfigFile);
125
125
  await (0, common_1.runTask)(`Creating ${colors_1.default.strong(nativeConfigFile)} in ${nativeRelDir}`, async () => {
126
- var _a;
126
+ var _a, _b;
127
127
  (_a = config.app.extConfig.android) === null || _a === void 0 ? true : delete _a.buildOptions;
128
+ (_b = config.app.extConfig.ios) === null || _b === void 0 ? true : delete _b.buildOptions;
128
129
  await (0, fs_extra_1.writeJSON)(nativeConfigFilePath, config.app.extConfig, {
129
130
  spaces: '\t',
130
131
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "7.0.1",
3
+ "version": "7.0.2-dev-20250212T193125.0",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",