@capacitor/cli 3.2.5 → 3.3.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/CHANGELOG.md +56 -0
- package/assets/android-template.tar.gz +0 -0
- package/assets/capacitor-cordova-android-plugins.tar.gz +0 -0
- package/assets/capacitor-cordova-ios-plugins.tar.gz +0 -0
- package/assets/ios-template.tar.gz +0 -0
- package/dist/android/add.js +5 -5
- package/dist/android/run.js +3 -1
- package/dist/android/update.js +2 -0
- package/dist/config.js +18 -16
- package/dist/cordova.js +27 -8
- package/dist/declarations.d.ts +16 -0
- package/dist/ios/common.js +1 -9
- package/dist/ios/update.js +24 -17
- package/dist/tasks/add.js +5 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,62 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.3.3](https://github.com/ionic-team/capacitor/compare/3.3.2...3.3.3) (2021-12-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **android:** restrict android run command to configured flavour ([#5256](https://github.com/ionic-team/capacitor/issues/5256)) ([ba84443](https://github.com/ionic-team/capacitor/commit/ba84443dce9c81e09140def57a60018b527b5bb5))
|
|
12
|
+
* **cli:** Add onesignal-cordova-plugin to the static list again ([#5262](https://github.com/ionic-team/capacitor/issues/5262)) ([e67ca99](https://github.com/ionic-team/capacitor/commit/e67ca9964c5a923d35f5cf41eb802c665563726f))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [3.3.2](https://github.com/ionic-team/capacitor/compare/3.3.1...3.3.2) (2021-11-17)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **cli:** add cordova-plugin-google-analytics to static list ([#5220](https://github.com/ionic-team/capacitor/issues/5220)) ([67a996c](https://github.com/ionic-team/capacitor/commit/67a996c0a6896e32c41ea01822d6435fdd706b84))
|
|
24
|
+
* **cli:** Add plugin to static list if pod has use-frameworks ([#5232](https://github.com/ionic-team/capacitor/issues/5232)) ([8a0518b](https://github.com/ionic-team/capacitor/commit/8a0518be9f6f6a4be4a9f1366cb8dcb191225b9d))
|
|
25
|
+
* **cli:** sync gradle from android folder ([#5233](https://github.com/ionic-team/capacitor/issues/5233)) ([cd779c4](https://github.com/ionic-team/capacitor/commit/cd779c4b6ed4ffc96777be7c94a0af4baca6d6d5))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## [3.3.1](https://github.com/ionic-team/capacitor/compare/3.3.0...3.3.1) (2021-11-05)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* **cli:** Make config don't error if iOS is missing ([#5212](https://github.com/ionic-team/capacitor/issues/5212)) ([db9f12b](https://github.com/ionic-team/capacitor/commit/db9f12b545994b2ed88098c0168bb051f8191771))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# [3.3.0](https://github.com/ionic-team/capacitor/compare/3.2.5...3.3.0) (2021-11-03)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* **cli:** Add Batch plugin to static list ([#5138](https://github.com/ionic-team/capacitor/issues/5138)) ([9470633](https://github.com/ionic-team/capacitor/commit/94706338c096b30390fa288c9b107e253923a644))
|
|
48
|
+
* **cli:** Add onesignal-cordova-plugin to static pod list ([#5143](https://github.com/ionic-team/capacitor/issues/5143)) ([937e240](https://github.com/ionic-team/capacitor/commit/937e2408f9bb60691e653b70d8b7cb02f540b251))
|
|
49
|
+
* **cli:** detect and register multiple plugins from same package ([#5098](https://github.com/ionic-team/capacitor/issues/5098)) ([25e770c](https://github.com/ionic-team/capacitor/commit/25e770c3f598bf3a1e05e21d607ab3ad70268674))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* **cli:** add support for 'pod install' in VM based environments ([#5144](https://github.com/ionic-team/capacitor/issues/5144)) ([32ecf22](https://github.com/ionic-team/capacitor/commit/32ecf22de0a550756dbfa68b3b17c2333c89a430))
|
|
55
|
+
* **cli:** Allow to configure access origin tags on cordova config.xml ([#5134](https://github.com/ionic-team/capacitor/issues/5134)) ([0841a09](https://github.com/ionic-team/capacitor/commit/0841a093bf73ed4acac9a90be44a8e8a3aedbcdb))
|
|
56
|
+
* **cli:** Allow users to include Cordova plugins to the static list ([#5175](https://github.com/ionic-team/capacitor/issues/5175)) ([664149a](https://github.com/ionic-team/capacitor/commit/664149aadbe80e66dd757315a826ec1ab305edb9))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
6
62
|
## [3.2.5](https://github.com/ionic-team/capacitor/compare/3.2.4...3.2.5) (2021-10-13)
|
|
7
63
|
|
|
8
64
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/android/add.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addAndroid = void 0;
|
|
3
|
+
exports.createLocalProperties = exports.addAndroid = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const utils_fs_1 = require("@ionic/utils-fs");
|
|
6
6
|
const os_1 = require("os");
|
|
@@ -13,9 +13,6 @@ async function addAndroid(config) {
|
|
|
13
13
|
await common_1.runTask(`Adding native android project in ${colors_1.default.strong(config.android.platformDir)}`, async () => {
|
|
14
14
|
return template_1.extractTemplate(config.cli.assets.android.platformTemplateArchiveAbs, config.android.platformDirAbs);
|
|
15
15
|
});
|
|
16
|
-
await common_1.runTask('Syncing Gradle', async () => {
|
|
17
|
-
return createLocalProperties(config.android.platformDirAbs);
|
|
18
|
-
});
|
|
19
16
|
}
|
|
20
17
|
exports.addAndroid = addAndroid;
|
|
21
18
|
async function createLocalProperties(platformDir) {
|
|
@@ -47,6 +44,9 @@ sdk.dir=${defaultAndroidPath}
|
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
}
|
|
47
|
+
exports.createLocalProperties = createLocalProperties;
|
|
50
48
|
async function gradleSync(platformDir) {
|
|
51
|
-
await subprocess_1.runCommand(
|
|
49
|
+
await subprocess_1.runCommand(`./gradlew`, [], {
|
|
50
|
+
cwd: platformDir,
|
|
51
|
+
});
|
|
52
52
|
}
|
package/dist/android/run.js
CHANGED
|
@@ -10,8 +10,10 @@ const native_run_1 = require("../util/native-run");
|
|
|
10
10
|
const subprocess_1 = require("../util/subprocess");
|
|
11
11
|
const debug = debug_1.default('capacitor:android:run');
|
|
12
12
|
async function runAndroid(config, { target: selectedTarget }) {
|
|
13
|
+
var _a;
|
|
13
14
|
const target = await common_1.promptForPlatformTarget(await native_run_1.getPlatformTargets('android'), selectedTarget);
|
|
14
|
-
const
|
|
15
|
+
const arg = `assemble${((_a = config.android) === null || _a === void 0 ? void 0 : _a.flavor) || ''}Debug`;
|
|
16
|
+
const gradleArgs = [arg];
|
|
15
17
|
debug('Invoking ./gradlew with args: %O', gradleArgs);
|
|
16
18
|
await common_1.runTask('Running Gradle build', async () => subprocess_1.runCommand('./gradlew', gradleArgs, {
|
|
17
19
|
cwd: config.android.platformDirAbs,
|
package/dist/android/update.js
CHANGED
|
@@ -69,10 +69,12 @@ async function findAndroidPluginClassesInPlugin(plugin) {
|
|
|
69
69
|
debug('Searching %O source files in %O by %O regex', srcFiles.length, srcPath, classRegex);
|
|
70
70
|
const entries = await Promise.all(srcFiles.map(async (srcFile) => {
|
|
71
71
|
const srcFileContents = await utils_fs_1.readFile(srcFile, { encoding: 'utf-8' });
|
|
72
|
+
classRegex.lastIndex = 0;
|
|
72
73
|
const classMatch = classRegex.exec(srcFileContents);
|
|
73
74
|
if (classMatch) {
|
|
74
75
|
const className = classMatch[1];
|
|
75
76
|
debug('Searching %O for package by %O regex', srcFile, packageRegex);
|
|
77
|
+
packageRegex.lastIndex = 0;
|
|
76
78
|
const packageMatch = packageRegex.exec(srcFileContents.substring(0, classMatch.index));
|
|
77
79
|
if (!packageMatch) {
|
|
78
80
|
errors_1.fatal(`Package could not be parsed from Android plugin.\n` +
|
package/dist/config.js
CHANGED
|
@@ -148,7 +148,7 @@ async function loadCLIConfig(rootDir) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
async function loadAndroidConfig(rootDir, extConfig, cliConfig) {
|
|
151
|
-
var _a, _b, _c, _d, _e;
|
|
151
|
+
var _a, _b, _c, _d, _e, _f;
|
|
152
152
|
const name = 'android';
|
|
153
153
|
const platformDir = (_b = (_a = extConfig.android) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : 'android';
|
|
154
154
|
const platformDirAbs = path_1.resolve(rootDir, platformDir);
|
|
@@ -160,9 +160,10 @@ async function loadAndroidConfig(rootDir, extConfig, cliConfig) {
|
|
|
160
160
|
const resDir = `${srcMainDir}/res`;
|
|
161
161
|
let apkPath = `${appDir}/build/outputs/apk/`;
|
|
162
162
|
let flavorPrefix = '';
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
const flavor = ((_c = extConfig.android) === null || _c === void 0 ? void 0 : _c.flavor) || '';
|
|
164
|
+
if ((_d = extConfig.android) === null || _d === void 0 ? void 0 : _d.flavor) {
|
|
165
|
+
apkPath = `${apkPath}/${(_e = extConfig.android) === null || _e === void 0 ? void 0 : _e.flavor}`;
|
|
166
|
+
flavorPrefix = `-${(_f = extConfig.android) === null || _f === void 0 ? void 0 : _f.flavor}`;
|
|
166
167
|
}
|
|
167
168
|
const apkName = `app${flavorPrefix}-debug.apk`;
|
|
168
169
|
const buildOutputDir = `${apkPath}/debug`;
|
|
@@ -191,6 +192,7 @@ async function loadAndroidConfig(rootDir, extConfig, cliConfig) {
|
|
|
191
192
|
apkName,
|
|
192
193
|
buildOutputDir,
|
|
193
194
|
buildOutputDirAbs: path_1.resolve(platformDirAbs, buildOutputDir),
|
|
195
|
+
flavor,
|
|
194
196
|
};
|
|
195
197
|
}
|
|
196
198
|
async function loadIOSConfig(rootDir, extConfig) {
|
|
@@ -251,22 +253,22 @@ function determineOS(os) {
|
|
|
251
253
|
return "unknown" /* Unknown */;
|
|
252
254
|
}
|
|
253
255
|
async function determineXcodeWorkspaceDirAbs(nativeProjectDirAbs) {
|
|
254
|
-
|
|
255
|
-
if (!(await utils_fs_1.pathExists(xcodeDir))) {
|
|
256
|
-
errors_1.fatal('Xcode workspace does not exist.\n' +
|
|
257
|
-
`See the docs for adding the ${colors_1.default.strong('ios')} platform: ${colors_1.default.strong('https://capacitorjs.com/docs/ios#adding-the-ios-platform')}`);
|
|
258
|
-
}
|
|
259
|
-
return xcodeDir;
|
|
256
|
+
return path_1.resolve(nativeProjectDirAbs, 'App.xcworkspace');
|
|
260
257
|
}
|
|
261
258
|
async function determineIOSWebDirAbs(nativeProjectDirAbs, nativeTargetDirAbs, nativeXcodeProjDirAbs) {
|
|
262
259
|
const re = /path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/;
|
|
263
260
|
const pbxprojPath = path_1.resolve(nativeXcodeProjDirAbs, 'project.pbxproj');
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
`
|
|
269
|
-
|
|
261
|
+
try {
|
|
262
|
+
const pbxproj = await utils_fs_1.readFile(pbxprojPath, { encoding: 'utf8' });
|
|
263
|
+
const m = pbxproj.match(re);
|
|
264
|
+
if (m && m[1] === 'SOURCE_ROOT') {
|
|
265
|
+
log_1.logger.warn(`Using the iOS project root for the ${colors_1.default.strong('public')} directory is deprecated.\n` +
|
|
266
|
+
`Please follow the Upgrade Guide to move ${colors_1.default.strong('public')} inside the iOS target directory: ${colors_1.default.strong('https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory')}`);
|
|
267
|
+
return path_1.resolve(nativeProjectDirAbs, 'public');
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (e) {
|
|
271
|
+
// ignore
|
|
270
272
|
}
|
|
271
273
|
return path_1.resolve(nativeTargetDirAbs, 'public');
|
|
272
274
|
}
|
package/dist/cordova.js
CHANGED
|
@@ -152,7 +152,7 @@ async function removePluginFiles(config, platform) {
|
|
|
152
152
|
}
|
|
153
153
|
exports.removePluginFiles = removePluginFiles;
|
|
154
154
|
async function autoGenerateConfig(config, cordovaPlugins, platform) {
|
|
155
|
-
var _a, _b;
|
|
155
|
+
var _a, _b, _c, _d;
|
|
156
156
|
let xmlDir = path_1.join(config.android.resDirAbs, 'xml');
|
|
157
157
|
const fileName = 'config.xml';
|
|
158
158
|
if (platform === 'ios') {
|
|
@@ -180,12 +180,22 @@ async function autoGenerateConfig(config, cordovaPlugins, platform) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
|
+
let accessOriginString = [];
|
|
184
|
+
if ((_b = (_a = config.app.extConfig) === null || _a === void 0 ? void 0 : _a.cordova) === null || _b === void 0 ? void 0 : _b.accessOrigins) {
|
|
185
|
+
accessOriginString = await Promise.all(config.app.extConfig.cordova.accessOrigins.map(async (host) => {
|
|
186
|
+
return `
|
|
187
|
+
<access origin="${host}" />`;
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
accessOriginString.push(`<access origin="*" />`);
|
|
192
|
+
}
|
|
183
193
|
const pluginEntriesString = await Promise.all(pluginEntries.map(async (item) => {
|
|
184
194
|
const xmlString = await xml_1.writeXML(item);
|
|
185
195
|
return xmlString;
|
|
186
196
|
}));
|
|
187
197
|
let pluginPreferencesString = [];
|
|
188
|
-
if ((
|
|
198
|
+
if ((_d = (_c = config.app.extConfig) === null || _c === void 0 ? void 0 : _c.cordova) === null || _d === void 0 ? void 0 : _d.preferences) {
|
|
189
199
|
pluginPreferencesString = await Promise.all(Object.entries(config.app.extConfig.cordova.preferences).map(async ([key, value]) => {
|
|
190
200
|
return `
|
|
191
201
|
<preference name="${key}" value="${value}" />`;
|
|
@@ -193,7 +203,7 @@ async function autoGenerateConfig(config, cordovaPlugins, platform) {
|
|
|
193
203
|
}
|
|
194
204
|
const content = `<?xml version='1.0' encoding='utf-8'?>
|
|
195
205
|
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
|
196
|
-
|
|
206
|
+
${accessOriginString.join('')}
|
|
197
207
|
${pluginEntriesString.join('')}
|
|
198
208
|
${pluginPreferencesString.join('')}
|
|
199
209
|
</widget>`;
|
|
@@ -376,15 +386,24 @@ function getIncompatibleCordovaPlugins(platform) {
|
|
|
376
386
|
return pluginList;
|
|
377
387
|
}
|
|
378
388
|
exports.getIncompatibleCordovaPlugins = getIncompatibleCordovaPlugins;
|
|
379
|
-
function needsStaticPod(plugin) {
|
|
380
|
-
|
|
389
|
+
function needsStaticPod(plugin, config) {
|
|
390
|
+
var _a, _b, _c, _d;
|
|
391
|
+
let pluginList = [
|
|
381
392
|
'phonegap-plugin-push',
|
|
382
|
-
'@
|
|
383
|
-
'cordova-plugin
|
|
393
|
+
'@batch.com/cordova-plugin',
|
|
394
|
+
'onesignal-cordova-plugin',
|
|
384
395
|
];
|
|
385
|
-
|
|
396
|
+
if ((_b = (_a = config.app.extConfig) === null || _a === void 0 ? void 0 : _a.cordova) === null || _b === void 0 ? void 0 : _b.staticPlugins) {
|
|
397
|
+
pluginList = pluginList.concat((_d = (_c = config.app.extConfig) === null || _c === void 0 ? void 0 : _c.cordova) === null || _d === void 0 ? void 0 : _d.staticPlugins);
|
|
398
|
+
}
|
|
399
|
+
return pluginList.includes(plugin.id) || useFrameworks(plugin);
|
|
386
400
|
}
|
|
387
401
|
exports.needsStaticPod = needsStaticPod;
|
|
402
|
+
function useFrameworks(plugin) {
|
|
403
|
+
const podspecs = plugin_1.getPlatformElement(plugin, 'ios', 'podspec');
|
|
404
|
+
const frameworkPods = podspecs.filter((podspec) => podspec.pods.filter((pods) => pods.$ && pods.$['use-frameworks'] === 'true').length > 0);
|
|
405
|
+
return frameworkPods.length > 0;
|
|
406
|
+
}
|
|
388
407
|
async function getCordovaPreferences(config) {
|
|
389
408
|
var _a, _b, _c, _d, _e;
|
|
390
409
|
const configXml = path_1.join(config.app.rootDir, 'config.xml');
|
package/dist/declarations.d.ts
CHANGED
|
@@ -387,6 +387,15 @@ export interface CapacitorConfig {
|
|
|
387
387
|
allowNavigation?: string[];
|
|
388
388
|
};
|
|
389
389
|
cordova?: {
|
|
390
|
+
/**
|
|
391
|
+
* Populates <access> tags in the config.xml with the origin set to
|
|
392
|
+
* the values entered here.
|
|
393
|
+
* If not provided, a single <access origin="*" /> tag gets included.
|
|
394
|
+
* It only has effect on a few Cordova plugins that respect the whitelist.
|
|
395
|
+
*
|
|
396
|
+
* @since 3.3.0
|
|
397
|
+
*/
|
|
398
|
+
accessOrigins?: string[];
|
|
390
399
|
/**
|
|
391
400
|
* Configure Cordova preferences.
|
|
392
401
|
*
|
|
@@ -395,6 +404,13 @@ export interface CapacitorConfig {
|
|
|
395
404
|
preferences?: {
|
|
396
405
|
[key: string]: string | undefined;
|
|
397
406
|
};
|
|
407
|
+
/**
|
|
408
|
+
* List of Cordova plugins that need to be static but are not
|
|
409
|
+
* already in the static plugin list.
|
|
410
|
+
*
|
|
411
|
+
* @since 3.3.0
|
|
412
|
+
*/
|
|
413
|
+
staticPlugins?: string[];
|
|
398
414
|
};
|
|
399
415
|
/**
|
|
400
416
|
* Configure plugins.
|
package/dist/ios/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.editProjectSettingsIOS = exports.resolvePlugin = exports.getIOSPlugins = exports.checkCocoaPods = exports.checkIOSPackage = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const utils_fs_1 = require("@ionic/utils-fs");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -69,11 +69,3 @@ async function editProjectSettingsIOS(config) {
|
|
|
69
69
|
await utils_fs_1.writeFile(pbxPath, pbxContent, { encoding: 'utf-8' });
|
|
70
70
|
}
|
|
71
71
|
exports.editProjectSettingsIOS = editProjectSettingsIOS;
|
|
72
|
-
function shouldPodInstall(config, platformName) {
|
|
73
|
-
// Don't run pod install or xcodebuild if not on macOS
|
|
74
|
-
if (config.cli.os !== "mac" /* Mac */ && platformName === 'ios') {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
exports.shouldPodInstall = shouldPodInstall;
|
package/dist/ios/update.js
CHANGED
|
@@ -40,14 +40,9 @@ async function updateIOS(config, deployment) {
|
|
|
40
40
|
}
|
|
41
41
|
exports.updateIOS = updateIOS;
|
|
42
42
|
async function installCocoaPodsPlugins(config, plugins, deployment) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
log_1.logger.warn('Skipping pod install on unsupported OS');
|
|
50
|
-
}
|
|
43
|
+
await common_1.runTask(`Updating iOS native dependencies with ${colors_1.default.input(`${config.ios.podPath} install`)}`, () => {
|
|
44
|
+
return updatePodfile(config, plugins, deployment);
|
|
45
|
+
});
|
|
51
46
|
}
|
|
52
47
|
exports.installCocoaPodsPlugins = installCocoaPodsPlugins;
|
|
53
48
|
async function updatePodfile(config, plugins, deployment) {
|
|
@@ -57,13 +52,25 @@ async function updatePodfile(config, plugins, deployment) {
|
|
|
57
52
|
let podfileContent = await utils_fs_1.readFile(podfilePath, { encoding: 'utf-8' });
|
|
58
53
|
podfileContent = podfileContent.replace(/(def capacitor_pods)[\s\S]+?(\nend)/, `$1${dependenciesContent}$2`);
|
|
59
54
|
await utils_fs_1.writeFile(podfilePath, podfileContent, { encoding: 'utf-8' });
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
const podCommandExists = await subprocess_1.isInstalled('pod');
|
|
56
|
+
if (podCommandExists) {
|
|
57
|
+
if (!deployment) {
|
|
58
|
+
await utils_fs_1.remove(podfileLockPath);
|
|
59
|
+
}
|
|
60
|
+
await subprocess_1.runCommand(config.ios.podPath, ['install', ...(deployment ? ['--deployment'] : [])], { cwd: config.ios.nativeProjectDirAbs });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
log_1.logger.warn('Skipping pod install because CocoaPods is not installed');
|
|
64
|
+
}
|
|
65
|
+
const isXcodebuildAvailable = await subprocess_1.isInstalled('xcodebuild');
|
|
66
|
+
if (isXcodebuildAvailable) {
|
|
67
|
+
await subprocess_1.runCommand('xcodebuild', ['-project', path_1.basename(`${config.ios.nativeXcodeProjDirAbs}`), 'clean'], {
|
|
68
|
+
cwd: config.ios.nativeProjectDirAbs,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
log_1.logger.warn('Unable to find "xcodebuild". Skipping xcodebuild clean step...');
|
|
62
73
|
}
|
|
63
|
-
await subprocess_1.runCommand(config.ios.podPath, ['install', ...(deployment ? ['--deployment'] : [])], { cwd: config.ios.nativeProjectDirAbs });
|
|
64
|
-
await subprocess_1.runCommand('xcodebuild', ['-project', path_1.basename(`${config.ios.nativeXcodeProjDirAbs}`), 'clean'], {
|
|
65
|
-
cwd: config.ios.nativeProjectDirAbs,
|
|
66
|
-
});
|
|
67
74
|
}
|
|
68
75
|
async function generatePodFile(config, plugins) {
|
|
69
76
|
const capacitoriOSPath = node_1.resolveNode(config.app.rootDir, '@capacitor/ios', 'package.json');
|
|
@@ -103,7 +110,7 @@ async function generatePodFile(config, plugins) {
|
|
|
103
110
|
});
|
|
104
111
|
});
|
|
105
112
|
});
|
|
106
|
-
const staticPlugins = cordovaPlugins.filter(cordova_1.needsStaticPod);
|
|
113
|
+
const staticPlugins = cordovaPlugins.filter(p => cordova_1.needsStaticPod(p, config));
|
|
107
114
|
const noStaticPlugins = cordovaPlugins.filter(el => !staticPlugins.includes(el));
|
|
108
115
|
if (noStaticPlugins.length > 0) {
|
|
109
116
|
pods.push(` pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'\n`);
|
|
@@ -135,7 +142,7 @@ function isFramework(framework) {
|
|
|
135
142
|
return framework.$.src.split('.').pop().includes('framework');
|
|
136
143
|
}
|
|
137
144
|
async function generateCordovaPodspecs(cordovaPlugins, config) {
|
|
138
|
-
const staticPlugins = cordovaPlugins.filter(cordova_1.needsStaticPod);
|
|
145
|
+
const staticPlugins = cordovaPlugins.filter(p => cordova_1.needsStaticPod(p, config));
|
|
139
146
|
const noStaticPlugins = cordovaPlugins.filter(el => !staticPlugins.includes(el));
|
|
140
147
|
generateCordovaPodspec(noStaticPlugins, config, false);
|
|
141
148
|
generateCordovaPodspec(staticPlugins, config, true);
|
|
@@ -291,7 +298,7 @@ async function copyPluginsNativeFiles(config, cordovaPlugins) {
|
|
|
291
298
|
const codeFiles = sourceFiles.concat(headerFiles);
|
|
292
299
|
const frameworks = plugin_1.getPlatformElement(p, platform, 'framework');
|
|
293
300
|
let sourcesFolderName = 'sources';
|
|
294
|
-
if (cordova_1.needsStaticPod(p)) {
|
|
301
|
+
if (cordova_1.needsStaticPod(p, config)) {
|
|
295
302
|
sourcesFolderName += 'static';
|
|
296
303
|
}
|
|
297
304
|
const sourcesFolder = path_1.join(config.ios.cordovaPluginsDirAbs, sourcesFolderName, p.name);
|
package/dist/tasks/add.js
CHANGED
|
@@ -56,6 +56,11 @@ async function addCommand(config, selectedPlatformName) {
|
|
|
56
56
|
await editPlatforms(config, platformName);
|
|
57
57
|
if (await utils_fs_1.pathExists(config.app.webDirAbs)) {
|
|
58
58
|
await sync_1.sync(config, platformName, false);
|
|
59
|
+
if (platformName === config.android.name) {
|
|
60
|
+
await common_2.runTask('Syncing Gradle', async () => {
|
|
61
|
+
return add_1.createLocalProperties(config.android.platformDirAbs);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
65
|
else {
|
|
61
66
|
log_1.logger.warn(`${colors_1.default.success(colors_1.default.strong('sync'))} could not run--missing ${colors_1.default.strong(config.app.webDir)} directory.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.3",
|
|
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)",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "cd8221ed0162454d2ee01dc3bc164de38a81bf43"
|
|
89
89
|
}
|