@capacitor/cli 5.2.3-nightly-20230724T150520.0 → 5.2.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.
Binary file
Binary file
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doctorAndroid = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const utils_fs_1 = require("@ionic/utils-fs");
6
- const fs_1 = require("fs");
7
6
  const path_1 = require("path");
8
7
  const colors_1 = tslib_1.__importDefault(require("../colors"));
9
8
  const common_1 = require("../common");
@@ -66,10 +65,6 @@ async function checkAndroidManifestData(config, xmlData) {
66
65
  if (!manifestNode) {
67
66
  return `Missing ${colors_1.default.input('<manifest>')} XML node in ${colors_1.default.strong(config.android.srcMainDir)}`;
68
67
  }
69
- const packageId = manifestNode.$['package'];
70
- if (!packageId) {
71
- return `Missing ${colors_1.default.input('<manifest package="">')} attribute in ${colors_1.default.strong(config.android.srcMainDir)}`;
72
- }
73
68
  const applicationChildNodes = manifestNode.application;
74
69
  if (!Array.isArray(manifestNode.application)) {
75
70
  return `Missing ${colors_1.default.input('<application>')} XML node as a child node of ${colors_1.default.input('<manifest>')} in ${colors_1.default.strong(config.android.srcMainDir)}`;
@@ -118,37 +113,25 @@ async function checkAndroidManifestData(config, xmlData) {
118
113
  if (!mainActivityClassPath) {
119
114
  return `Missing ${colors_1.default.input('<activity android:name="">')} attribute for MainActivity class in ${colors_1.default.strong(config.android.srcMainDir)}`;
120
115
  }
121
- return checkPackage(config, packageId, mainActivityClassPath);
116
+ return checkPackage(config, mainActivityClassPath);
122
117
  }
123
- async function checkPackage(config, packageId, mainActivityClassPath) {
124
- if (mainActivityClassPath.indexOf(packageId) !== 0) {
125
- return (`MainActivity ${mainActivityClassPath} is not in manifest package ${colors_1.default.input(packageId)}.\n` + `Please update the packages to be the same.`);
126
- }
118
+ async function checkPackage(config, mainActivityClassPath) {
127
119
  const appSrcMainJavaDir = (0, path_1.join)(config.android.srcMainDirAbs, 'java');
128
120
  if (!(await (0, utils_fs_1.pathExists)(appSrcMainJavaDir))) {
129
121
  return `${colors_1.default.strong('java')} directory is missing in ${colors_1.default.strong(appSrcMainJavaDir)}`;
130
122
  }
131
- let checkPath = appSrcMainJavaDir;
132
- const packageParts = packageId.split('.');
133
- for (const packagePart of packageParts) {
134
- try {
135
- (0, fs_1.accessSync)((0, path_1.join)(checkPath, packagePart));
136
- checkPath = (0, path_1.join)(checkPath, packagePart);
137
- }
138
- catch (e) {
139
- return (`${colors_1.default.strong(packagePart)} is missing in ${checkPath}.\n` +
140
- `Please create a directory structure matching the Package ID ${colors_1.default.input(packageId)} within the ${appSrcMainJavaDir} directory.`);
141
- }
142
- }
143
123
  const mainActivityClassName = mainActivityClassPath.split('.').pop();
144
- const mainActivityClassFileName = `${mainActivityClassName}.java`;
145
- const mainActivityClassFilePath = (0, path_1.join)(checkPath, mainActivityClassFileName);
146
- if (!(await (0, utils_fs_1.pathExists)(mainActivityClassFilePath))) {
147
- return `Main activity file (${mainActivityClassFileName}) is missing in ${checkPath}`;
124
+ const srcFiles = await (0, utils_fs_1.readdirp)(appSrcMainJavaDir, {
125
+ filter: entry => !entry.stats.isDirectory() &&
126
+ ['.java', '.kt'].includes((0, path_1.extname)(entry.path)) &&
127
+ mainActivityClassName === (0, path_1.parse)(entry.path).name,
128
+ });
129
+ if (srcFiles.length == 0) {
130
+ return `Main activity file (${mainActivityClassName}) is missing`;
148
131
  }
149
- return checkBuildGradle(config, packageId);
132
+ return checkBuildGradle(config);
150
133
  }
151
- async function checkBuildGradle(config, packageId) {
134
+ async function checkBuildGradle(config) {
152
135
  const fileName = 'build.gradle';
153
136
  const filePath = (0, path_1.join)(config.android.appDirAbs, fileName);
154
137
  if (!(await (0, utils_fs_1.pathExists)(filePath))) {
@@ -156,9 +139,9 @@ async function checkBuildGradle(config, packageId) {
156
139
  }
157
140
  let fileContent = await (0, utils_fs_1.readFile)(filePath, { encoding: 'utf-8' });
158
141
  fileContent = fileContent.replace(/'|"/g, '').replace(/\s+/g, ' ');
159
- const searchFor = `applicationId ${packageId}`;
142
+ const searchFor = `applicationId`;
160
143
  if (fileContent.indexOf(searchFor) === -1) {
161
- return `${colors_1.default.strong('build.gradle')} file missing ${colors_1.default.input(`applicationId "${packageId}"`)} config in ${filePath}`;
144
+ return `${colors_1.default.strong('build.gradle')} file missing ${colors_1.default.input(`applicationId`)} config in ${filePath}`;
162
145
  }
163
146
  return null;
164
147
  }
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, _f, _g, _h, _j, _k, _l, _m;
151
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
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 = (0, path_1.resolve)(rootDir, platformDir);
@@ -172,7 +172,10 @@ async function loadAndroidConfig(rootDir, extConfig, cliConfig) {
172
172
  const buildOptions = {
173
173
  keystorePath: (_h = (_g = extConfig.android) === null || _g === void 0 ? void 0 : _g.buildOptions) === null || _h === void 0 ? void 0 : _h.keystorePath,
174
174
  keystorePassword: (_k = (_j = extConfig.android) === null || _j === void 0 ? void 0 : _j.buildOptions) === null || _k === void 0 ? void 0 : _k.keystorePassword,
175
- releaseType: (_m = (_l = extConfig.android) === null || _l === void 0 ? void 0 : _l.buildOptions) === null || _m === void 0 ? void 0 : _m.releaseType,
175
+ keystoreAlias: (_m = (_l = extConfig.android) === null || _l === void 0 ? void 0 : _l.buildOptions) === null || _m === void 0 ? void 0 : _m.keystoreAlias,
176
+ keystoreAliasPassword: (_p = (_o = extConfig.android) === null || _o === void 0 ? void 0 : _o.buildOptions) === null || _p === void 0 ? void 0 : _p.keystoreAliasPassword,
177
+ signingType: (_r = (_q = extConfig.android) === null || _q === void 0 ? void 0 : _q.buildOptions) === null || _r === void 0 ? void 0 : _r.signingType,
178
+ releaseType: (_t = (_s = extConfig.android) === null || _s === void 0 ? void 0 : _s.buildOptions) === null || _t === void 0 ? void 0 : _t.releaseType,
176
179
  };
177
180
  return {
178
181
  name,
package/dist/index.js CHANGED
@@ -97,7 +97,7 @@ function runProgram(config) {
97
97
  .option('--keystorealiaspass <keystoreAliasPass>', 'Password for the Key Alias')
98
98
  .addOption(new commander_1.Option('--androidreleasetype <androidreleasetype>', 'Android release type; APK or AAB').choices(['AAB', 'APK']))
99
99
  .addOption(new commander_1.Option('--signing-type <signingtype>', 'Program used to sign apps (default: jarsigner)').choices(['apksigner', 'jarsigner']))
100
- .action((0, cli_1.wrapAction)((0, telemetry_1.telemetryAction)(config, async (platform, { scheme, keystorepath, keystorepass, keystorealias, keystorealiaspass, androidreleasetype, signingtype, }) => {
100
+ .action((0, cli_1.wrapAction)((0, telemetry_1.telemetryAction)(config, async (platform, { scheme, keystorepath, keystorepass, keystorealias, keystorealiaspass, androidreleasetype, signingType, }) => {
101
101
  const { buildCommand } = await Promise.resolve().then(() => tslib_1.__importStar(require('./tasks/build')));
102
102
  await buildCommand(config, platform, {
103
103
  scheme,
@@ -106,7 +106,7 @@ function runProgram(config) {
106
106
  keystorealias,
107
107
  keystorealiaspass,
108
108
  androidreleasetype,
109
- signingtype,
109
+ signingtype: signingType,
110
110
  });
111
111
  })));
112
112
  commander_1.program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "5.2.3-nightly-20230724T150520.0",
3
+ "version": "5.2.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)",