@capacitor/cli 4.4.0 → 4.4.1-nightly-20221024T151237.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
@@ -338,8 +338,13 @@ async function updateBuildGradle(filename, leaveJCenter, variablesAndClasspaths)
338
338
  let replaced = txt;
339
339
  for (const dep of Object.keys(neededDeps)) {
340
340
  if (replaced.includes(`classpath '${dep}`)) {
341
- replaced = setAllStringIn(replaced, `classpath '${dep}:`, `'`, neededDeps[dep]);
342
- log_1.logger.info(`Set ${dep} = ${neededDeps[dep]}.`);
341
+ const semver = await Promise.resolve().then(() => tslib_1.__importStar(require('semver')));
342
+ const firstIndex = replaced.indexOf(dep) + dep.length + 1;
343
+ const existingVersion = '' + replaced.substring(firstIndex, replaced.indexOf("'", firstIndex));
344
+ if (semver.gte(neededDeps[dep], existingVersion)) {
345
+ replaced = setAllStringIn(replaced, `classpath '${dep}:`, `'`, neededDeps[dep]);
346
+ log_1.logger.info(`Set ${dep} = ${neededDeps[dep]}.`);
347
+ }
343
348
  }
344
349
  }
345
350
  // Replace jcenter()
@@ -669,11 +674,13 @@ async function migrateMainActivity(config) {
669
674
  data = data.replace('// Initializes the Bridge', '');
670
675
  }
671
676
  const rindex = data.indexOf('registerPlugin');
677
+ const superLine = 'super.onCreate(savedInstanceState);';
672
678
  if (rindex !== -1) {
673
- if (data.indexOf('super.onCreate(savedInstanceState);') < rindex) {
674
- data = data.replace('super.onCreate(savedInstanceState);\n ', '');
679
+ if (data.indexOf(superLine) < rindex) {
680
+ const linePadding = rindex - data.indexOf(superLine) - superLine.length - 1;
681
+ data = data.replace(`${superLine}\n${' '.repeat(linePadding)}`, '');
675
682
  const eindex = data.lastIndexOf('.class);') + 8;
676
- data = data.replace(data.substring(bindex, eindex), `${data.substring(bindex, eindex)}\n super.onCreate(savedInstanceState);`);
683
+ data = data.replace(data.substring(bindex, eindex), `${data.substring(bindex, eindex)}\n${' '.repeat(linePadding) + superLine.padStart(linePadding)}`);
677
684
  }
678
685
  }
679
686
  if (bindex == -1 && rindex == -1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "4.4.0",
3
+ "version": "4.4.1-nightly-20221024T151237.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)",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "f9ec5a3059e109dbf2bd656f895243487eebeba5"
86
+ "gitHead": "ae941017fff3bcfa75e0788535f356a56ce6fa05"
87
87
  }