@capacitor/cli
Advanced tools
Comparing version 7.0.2-nightly-20250207T150528.0 to 7.0.2-nightly-20250210T150536.0
@@ -223,3 +223,3 @@ "use strict"; | ||
async function loadIOSConfig(rootDir, extConfig) { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
const name = 'ios'; | ||
@@ -239,2 +239,8 @@ const platformDir = (_b = (_a = extConfig.ios) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : 'ios'; | ||
const cordovaPluginsDir = 'capacitor-cordova-ios-plugins'; | ||
const buildOptions = { | ||
xcodeExportMethod: (_f = (_e = extConfig.ios) === null || _e === void 0 ? void 0 : _e.buildOptions) === null || _f === void 0 ? void 0 : _f.exportMethod, | ||
xcodeSigningStyle: (_h = (_g = extConfig.ios) === null || _g === void 0 ? void 0 : _g.buildOptions) === null || _h === void 0 ? void 0 : _h.signingStyle, | ||
signingCertificate: (_k = (_j = extConfig.ios) === null || _j === void 0 ? void 0 : _j.buildOptions) === null || _k === void 0 ? void 0 : _k.signingCertificate, | ||
provisioningProfile: (_m = (_l = extConfig.ios) === null || _l === void 0 ? void 0 : _l.buildOptions) === null || _m === void 0 ? void 0 : _m.provisioningProfile, | ||
}; | ||
return { | ||
@@ -259,2 +265,3 @@ name, | ||
podPath, | ||
buildOptions, | ||
}; | ||
@@ -261,0 +268,0 @@ } |
@@ -434,2 +434,30 @@ export interface CapacitorConfig { | ||
initialFocus?: boolean; | ||
buildOptions?: { | ||
/** | ||
* The signing style to use when building the app for distribution. | ||
* | ||
* @since 7.0.0 | ||
* @default 'automatic' | ||
*/ | ||
signingStyle?: 'automatic' | 'manual'; | ||
/** | ||
* The method used by xcodebuild to export the archive | ||
* | ||
* @since 7.0.0 | ||
* @default 'app-store-connect' | ||
*/ | ||
exportMethod?: string; | ||
/** | ||
* A certificate name, SHA-1 hash, or automatic selector to use for signing for iOS builds. | ||
* | ||
* @since 7.0.0 | ||
*/ | ||
signingCertificate?: string; | ||
/** | ||
* A provisioning profile name or UUID for iOS builds. | ||
* | ||
* @since 7.0.0 | ||
*/ | ||
provisioningProfile?: string; | ||
}; | ||
}; | ||
@@ -436,0 +464,0 @@ server?: { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.XcodeExportMethod = void 0; | ||
var XcodeExportMethod; | ||
(function (XcodeExportMethod) { | ||
XcodeExportMethod["AppStoreConnect"] = "app-store-connect"; | ||
XcodeExportMethod["ReleaseTesting"] = "release-testing"; | ||
XcodeExportMethod["Enterprise"] = "enterprise"; | ||
XcodeExportMethod["Debugging"] = "debugging"; | ||
XcodeExportMethod["DeveloperID"] = "developer-id"; | ||
XcodeExportMethod["MacApplication"] = "mac-application"; | ||
XcodeExportMethod["Validation"] = "validation"; | ||
})(XcodeExportMethod = exports.XcodeExportMethod || (exports.XcodeExportMethod = {})); |
@@ -106,3 +106,16 @@ "use strict"; | ||
])) | ||
.action((0, cli_1.wrapAction)((0, telemetry_1.telemetryAction)(config, async (platform, { scheme, flavor, keystorepath, keystorepass, keystorealias, keystorealiaspass, androidreleasetype, signingType, configuration, }) => { | ||
.addOption(new commander_1.Option('--xcode-team-id <xcodeTeamID>', 'The Developer team to use for building and exporting the archive')) | ||
.addOption(new commander_1.Option('--xcode-export-method <xcodeExportMethod>', 'Describes how xcodebuild should export the archive (default: app-store-connect)').choices([ | ||
'app-store-connect', | ||
'release-testing', | ||
'enterprise', | ||
'debugging', | ||
'developer-id', | ||
'mac-application', | ||
'validation', | ||
])) | ||
.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'])) | ||
.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')) | ||
.addOption(new commander_1.Option('--xcode-provisioning-profile <xcodeProvisioningProfile>', 'A provisioning profile name or UUID for iOS builds')) | ||
.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, }) => { | ||
const { buildCommand } = await Promise.resolve().then(() => tslib_1.__importStar(require('./tasks/build'))); | ||
@@ -119,2 +132,7 @@ await buildCommand(config, platform, { | ||
configuration, | ||
xcodeTeamId, | ||
xcodeExportMethod, | ||
xcodeSigningType: xcodeSigningStyle, | ||
xcodeSigningCertificate, | ||
xcodeProvisioningProfile, | ||
}); | ||
@@ -121,0 +139,0 @@ }))); |
@@ -8,2 +8,3 @@ "use strict"; | ||
const common_1 = require("../common"); | ||
const definitions_1 = require("../definitions"); | ||
const log_1 = require("../log"); | ||
@@ -13,3 +14,3 @@ const spm_1 = require("../util/spm"); | ||
async function buildiOS(config, buildOptions) { | ||
var _a; | ||
var _a, _b, _c, _d; | ||
const theScheme = (_a = buildOptions.scheme) !== null && _a !== void 0 ? _a : 'App'; | ||
@@ -27,3 +28,7 @@ const packageManager = await (0, spm_1.checkPackageManager)(config); | ||
} | ||
await (0, common_1.runTask)('Building xArchive', async () => (0, subprocess_1.runCommand)('xcodebuild', [ | ||
if (buildOptions.xcodeSigningType == 'manual' && | ||
(!buildOptions.xcodeSigningCertificate || !buildOptions.xcodeProvisioningProfile)) { | ||
throw 'Manually signed Xcode builds require a signing certificate and provisioning profile.'; | ||
} | ||
const buildArgs = [ | ||
typeOfBuild, | ||
@@ -38,5 +43,19 @@ projectName, | ||
'archive', | ||
], { | ||
]; | ||
if (buildOptions.xcodeTeamId) { | ||
buildArgs.push(`DEVELOPMENT_TEAM=${buildOptions.xcodeTeamId}`); | ||
} | ||
if (buildOptions.xcodeSigningType == 'manual') { | ||
buildArgs.push(`PROVISIONING_PROFILE_SPECIFIER=${buildOptions.xcodeProvisioningProfile}`); | ||
} | ||
await (0, common_1.runTask)('Building xArchive', async () => (0, subprocess_1.runCommand)('xcodebuild', buildArgs, { | ||
cwd: config.ios.nativeProjectDirAbs, | ||
})); | ||
const manualSigningContents = `<key>provisioningProfiles</key> | ||
<dict> | ||
<key>${config.app.appId}</key> | ||
<string>${(_b = buildOptions.xcodeProvisioningProfile) !== null && _b !== void 0 ? _b : ''}</string> | ||
</dict> | ||
<key>signingCertificate</key> | ||
<string>${(_c = buildOptions.xcodeSigningCertificate) !== null && _c !== void 0 ? _c : ''}</string>`; | ||
const archivePlistContents = `<?xml version="1.0" encoding="UTF-8"?> | ||
@@ -47,3 +66,6 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<key>method</key> | ||
<string>app-store-connect</string> | ||
<string>${(_d = buildOptions.xcodeExportMethod) !== null && _d !== void 0 ? _d : definitions_1.XcodeExportMethod.AppStoreConnect}</string> | ||
<key>signingStyle</key> | ||
<string>${buildOptions.xcodeSigningType}</string> | ||
${buildOptions.xcodeSigningType == 'manual' ? manualSigningContents : ''} | ||
</dict> | ||
@@ -53,3 +75,3 @@ </plist>`; | ||
(0, fs_extra_1.writeFileSync)(archivePlistPath, archivePlistContents); | ||
await (0, common_1.runTask)('Building IPA', async () => (0, subprocess_1.runCommand)('xcodebuild', [ | ||
const archiveArgs = [ | ||
'archive', | ||
@@ -63,6 +85,9 @@ '-archivePath', | ||
'output', | ||
'-allowProvisioningUpdates', | ||
'-configuration', | ||
buildOptions.configuration, | ||
], { | ||
]; | ||
if (buildOptions.xcodeSigningType == 'automatic') { | ||
archiveArgs.push('-allowProvisioningUpdates'); | ||
} | ||
await (0, common_1.runTask)('Building IPA', async () => (0, subprocess_1.runCommand)('xcodebuild', archiveArgs, { | ||
cwd: config.ios.nativeProjectDirAbs, | ||
@@ -69,0 +94,0 @@ })); |
@@ -6,2 +6,3 @@ "use strict"; | ||
const common_1 = require("../common"); | ||
const definitions_1 = require("../definitions"); | ||
const errors_1 = require("../errors"); | ||
@@ -29,2 +30,7 @@ const build_2 = require("../ios/build"); | ||
configuration: buildOptions.configuration || 'Release', | ||
xcodeTeamId: buildOptions.xcodeTeamId || config.ios.buildOptions.teamId, | ||
xcodeExportMethod: buildOptions.xcodeExportMethod || config.ios.buildOptions.exportMethod || definitions_1.XcodeExportMethod.AppStoreConnect, | ||
xcodeSigningType: buildOptions.xcodeSigningType || config.ios.buildOptions.xcodeSigningStyle || 'automatic', | ||
xcodeSigningCertificate: buildOptions.xcodeSigningCertificate || config.ios.buildOptions.signingCertificate, | ||
xcodeProvisioningProfile: buildOptions.xcodeProvisioningProfile || config.ios.buildOptions.provisioningProfile, | ||
}; | ||
@@ -31,0 +37,0 @@ try { |
@@ -126,4 +126,5 @@ "use strict"; | ||
await (0, common_1.runTask)(`Creating ${colors_1.default.strong(nativeConfigFile)} in ${nativeRelDir}`, async () => { | ||
var _a; | ||
var _a, _b; | ||
(_a = config.app.extConfig.android) === null || _a === void 0 ? true : delete _a.buildOptions; | ||
(_b = config.app.extConfig.ios) === null || _b === void 0 ? true : delete _b.buildOptions; | ||
await (0, fs_extra_1.writeJSON)(nativeConfigFilePath, config.app.extConfig, { | ||
@@ -130,0 +131,0 @@ spaces: '\t', |
{ | ||
"name": "@capacitor/cli", | ||
"version": "7.0.2-nightly-20250207T150528.0", | ||
"version": "7.0.2-nightly-20250210T150536.0", | ||
"description": "Capacitor: Cross-platform apps with JavaScript and the web", | ||
@@ -5,0 +5,0 @@ "homepage": "https://capacitorjs.com", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
854712
7024