@akylas/nativescript-cli 8.7.2 → 8.8.2
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/config/test-deps-versions-generated.json +1 -1
- package/docs/man_pages/project/configuration/native/native-add-java.md +32 -0
- package/docs/man_pages/project/configuration/native/native-add-kotlin.md +34 -0
- package/docs/man_pages/project/configuration/native/native-add-objective-c.md +34 -0
- package/docs/man_pages/project/configuration/native/native-add-swift.md +32 -0
- package/docs/man_pages/project/configuration/native/native-add.md +31 -0
- package/docs/man_pages/project/configuration/native/native.md +31 -0
- package/lib/.d.ts +2 -0
- package/lib/bootstrap.js +8 -0
- package/lib/commands/embedding/embed.js +91 -0
- package/lib/commands/native-add.js +300 -0
- package/lib/commands/plugin/build-plugin.js +3 -9
- package/lib/commands/prepare.js +9 -0
- package/lib/commands/typings.js +1 -1
- package/lib/common/mobile/android/android-virtual-device-service.js +4 -1
- package/lib/common/mobile/android/logcat-helper.js +15 -6
- package/lib/common/mobile/emulator-helper.js +1 -0
- package/lib/common/utils.js +8 -1
- package/lib/controllers/migrate-controller.js +6 -6
- package/lib/controllers/platform-controller.js +4 -0
- package/lib/controllers/prepare-controller.js +61 -14
- package/lib/data/build-data.js +2 -0
- package/lib/data/prepare-data.js +1 -0
- package/lib/declarations.d.ts +14 -3
- package/lib/definitions/android-plugin-migrator.d.ts +1 -0
- package/lib/definitions/platform.d.ts +1 -0
- package/lib/definitions/prepare.d.ts +3 -0
- package/lib/definitions/project.d.ts +5 -0
- package/lib/helpers/platform-command-helper.js +10 -1
- package/lib/options.js +9 -2
- package/lib/project-data.js +4 -1
- package/lib/providers/project-files-provider.js +1 -1
- package/lib/services/android/gradle-build-args-service.js +4 -3
- package/lib/services/android/gradle-command-service.js +5 -1
- package/lib/services/android-plugin-build-service.js +34 -22
- package/lib/services/android-project-service.js +20 -23
- package/lib/services/assets-generation/assets-generation-service.js +5 -1
- package/lib/services/cocoapods-service.js +9 -3
- package/lib/services/files-hash-service.js +3 -2
- package/lib/services/ios-project-service.js +50 -17
- package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -4
- package/lib/services/livesync/android-livesync-service.js +2 -2
- package/lib/services/livesync/ios-livesync-service.js +2 -2
- package/lib/services/livesync/platform-livesync-service-base.js +4 -3
- package/lib/services/log-source-map-service.js +3 -2
- package/lib/services/platform/add-platform-service.js +7 -2
- package/lib/services/platform/prepare-native-platform-service.js +6 -3
- package/lib/services/platform-environment-requirements.js +3 -1
- package/lib/services/plugins-service.js +7 -1
- package/lib/services/project-changes-service.js +8 -1
- package/lib/services/project-config-service.js +1 -1
- package/lib/services/project-data-service.js +15 -21
- package/lib/services/webpack/webpack-compiler-service.js +14 -6
- package/lib/services/xcproj-service.js +12 -0
- package/package.json +3 -3
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-app/app/build.gradle +12 -4
- package/vendor/gradle-plugin/build.gradle +12 -4
package/lib/commands/prepare.js
CHANGED
|
@@ -15,8 +15,12 @@ const yok_1 = require("../common/yok");
|
|
|
15
15
|
class PrepareCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
16
16
|
constructor($options, $prepareController, $platformValidationService, $projectData, $platformCommandParameter, $platformsDataService, $prepareDataService, $migrateController) {
|
|
17
17
|
super($options, $platformsDataService, $platformValidationService, $projectData);
|
|
18
|
+
this.$options = $options;
|
|
18
19
|
this.$prepareController = $prepareController;
|
|
20
|
+
this.$platformValidationService = $platformValidationService;
|
|
21
|
+
this.$projectData = $projectData;
|
|
19
22
|
this.$platformCommandParameter = $platformCommandParameter;
|
|
23
|
+
this.$platformsDataService = $platformsDataService;
|
|
20
24
|
this.$prepareDataService = $prepareDataService;
|
|
21
25
|
this.$migrateController = $migrateController;
|
|
22
26
|
this.allowedParameters = [this.$platformCommandParameter];
|
|
@@ -27,6 +31,11 @@ class PrepareCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
27
31
|
hasSensitiveValue: false,
|
|
28
32
|
},
|
|
29
33
|
hmr: { type: "boolean", default: false, hasSensitiveValue: false },
|
|
34
|
+
whatever: {
|
|
35
|
+
type: "boolean",
|
|
36
|
+
default: false,
|
|
37
|
+
hasSensitiveValue: false,
|
|
38
|
+
},
|
|
30
39
|
};
|
|
31
40
|
this.$projectData.initializeProjectData();
|
|
32
41
|
}
|
package/lib/commands/typings.js
CHANGED
|
@@ -73,7 +73,7 @@ class TypingsCommand {
|
|
|
73
73
|
return [];
|
|
74
74
|
}
|
|
75
75
|
const items = res.map((item) => {
|
|
76
|
-
const [group, artifact, version, sha1, file] = item.split(
|
|
76
|
+
const [group, artifact, version, sha1, file] = item.split(path.sep);
|
|
77
77
|
return {
|
|
78
78
|
id: sha1 + version,
|
|
79
79
|
group,
|
|
@@ -152,7 +152,10 @@ class AndroidVirtualDeviceService {
|
|
|
152
152
|
];
|
|
153
153
|
}
|
|
154
154
|
if (canExecuteAvdManagerCommand) {
|
|
155
|
-
|
|
155
|
+
const sanitizedPathToAvdManagerExecutable = this.$hostInfo.isWindows
|
|
156
|
+
? (0, helpers_1.quoteString)(this.pathToAvdManagerExecutable)
|
|
157
|
+
: this.pathToAvdManagerExecutable;
|
|
158
|
+
result = yield this.$childProcess.trySpawnFromCloseEvent(sanitizedPathToAvdManagerExecutable, ["list", "avds"], { shell: this.$hostInfo.isWindows });
|
|
156
159
|
}
|
|
157
160
|
else if (this.pathToAndroidExecutable &&
|
|
158
161
|
this.$fs.exists(this.pathToAndroidExecutable)) {
|
|
@@ -65,16 +65,17 @@ class LogcatHelper {
|
|
|
65
65
|
this.mapDevicesLoggingData[deviceIdentifier].rawLineStream =
|
|
66
66
|
rawLineStream;
|
|
67
67
|
rawLineStream.on("data", (lineBuffer) => {
|
|
68
|
-
var _a, _b;
|
|
68
|
+
var _a, _b, _c, _d;
|
|
69
69
|
if (!((_a = this.mapDevicesLoggingData[deviceIdentifier]) === null || _a === void 0 ? void 0 : _a.loggingProcess))
|
|
70
70
|
return;
|
|
71
71
|
const lines = (lineBuffer.toString() || "").split("\n");
|
|
72
72
|
for (let line of lines) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const startProc = /Start proc (?<pid>[0-9]+):(?<appId>.+?)\//.exec(line);
|
|
74
|
+
if (startProc &&
|
|
75
|
+
((_b = startProc.groups) === null || _b === void 0 ? void 0 : _b.appId) === options.appId &&
|
|
76
|
+
((_c = startProc.groups) === null || _c === void 0 ? void 0 : _c.pid) !== options.pid) {
|
|
76
77
|
this.forceStop(deviceIdentifier);
|
|
77
|
-
(
|
|
78
|
+
(_d = options.onAppRestarted) === null || _d === void 0 ? void 0 : _d.call(options);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
});
|
|
@@ -150,7 +151,15 @@ class LogcatHelper {
|
|
|
150
151
|
getAppStartTrackingLogcatStream(deviceIdentifier, appId) {
|
|
151
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
153
|
const adb = this.$injector.resolve(device_android_debug_bridge_1.DeviceAndroidDebugBridge, { identifier: deviceIdentifier });
|
|
153
|
-
const logcatCommand = [
|
|
154
|
+
const logcatCommand = [
|
|
155
|
+
`logcat`,
|
|
156
|
+
`-b`,
|
|
157
|
+
`system`,
|
|
158
|
+
`-T`,
|
|
159
|
+
`1`,
|
|
160
|
+
"-s",
|
|
161
|
+
"ActivityManager",
|
|
162
|
+
];
|
|
154
163
|
if (appId) {
|
|
155
164
|
logcatCommand.push(`--regex=START.*${appId}`);
|
|
156
165
|
}
|
package/lib/common/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Utils = void 0;
|
|
3
|
+
exports.capitalizeFirstLetter = exports.Utils = void 0;
|
|
4
4
|
const yok_1 = require("./yok");
|
|
5
5
|
class Utils {
|
|
6
6
|
constructor($options, $logger) {
|
|
@@ -28,4 +28,11 @@ class Utils {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.Utils = Utils;
|
|
31
|
+
function capitalizeFirstLetter(value) {
|
|
32
|
+
if (!value) {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
36
|
+
}
|
|
37
|
+
exports.capitalizeFirstLetter = capitalizeFirstLetter;
|
|
31
38
|
yok_1.injector.register("utils", Utils);
|
|
@@ -49,7 +49,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
49
49
|
{
|
|
50
50
|
packageName: "@nativescript/core",
|
|
51
51
|
minVersion: "6.5.0",
|
|
52
|
-
desiredVersion: "~8.
|
|
52
|
+
desiredVersion: "~8.8.0",
|
|
53
53
|
shouldAddIfMissing: true,
|
|
54
54
|
},
|
|
55
55
|
{
|
|
@@ -59,7 +59,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
59
59
|
{
|
|
60
60
|
packageName: "@nativescript/types",
|
|
61
61
|
minVersion: "7.0.0",
|
|
62
|
-
desiredVersion: "~8.
|
|
62
|
+
desiredVersion: "~8.8.0",
|
|
63
63
|
isDev: true,
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -113,7 +113,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
113
113
|
{
|
|
114
114
|
packageName: "@nativescript/angular",
|
|
115
115
|
minVersion: "10.0.0",
|
|
116
|
-
desiredVersion: "^
|
|
116
|
+
desiredVersion: "^18.0.0",
|
|
117
117
|
shouldMigrateAction(dependency, projectData, loose) {
|
|
118
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
119
|
if (!this.hasDependency(dependency, projectData)) {
|
|
@@ -197,13 +197,13 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
197
197
|
{
|
|
198
198
|
packageName: "@nativescript/ios",
|
|
199
199
|
minVersion: "6.5.3",
|
|
200
|
-
desiredVersion: "~8.
|
|
200
|
+
desiredVersion: "~8.8.0",
|
|
201
201
|
isDev: true,
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
204
|
packageName: "@nativescript/android",
|
|
205
205
|
minVersion: "7.0.0",
|
|
206
|
-
desiredVersion: "~8.
|
|
206
|
+
desiredVersion: "~8.8.0",
|
|
207
207
|
isDev: true,
|
|
208
208
|
},
|
|
209
209
|
];
|
|
@@ -782,7 +782,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
782
782
|
migrateNativeScriptAngular() {
|
|
783
783
|
return __awaiter(this, void 0, void 0, function* () {
|
|
784
784
|
const minVersion = "10.0.0";
|
|
785
|
-
const desiredVersion = "~
|
|
785
|
+
const desiredVersion = "~18.0.0";
|
|
786
786
|
const dependencies = [
|
|
787
787
|
{
|
|
788
788
|
packageName: "@angular/animations",
|
|
@@ -72,6 +72,10 @@ class PlatformController {
|
|
|
72
72
|
}
|
|
73
73
|
addPlatformIfNeeded(addPlatformData, projectData) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
if (addPlatformData.hostProjectPath) {
|
|
76
|
+
this.$logger.trace("Not adding platform because --hostProjectPath is provided.");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
75
79
|
const [platform] = addPlatformData.platform.toLowerCase().split("@");
|
|
76
80
|
projectData !== null && projectData !== void 0 ? projectData : (projectData = this.$projectDataService.getProjectData(addPlatformData.projectDir));
|
|
77
81
|
const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
@@ -14,6 +14,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
14
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
+
t[p[i]] = s[p[i]];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
17
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
29
|
exports.PrepareController = void 0;
|
|
19
30
|
const choki = require("chokidar");
|
|
@@ -24,13 +35,15 @@ const decorators_1 = require("../common/decorators");
|
|
|
24
35
|
const helpers_1 = require("../common/helpers");
|
|
25
36
|
const yok_1 = require("../common/yok");
|
|
26
37
|
const constants_1 = require("../constants");
|
|
38
|
+
const resolve_package_path_1 = require("@rigor789/resolve-package-path");
|
|
27
39
|
class PrepareController extends events_1.EventEmitter {
|
|
28
|
-
constructor($platformController, $hooksService, $fs, $logger, $mobileHelper, $nodeModulesDependenciesBuilder, $platformsDataService, $pluginsService, $prepareNativePlatformService, $projectChangesService, $projectDataService, $webpackCompilerService, $watchIgnoreListService, $analyticsService, $markingModeService, $projectConfigService, $projectService) {
|
|
40
|
+
constructor($platformController, $hooksService, $fs, $logger, $options, $mobileHelper, $nodeModulesDependenciesBuilder, $platformsDataService, $pluginsService, $prepareNativePlatformService, $projectChangesService, $projectDataService, $webpackCompilerService, $watchIgnoreListService, $analyticsService, $markingModeService, $projectConfigService, $projectService) {
|
|
29
41
|
super();
|
|
30
42
|
this.$platformController = $platformController;
|
|
31
43
|
this.$hooksService = $hooksService;
|
|
32
44
|
this.$fs = $fs;
|
|
33
45
|
this.$logger = $logger;
|
|
46
|
+
this.$options = $options;
|
|
34
47
|
this.$mobileHelper = $mobileHelper;
|
|
35
48
|
this.$nodeModulesDependenciesBuilder = $nodeModulesDependenciesBuilder;
|
|
36
49
|
this.$platformsDataService = $platformsDataService;
|
|
@@ -248,32 +261,66 @@ class PrepareController extends events_1.EventEmitter {
|
|
|
248
261
|
});
|
|
249
262
|
}
|
|
250
263
|
writeRuntimePackageJson(projectData, platformData) {
|
|
264
|
+
var _a, _b;
|
|
251
265
|
return __awaiter(this, void 0, void 0, function* () {
|
|
252
266
|
const configInfo = this.$projectConfigService.detectProjectConfigs(projectData.projectDir);
|
|
253
267
|
if (configInfo.usingNSConfig) {
|
|
254
268
|
return;
|
|
255
269
|
}
|
|
256
270
|
this.$logger.info("Updating runtime package.json with configuration values...");
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
271
|
+
const _c = this.$projectConfigService.readConfig(projectData.projectDir), { hooks, ignoredNativeDependencies, webpackPackageName, webpackConfigPath, appResourcesPath, buildPath, appPath } = _c, nsConfig = __rest(_c, ["hooks", "ignoredNativeDependencies", "webpackPackageName", "webpackConfigPath", "appResourcesPath", "buildPath", "appPath"]);
|
|
272
|
+
const platform = platformData.platformNameLowerCase;
|
|
273
|
+
let installedRuntimePackageJSON;
|
|
274
|
+
let runtimePackageName;
|
|
275
|
+
if (platform === "ios") {
|
|
276
|
+
runtimePackageName = ((_a = projectData.nsConfig.ios) === null || _a === void 0 ? void 0 : _a.runtimePackageName) || constants_1.SCOPED_IOS_RUNTIME_NAME;
|
|
277
|
+
}
|
|
278
|
+
else if (platform === "android") {
|
|
279
|
+
runtimePackageName = ((_b = projectData.nsConfig.android) === null || _b === void 0 ? void 0 : _b.runtimePackageName) || constants_1.SCOPED_ANDROID_RUNTIME_NAME;
|
|
280
|
+
}
|
|
281
|
+
const installedRuntimePackageJSONPath = (0, resolve_package_path_1.resolvePackageJSONPath)(runtimePackageName, {
|
|
282
|
+
paths: [projectData.projectDir],
|
|
283
|
+
});
|
|
284
|
+
if (installedRuntimePackageJSONPath) {
|
|
285
|
+
installedRuntimePackageJSON = this.$fs.readJson(installedRuntimePackageJSONPath);
|
|
264
286
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
packageData.
|
|
287
|
+
const packageData = Object.assign(Object.assign(Object.assign(Object.assign({}, _.pick(projectData.packageJsonData, ["name"])), nsConfig), { main: "bundle" }), (installedRuntimePackageJSON ? {} : {}));
|
|
288
|
+
if (platform === "ios") {
|
|
289
|
+
if (installedRuntimePackageJSON) {
|
|
290
|
+
packageData.ios = packageData.ios || {};
|
|
291
|
+
packageData.ios.runtime = {
|
|
292
|
+
version: installedRuntimePackageJSON.version
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
if (packageData.ios &&
|
|
296
|
+
packageData.ios.discardUncaughtJsExceptions) {
|
|
297
|
+
packageData.discardUncaughtJsExceptions =
|
|
298
|
+
packageData.ios.discardUncaughtJsExceptions;
|
|
299
|
+
}
|
|
300
|
+
delete packageData.android;
|
|
301
|
+
}
|
|
302
|
+
if (platform === "android") {
|
|
303
|
+
if (installedRuntimePackageJSON) {
|
|
304
|
+
packageData.android = packageData.android || {};
|
|
305
|
+
packageData.android.runtime = {
|
|
306
|
+
version: installedRuntimePackageJSON.version,
|
|
307
|
+
version_info: installedRuntimePackageJSON.version_info,
|
|
308
|
+
gradle: installedRuntimePackageJSON.gradle
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
if (packageData.android &&
|
|
312
|
+
packageData.android.discardUncaughtJsExceptions) {
|
|
313
|
+
packageData.discardUncaughtJsExceptions =
|
|
314
|
+
packageData.android.discardUncaughtJsExceptions;
|
|
315
|
+
}
|
|
316
|
+
delete packageData.ios;
|
|
270
317
|
}
|
|
271
318
|
let packagePath;
|
|
272
319
|
if (this.$mobileHelper.isApplePlatform(platformData.platformNameLowerCase)) {
|
|
273
320
|
packagePath = path.join(platformData.projectRoot, projectData.projectName, "app", "package.json");
|
|
274
321
|
}
|
|
275
322
|
else {
|
|
276
|
-
packagePath = path.join(platformData.projectRoot,
|
|
323
|
+
packagePath = path.join(platformData.projectRoot, this.$options.hostProjectModuleName, "src", this.$options.hostProjectPath ? "nativescript" : "main", "assets", "app", "package.json");
|
|
277
324
|
}
|
|
278
325
|
try {
|
|
279
326
|
const emittedPackageData = this.$fs.readJson(packagePath);
|
package/lib/data/build-data.js
CHANGED
|
@@ -24,6 +24,7 @@ class IOSBuildData extends BuildData {
|
|
|
24
24
|
this.mobileProvisionData = data.mobileProvisionData;
|
|
25
25
|
this.buildForAppStore = data.buildForAppStore;
|
|
26
26
|
this.iCloudContainerEnvironment = data.iCloudContainerEnvironment;
|
|
27
|
+
this.hostProjectPath = data.hostProjectPath;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
exports.IOSBuildData = IOSBuildData;
|
|
@@ -39,6 +40,7 @@ class AndroidBuildData extends BuildData {
|
|
|
39
40
|
this.gradleFlavor = data.gradleFlavor;
|
|
40
41
|
this.gradlePath = data.gradlePath;
|
|
41
42
|
this.gradleArgs = data.gradleArgs;
|
|
43
|
+
this.hostProjectPath = data.hostProjectPath;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
exports.AndroidBuildData = AndroidBuildData;
|
package/lib/data/prepare-data.js
CHANGED
package/lib/declarations.d.ts
CHANGED
|
@@ -578,14 +578,20 @@ interface IAndroidBundleOptions {
|
|
|
578
578
|
aab: boolean;
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
interface
|
|
582
|
-
|
|
583
|
-
|
|
581
|
+
interface IEmbedOptions {
|
|
582
|
+
hostProjectPath: string;
|
|
583
|
+
hostProjectModuleName: string;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
interface IAndroidOptions extends IEmbedOptions {
|
|
584
587
|
gradlePath: string;
|
|
588
|
+
gradleFlavor: string;
|
|
585
589
|
gradleArgs: string[];
|
|
586
590
|
overrideRuntimeGradleFiles: boolean;
|
|
587
591
|
}
|
|
588
592
|
|
|
593
|
+
interface IIOSOptions extends IEmbedOptions {}
|
|
594
|
+
|
|
589
595
|
interface ITypingsOptions {
|
|
590
596
|
jar: string;
|
|
591
597
|
aar: string;
|
|
@@ -606,6 +612,7 @@ interface IOptions
|
|
|
606
612
|
IProvision,
|
|
607
613
|
ITeamIdentifier,
|
|
608
614
|
IAndroidOptions,
|
|
615
|
+
IIOSOptions,
|
|
609
616
|
IAndroidReleaseOptions,
|
|
610
617
|
IAndroidBundleOptions,
|
|
611
618
|
INpmInstallConfigurationOptions,
|
|
@@ -704,6 +711,9 @@ interface IOptions
|
|
|
704
711
|
dryRun: boolean;
|
|
705
712
|
|
|
706
713
|
platformOverride: string;
|
|
714
|
+
|
|
715
|
+
// allow arbitrary options
|
|
716
|
+
[optionName: string]: any;
|
|
707
717
|
}
|
|
708
718
|
|
|
709
719
|
interface IEnvOptions {
|
|
@@ -1012,6 +1022,7 @@ interface IXcprojService {
|
|
|
1012
1022
|
* @return {string} The full path to the xcodeproj
|
|
1013
1023
|
*/
|
|
1014
1024
|
getXcodeprojPath(projectData: IProjectData, projectRoot: string): string;
|
|
1025
|
+
findXcodeProject(dir: string): string;
|
|
1015
1026
|
}
|
|
1016
1027
|
|
|
1017
1028
|
/**
|
|
@@ -104,6 +104,7 @@ interface INsConfigPlaform {
|
|
|
104
104
|
interface INsConfigIOS extends INsConfigPlaform {
|
|
105
105
|
discardUncaughtJsExceptions?: boolean;
|
|
106
106
|
runtimePackageName?: string
|
|
107
|
+
cocoapodUseBundleExec?: boolean
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
interface INSConfigVisionOS extends INsConfigIOS {}
|
|
@@ -147,6 +148,8 @@ interface INsConfigAndroid extends INsConfigPlaform {
|
|
|
147
148
|
|
|
148
149
|
gradleArgs?: string[];
|
|
149
150
|
|
|
151
|
+
plugins?:{ [k:string]: { aarSuffix?: string } }
|
|
152
|
+
|
|
150
153
|
runtimePackageName?: string
|
|
151
154
|
}
|
|
152
155
|
|
|
@@ -170,6 +173,7 @@ interface INsConfig {
|
|
|
170
173
|
visionos?: INSConfigVisionOS;
|
|
171
174
|
ignoredNativeDependencies?: string[];
|
|
172
175
|
hooks?: INsConfigHooks[];
|
|
176
|
+
projectName?: string;
|
|
173
177
|
}
|
|
174
178
|
|
|
175
179
|
interface IProjectData extends ICreateProjectData {
|
|
@@ -204,6 +208,7 @@ interface IProjectData extends ICreateProjectData {
|
|
|
204
208
|
* The value can be changed by setting `webpackConfigPath` in nativescript.config.
|
|
205
209
|
*/
|
|
206
210
|
webpackConfigPath: string;
|
|
211
|
+
projectName: string;
|
|
207
212
|
|
|
208
213
|
/**
|
|
209
214
|
* Initializes project data with the given project directory. If none supplied defaults to --path option or cwd.
|
|
@@ -16,11 +16,12 @@ const _ = require("lodash");
|
|
|
16
16
|
const constants = require("../constants");
|
|
17
17
|
const yok_1 = require("../common/yok");
|
|
18
18
|
class PlatformCommandHelper {
|
|
19
|
-
constructor($platformController, $fs, $errors, $logger, $mobileHelper, $packageInstallationManager, $pacoteService, $platformsDataService, $platformValidationService, $projectChangesService, $projectDataService, $tempService) {
|
|
19
|
+
constructor($platformController, $fs, $errors, $logger, $options, $mobileHelper, $packageInstallationManager, $pacoteService, $platformsDataService, $platformValidationService, $projectChangesService, $projectDataService, $tempService) {
|
|
20
20
|
this.$platformController = $platformController;
|
|
21
21
|
this.$fs = $fs;
|
|
22
22
|
this.$errors = $errors;
|
|
23
23
|
this.$logger = $logger;
|
|
24
|
+
this.$options = $options;
|
|
24
25
|
this.$mobileHelper = $mobileHelper;
|
|
25
26
|
this.$packageInstallationManager = $packageInstallationManager;
|
|
26
27
|
this.$pacoteService = $pacoteService;
|
|
@@ -32,6 +33,10 @@ class PlatformCommandHelper {
|
|
|
32
33
|
}
|
|
33
34
|
addPlatforms(platforms, projectData, frameworkPath) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
if (this.$options.hostProjectPath) {
|
|
37
|
+
this.$logger.info("Ignoring platform add becuase of --hostProjectPath flag");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
35
40
|
const platformsDir = projectData.platformsDir;
|
|
36
41
|
this.$fs.ensureDirectoryExists(platformsDir);
|
|
37
42
|
for (const platform of platforms) {
|
|
@@ -61,6 +66,10 @@ class PlatformCommandHelper {
|
|
|
61
66
|
}
|
|
62
67
|
removePlatforms(platforms, projectData) {
|
|
63
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
if (this.$options.hostProjectPath) {
|
|
70
|
+
this.$logger.info("Ignoring platform remove becuase of --native-host flag");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
64
73
|
for (const platform of platforms) {
|
|
65
74
|
this.$platformValidationService.validatePlatformInstalled(platform, projectData);
|
|
66
75
|
const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
package/lib/options.js
CHANGED
|
@@ -15,6 +15,7 @@ const yargs = require("yargs");
|
|
|
15
15
|
const helpers_1 = require("yargs/helpers");
|
|
16
16
|
const _ = require("lodash");
|
|
17
17
|
const yok_1 = require("./common/yok");
|
|
18
|
+
const constants_1 = require("./constants");
|
|
18
19
|
class Options {
|
|
19
20
|
setupOptions(commandSpecificDashedOptions) {
|
|
20
21
|
if (commandSpecificDashedOptions) {
|
|
@@ -205,13 +206,19 @@ class Options {
|
|
|
205
206
|
hasSensitiveValue: false,
|
|
206
207
|
},
|
|
207
208
|
overrideRuntimeGradleFiles: { type: "boolean", hasSensitiveValue: false },
|
|
209
|
+
gradleFlavor: { type: "string", hasSensitiveValue: false },
|
|
210
|
+
gradlePath: { type: "string", hasSensitiveValue: false },
|
|
208
211
|
gradleArgs: {
|
|
209
212
|
type: "string",
|
|
210
213
|
hasSensitiveValue: false,
|
|
211
214
|
array: true,
|
|
212
215
|
},
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
hostProjectPath: { type: "string", hasSensitiveValue: false },
|
|
217
|
+
hostProjectModuleName: {
|
|
218
|
+
type: "string",
|
|
219
|
+
hasSensitiveValue: false,
|
|
220
|
+
default: constants_1.APP_FOLDER_NAME,
|
|
221
|
+
},
|
|
215
222
|
aab: { type: "boolean", hasSensitiveValue: false },
|
|
216
223
|
filterDevicesArch: { type: "boolean", hasSensitiveValue: false },
|
|
217
224
|
performance: { type: "object", hasSensitiveValue: true },
|
package/lib/project-data.js
CHANGED
|
@@ -70,7 +70,10 @@ class ProjectData {
|
|
|
70
70
|
`Additional technical info: ${err.toString()}`);
|
|
71
71
|
}
|
|
72
72
|
if (packageJsonData) {
|
|
73
|
-
this.projectName =
|
|
73
|
+
this.projectName =
|
|
74
|
+
nsConfig && nsConfig.projectName
|
|
75
|
+
? nsConfig.projectName
|
|
76
|
+
: this.$projectHelper.sanitizeName(path.basename(projectDir));
|
|
74
77
|
this.nsConfig = nsConfig;
|
|
75
78
|
this.platformsDir = path.join(projectDir, this.getBuildRelativeDirectoryPath());
|
|
76
79
|
this.projectFilePath = projectFilePath;
|
|
@@ -23,7 +23,7 @@ class ProjectFilesProvider extends project_files_provider_base_1.ProjectFilesPro
|
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
relativePath = path.relative(projectData.appDirectoryPath, parsedFilePath);
|
|
26
|
-
mappedFilePath = path.join(platformData.appDestinationDirectoryPath,
|
|
26
|
+
mappedFilePath = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, relativePath);
|
|
27
27
|
}
|
|
28
28
|
const appResourcesDirectoryPath = projectData.appResourcesDirectoryPath;
|
|
29
29
|
const platformSpecificAppResourcesDirectoryPath = path.join(appResourcesDirectoryPath, platformData.normalizedPlatformName);
|
|
@@ -46,10 +46,11 @@ class GradleBuildArgsService {
|
|
|
46
46
|
projectDir: buildData.projectDir,
|
|
47
47
|
});
|
|
48
48
|
this.$projectData.initializeProjectData(buildData.projectDir);
|
|
49
|
-
args.push(`--stacktrace`, `-PcompileSdk
|
|
50
|
-
|
|
49
|
+
args.push(`--stacktrace`, `-PcompileSdk=${toolsInfo.compileSdkVersion}`, `-PtargetSdk=${toolsInfo.targetSdkVersion}`, `-PbuildToolsVersion=${toolsInfo.buildToolsVersion}`, `-PgenerateTypings=${toolsInfo.generateTypings}`, `-PprojectRoot=${this.$projectData.projectDir}`, `-DprojectRoot=${this.$projectData.projectDir}`, `-PappPath=${this.$projectData.getAppDirectoryPath()}`, `-PappBuildPath=${this.$projectData.getBuildRelativeDirectoryPath()}`, `-DappBuildPath=${this.$projectData.getBuildRelativeDirectoryPath()}`, `-PappPath=${this.$projectData.getAppDirectoryPath()}`, `-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`);
|
|
50
|
+
const gradleArgs = (this.$projectData.nsConfig.android.gradleArgs || []).concat(buildData.gradleArgs || []);
|
|
51
|
+
if (gradleArgs) {
|
|
51
52
|
const additionalArgs = [];
|
|
52
|
-
|
|
53
|
+
gradleArgs.forEach((arg) => {
|
|
53
54
|
additionalArgs.push(...arg.split(" ").map((a) => a.trim()));
|
|
54
55
|
});
|
|
55
56
|
args.push(...additionalArgs);
|
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GradleCommandService = void 0;
|
|
13
13
|
const yok_1 = require("../../common/yok");
|
|
14
|
+
const helpers_1 = require("../../common/helpers");
|
|
14
15
|
class GradleCommandService {
|
|
15
16
|
constructor($childProcess, $errors, $hostInfo, $logger) {
|
|
16
17
|
this.$childProcess = $childProcess;
|
|
@@ -29,7 +30,10 @@ class GradleCommandService {
|
|
|
29
30
|
shell: this.$hostInfo.isWindows,
|
|
30
31
|
};
|
|
31
32
|
const gradleExecutable = (_a = options.gradlePath) !== null && _a !== void 0 ? _a : (this.$hostInfo.isWindows ? "gradlew.bat" : "./gradlew");
|
|
32
|
-
const
|
|
33
|
+
const sanitizedGradleArgs = this.$hostInfo.isWindows
|
|
34
|
+
? gradleArgs.map((arg) => (0, helpers_1.quoteString)(arg))
|
|
35
|
+
: gradleArgs;
|
|
36
|
+
const result = yield this.executeCommandSafe(gradleExecutable, sanitizedGradleArgs, childProcessOptions, spawnOptions);
|
|
33
37
|
return result;
|
|
34
38
|
});
|
|
35
39
|
}
|