Update capacitor version
This commit is contained in:
parent
91155bce0a
commit
f3b3a86b32
610 changed files with 28718 additions and 7101 deletions
52
@capacitor/cli/dist/ios/build.js
vendored
52
@capacitor/cli/dist/ios/build.js
vendored
|
|
@ -1,16 +1,16 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.buildiOS = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path_1 = require("path");
|
||||
const rimraf_1 = tslib_1.__importDefault(require("rimraf"));
|
||||
const rimraf_1 = require("rimraf");
|
||||
const common_1 = require("../common");
|
||||
const definitions_1 = require("../definitions");
|
||||
const log_1 = require("../log");
|
||||
const spm_1 = require("../util/spm");
|
||||
const subprocess_1 = require("../util/subprocess");
|
||||
async function buildiOS(config, buildOptions) {
|
||||
var _a;
|
||||
var _a, _b, _c, _d;
|
||||
const theScheme = (_a = buildOptions.scheme) !== null && _a !== void 0 ? _a : 'App';
|
||||
const packageManager = await (0, spm_1.checkPackageManager)(config);
|
||||
let typeOfBuild;
|
||||
|
|
@ -23,7 +23,11 @@ async function buildiOS(config, buildOptions) {
|
|||
typeOfBuild = '-project';
|
||||
projectName = (0, path_1.basename)(await config.ios.nativeXcodeProjDirAbs);
|
||||
}
|
||||
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,
|
||||
projectName,
|
||||
'-scheme',
|
||||
|
|
@ -33,20 +37,39 @@ async function buildiOS(config, buildOptions) {
|
|||
'-archivePath',
|
||||
`${theScheme}.xcarchive`,
|
||||
'archive',
|
||||
], {
|
||||
'-configuration',
|
||||
buildOptions.configuration,
|
||||
];
|
||||
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"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>method</key>
|
||||
<string>app-store</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>
|
||||
</plist>`;
|
||||
const archivePlistPath = (0, path_1.join)(`${config.ios.nativeProjectDirAbs}`, 'archive.plist');
|
||||
(0, utils_fs_1.writeFileSync)(archivePlistPath, archivePlistContents);
|
||||
await (0, common_1.runTask)('Building IPA', async () => (0, subprocess_1.runCommand)('xcodebuild', [
|
||||
(0, fs_extra_1.writeFileSync)(archivePlistPath, archivePlistContents);
|
||||
const archiveArgs = [
|
||||
'archive',
|
||||
'-archivePath',
|
||||
`${theScheme}.xcarchive`,
|
||||
|
|
@ -55,15 +78,18 @@ async function buildiOS(config, buildOptions) {
|
|||
'archive.plist',
|
||||
'-exportPath',
|
||||
'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,
|
||||
}));
|
||||
await (0, common_1.runTask)('Cleaning up', async () => {
|
||||
(0, utils_fs_1.unlinkSync)(archivePlistPath);
|
||||
rimraf_1.default.sync((0, path_1.join)(config.ios.nativeProjectDirAbs, `${theScheme}.xcarchive`));
|
||||
(0, fs_extra_1.unlinkSync)(archivePlistPath);
|
||||
rimraf_1.rimraf.sync((0, path_1.join)(config.ios.nativeProjectDirAbs, `${theScheme}.xcarchive`));
|
||||
});
|
||||
(0, log_1.logSuccess)(`Successfully generated an IPA at: ${(0, path_1.join)(config.ios.nativeProjectDirAbs, 'output')}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue