nativescript 8.8.0-embed.0 → 8.8.0-embed.1
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/lib/.d.ts +1 -0
- package/lib/bootstrap.js +1 -0
- package/lib/commands/add-platform.js +1 -1
- package/lib/commands/embedding/embed.js +84 -0
- package/lib/commands/prepare.js +9 -0
- package/lib/common/mobile/android/logcat-helper.js +15 -6
- package/lib/controllers/platform-controller.js +6 -1
- package/lib/controllers/prepare-controller.js +2 -4
- package/lib/data/build-data.js +2 -2
- package/lib/data/prepare-data.js +1 -1
- package/lib/declarations.d.ts +6 -4
- package/lib/definitions/platform.d.ts +1 -1
- package/lib/definitions/prepare.d.ts +3 -0
- package/lib/definitions/project.d.ts +2 -0
- package/lib/helpers/platform-command-helper.js +5 -8
- package/lib/options.js +2 -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 +2 -6
- package/lib/services/android-plugin-build-service.js +14 -17
- package/lib/services/android-project-service.js +15 -15
- package/lib/services/assets-generation/assets-generation-service.js +1 -4
- package/lib/services/files-hash-service.js +1 -1
- package/lib/services/ios-project-service.js +9 -9
- package/lib/services/livesync/android-device-livesync-sockets-service.js +1 -1
- package/lib/services/livesync/platform-livesync-service-base.js +2 -2
- package/lib/services/log-source-map-service.js +1 -1
- package/lib/services/platform/add-platform-service.js +2 -3
- package/lib/services/platform/prepare-native-platform-service.js +2 -2
- package/lib/services/plugins-service.js +3 -3
- package/lib/services/project-changes-service.js +2 -2
- package/lib/services/project-config-service.js +1 -1
- package/lib/services/webpack/webpack-compiler-service.js +8 -8
- package/package.json +1 -1
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +21 -15
- package/vendor/gradle-plugin/settings.gradle +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"@jsdevtools/coverage-istanbul-loader":"3.0.5","karma":"6.4.3","karma-coverage":"2.2.1","karma-nativescript-launcher":"0.4.0","mocha":"10.
|
|
1
|
+
{"@jsdevtools/coverage-istanbul-loader":"3.0.5","karma":"6.4.3","karma-coverage":"2.2.1","karma-nativescript-launcher":"0.4.0","mocha":"10.5.2","karma-mocha":"2.0.1","karma-chai":"0.1.0","karma-jasmine":"4.0.2","karma-qunit":"4.2.0","@types/karma-chai":"0.1.6","@types/mocha":"10.0.7","@types/jasmine":"5.1.4","@types/qunit":"2.19.10","nyc":"17.0.0"}
|
package/lib/.d.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
/// <reference path="commands/create-project.ts" />
|
|
16
16
|
/// <reference path="commands/debug.ts" />
|
|
17
17
|
/// <reference path="commands/deploy.ts" />
|
|
18
|
+
/// <reference path="commands/embedding/embed.ts" />
|
|
18
19
|
/// <reference path="commands/extensibility/install-extension.ts" />
|
|
19
20
|
/// <reference path="commands/extensibility/list-extensions.ts" />
|
|
20
21
|
/// <reference path="commands/extensibility/uninstall-extension.ts" />
|
package/lib/bootstrap.js
CHANGED
|
@@ -93,6 +93,7 @@ yok_1.injector.requireCommand("build|android", "./commands/build");
|
|
|
93
93
|
yok_1.injector.requireCommand("build|vision", "./commands/build");
|
|
94
94
|
yok_1.injector.requireCommand("build|visionos", "./commands/build");
|
|
95
95
|
yok_1.injector.requireCommand("deploy", "./commands/deploy");
|
|
96
|
+
yok_1.injector.requireCommand("embed", "./commands/embedding/embed");
|
|
96
97
|
yok_1.injector.require("testExecutionService", "./services/test-execution-service");
|
|
97
98
|
yok_1.injector.requireCommand("dev-test|android", "./commands/test");
|
|
98
99
|
yok_1.injector.requireCommand("dev-test|ios", "./commands/test");
|
|
@@ -22,7 +22,7 @@ class AddPlatformCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
22
22
|
}
|
|
23
23
|
execute(args) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
yield this.$platformCommandHelper.addPlatforms(args, this.$projectData, this.$options.frameworkPath
|
|
25
|
+
yield this.$platformCommandHelper.addPlatforms(args, this.$projectData, this.$options.frameworkPath);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
canExecute(args) {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EmbedCommand = void 0;
|
|
13
|
+
const yok_1 = require("../../common/yok");
|
|
14
|
+
const prepare_1 = require("../prepare");
|
|
15
|
+
const path_1 = require("path");
|
|
16
|
+
const color_1 = require("../../color");
|
|
17
|
+
class EmbedCommand extends prepare_1.PrepareCommand {
|
|
18
|
+
constructor($options, $prepareController, $platformValidationService, $projectData, $platformCommandParameter, $platformsDataService, $prepareDataService, $migrateController, $logger, $fs, $projectConfigService) {
|
|
19
|
+
super($options, $prepareController, $platformValidationService, $projectData, $platformCommandParameter, $platformsDataService, $prepareDataService, $migrateController);
|
|
20
|
+
this.$options = $options;
|
|
21
|
+
this.$prepareController = $prepareController;
|
|
22
|
+
this.$platformValidationService = $platformValidationService;
|
|
23
|
+
this.$projectData = $projectData;
|
|
24
|
+
this.$platformCommandParameter = $platformCommandParameter;
|
|
25
|
+
this.$platformsDataService = $platformsDataService;
|
|
26
|
+
this.$prepareDataService = $prepareDataService;
|
|
27
|
+
this.$migrateController = $migrateController;
|
|
28
|
+
this.$logger = $logger;
|
|
29
|
+
this.$fs = $fs;
|
|
30
|
+
this.$projectConfigService = $projectConfigService;
|
|
31
|
+
}
|
|
32
|
+
execute(args) {
|
|
33
|
+
const _super = Object.create(null, {
|
|
34
|
+
execute: { get: () => super.execute }
|
|
35
|
+
});
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const hostProjectPath = args[1];
|
|
38
|
+
const resolvedHostProjectPath = (0, path_1.resolve)(hostProjectPath);
|
|
39
|
+
if (!this.$fs.exists(resolvedHostProjectPath)) {
|
|
40
|
+
this.$logger.error(`The host project path ${color_1.color.yellow(hostProjectPath)} (resolved to: ${color_1.color.yellow.dim(resolvedHostProjectPath)}) does not exist.`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.$options["hostProjectPath"] = resolvedHostProjectPath;
|
|
44
|
+
if (args.length > 2) {
|
|
45
|
+
this.$options["hostProjectModuleName"] = args[2];
|
|
46
|
+
}
|
|
47
|
+
return _super.execute.call(this, args);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
canExecute(args) {
|
|
51
|
+
const _super = Object.create(null, {
|
|
52
|
+
canExecute: { get: () => super.canExecute }
|
|
53
|
+
});
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const canSuperExecute = yield _super.canExecute.call(this, args);
|
|
56
|
+
if (!canSuperExecute) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const platform = args[0].toLowerCase();
|
|
60
|
+
if (!args[1]) {
|
|
61
|
+
const hostProjectPath = this.getEmbedConfigForKey("hostProjectPath", platform);
|
|
62
|
+
if (hostProjectPath) {
|
|
63
|
+
args[1] = hostProjectPath;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (!args[2]) {
|
|
67
|
+
const hostProjectModuleName = this.getEmbedConfigForKey("hostProjectModuleName", platform);
|
|
68
|
+
if (hostProjectModuleName) {
|
|
69
|
+
args[2] = hostProjectModuleName;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
console.log(args);
|
|
73
|
+
if (args.length < 2) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
getEmbedConfigForKey(key, platform) {
|
|
80
|
+
return this.$projectConfigService.getValue(`embed.${platform}.${key}`, this.$projectConfigService.getValue(`embed.${key}`));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.EmbedCommand = EmbedCommand;
|
|
84
|
+
yok_1.injector.registerCommand("embed", EmbedCommand);
|
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
|
}
|
|
@@ -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
|
}
|
|
@@ -70,6 +70,10 @@ class PlatformController {
|
|
|
70
70
|
}
|
|
71
71
|
addPlatformIfNeeded(addPlatformData, projectData) {
|
|
72
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
if (addPlatformData.hostProjectPath) {
|
|
74
|
+
this.$logger.trace("Not adding platform because --hostProjectPath is provided.");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
73
77
|
const [platform] = addPlatformData.platform.toLowerCase().split("@");
|
|
74
78
|
projectData !== null && projectData !== void 0 ? projectData : (projectData = this.$projectDataService.getProjectData(addPlatformData.projectDir));
|
|
75
79
|
const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
@@ -94,7 +98,8 @@ class PlatformController {
|
|
|
94
98
|
desiredRuntimePackage.version = version;
|
|
95
99
|
}
|
|
96
100
|
if (!desiredRuntimePackage.version) {
|
|
97
|
-
desiredRuntimePackage.version =
|
|
101
|
+
desiredRuntimePackage.version =
|
|
102
|
+
yield this.$packageInstallationManager.getLatestCompatibleVersion(desiredRuntimePackage.name);
|
|
98
103
|
}
|
|
99
104
|
result = `${desiredRuntimePackage.name}@${desiredRuntimePackage.version}`;
|
|
100
105
|
}
|
|
@@ -87,9 +87,7 @@ class PrepareController extends events_1.EventEmitter {
|
|
|
87
87
|
prepareCore(prepareData, projectData) {
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
89
|
yield this.$projectService.ensureAppResourcesExist(projectData.projectDir);
|
|
90
|
-
|
|
91
|
-
yield this.$platformController.addPlatformIfNeeded(prepareData, projectData);
|
|
92
|
-
}
|
|
90
|
+
yield this.$platformController.addPlatformIfNeeded(prepareData, projectData);
|
|
93
91
|
yield this.trackRuntimeVersion(prepareData.platform, projectData);
|
|
94
92
|
this.$logger.info("Preparing project...");
|
|
95
93
|
prepareData.env = prepareData.env || {};
|
|
@@ -275,7 +273,7 @@ class PrepareController extends events_1.EventEmitter {
|
|
|
275
273
|
packagePath = path.join(platformData.projectRoot, projectData.projectName, "app", "package.json");
|
|
276
274
|
}
|
|
277
275
|
else {
|
|
278
|
-
packagePath = path.join(platformData.projectRoot, this.$options.
|
|
276
|
+
packagePath = path.join(platformData.projectRoot, this.$options.hostProjectModuleName, "src", this.$options.hostProjectPath ? "nativescript" : "main", "assets", "app", "package.json");
|
|
279
277
|
}
|
|
280
278
|
try {
|
|
281
279
|
const emittedPackageData = this.$fs.readJson(packagePath);
|
package/lib/data/build-data.js
CHANGED
|
@@ -24,7 +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.
|
|
27
|
+
this.hostProjectPath = data.hostProjectPath;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.IOSBuildData = IOSBuildData;
|
|
@@ -38,7 +38,7 @@ class AndroidBuildData extends BuildData {
|
|
|
38
38
|
this.androidBundle = data.androidBundle || data.aab;
|
|
39
39
|
this.gradlePath = data.gradlePath;
|
|
40
40
|
this.gradleArgs = data.gradleArgs;
|
|
41
|
-
this.
|
|
41
|
+
this.hostProjectPath = data.hostProjectPath;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.AndroidBuildData = AndroidBuildData;
|
package/lib/data/prepare-data.js
CHANGED
|
@@ -29,7 +29,7 @@ class PrepareData extends controller_data_base_1.ControllerDataBase {
|
|
|
29
29
|
if (_.isBoolean(data.watchNative)) {
|
|
30
30
|
this.watchNative = data.watchNative;
|
|
31
31
|
}
|
|
32
|
-
this.
|
|
32
|
+
this.hostProjectPath = data.hostProjectPath;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.PrepareData = PrepareData;
|
package/lib/declarations.d.ts
CHANGED
|
@@ -579,8 +579,8 @@ interface IAndroidBundleOptions {
|
|
|
579
579
|
}
|
|
580
580
|
|
|
581
581
|
interface IEmbedOptions {
|
|
582
|
-
|
|
583
|
-
|
|
582
|
+
hostProjectPath: string;
|
|
583
|
+
hostProjectModuleName: string;
|
|
584
584
|
}
|
|
585
585
|
|
|
586
586
|
interface IAndroidOptions extends IEmbedOptions {
|
|
@@ -709,6 +709,9 @@ interface IOptions
|
|
|
709
709
|
dryRun: boolean;
|
|
710
710
|
|
|
711
711
|
platformOverride: string;
|
|
712
|
+
|
|
713
|
+
// allow arbitrary options
|
|
714
|
+
[optionName: string]: any;
|
|
712
715
|
}
|
|
713
716
|
|
|
714
717
|
interface IEnvOptions {
|
|
@@ -1225,8 +1228,7 @@ interface IPlatformCommandHelper {
|
|
|
1225
1228
|
addPlatforms(
|
|
1226
1229
|
platforms: string[],
|
|
1227
1230
|
projectData: IProjectData,
|
|
1228
|
-
frameworkPath?: string
|
|
1229
|
-
nativeHost?: string
|
|
1231
|
+
frameworkPath?: string
|
|
1230
1232
|
): Promise<void>;
|
|
1231
1233
|
cleanPlatforms(
|
|
1232
1234
|
platforms: string[],
|
|
@@ -161,6 +161,7 @@ interface INsConfig {
|
|
|
161
161
|
visionos?: INSConfigVisionOS;
|
|
162
162
|
ignoredNativeDependencies?: string[];
|
|
163
163
|
hooks?: INsConfigHooks[];
|
|
164
|
+
projectName?: string;
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
interface IProjectData extends ICreateProjectData {
|
|
@@ -195,6 +196,7 @@ interface IProjectData extends ICreateProjectData {
|
|
|
195
196
|
* The value can be changed by setting `webpackConfigPath` in nativescript.config.
|
|
196
197
|
*/
|
|
197
198
|
webpackConfigPath: string;
|
|
199
|
+
projectName: string;
|
|
198
200
|
|
|
199
201
|
/**
|
|
200
202
|
* Initializes project data with the given project directory. If none supplied defaults to --path option or cwd.
|
|
@@ -31,10 +31,10 @@ class PlatformCommandHelper {
|
|
|
31
31
|
this.$projectDataService = $projectDataService;
|
|
32
32
|
this.$tempService = $tempService;
|
|
33
33
|
}
|
|
34
|
-
addPlatforms(platforms, projectData, frameworkPath
|
|
34
|
+
addPlatforms(platforms, projectData, frameworkPath) {
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
if (this.$options.
|
|
37
|
-
this.$logger.info("Ignoring platform add becuase of --
|
|
36
|
+
if (this.$options.hostProjectPath) {
|
|
37
|
+
this.$logger.info("Ignoring platform add becuase of --hostProjectPath flag");
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
const platformsDir = projectData.platformsDir;
|
|
@@ -50,7 +50,6 @@ class PlatformCommandHelper {
|
|
|
50
50
|
projectDir: projectData.projectDir,
|
|
51
51
|
platform,
|
|
52
52
|
frameworkPath,
|
|
53
|
-
nativeHost,
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
55
|
});
|
|
@@ -67,7 +66,7 @@ class PlatformCommandHelper {
|
|
|
67
66
|
}
|
|
68
67
|
removePlatforms(platforms, projectData) {
|
|
69
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
if (this.$options.
|
|
69
|
+
if (this.$options.hostProjectPath) {
|
|
71
70
|
this.$logger.info("Ignoring platform remove becuase of --native-host flag");
|
|
72
71
|
return;
|
|
73
72
|
}
|
|
@@ -82,9 +81,7 @@ class PlatformCommandHelper {
|
|
|
82
81
|
errorMessage = err.message;
|
|
83
82
|
}
|
|
84
83
|
try {
|
|
85
|
-
const platformDir =
|
|
86
|
-
? this.$options.nativeHost
|
|
87
|
-
: path.join(projectData.platformsDir, platform.toLowerCase());
|
|
84
|
+
const platformDir = path.join(projectData.platformsDir, platform.toLowerCase());
|
|
88
85
|
this.$fs.deleteDirectory(platformDir);
|
|
89
86
|
yield this.$packageInstallationManager.uninstall(platformData.frameworkPackageName, projectData.projectDir);
|
|
90
87
|
this.$logger.info(`Platform ${platform} successfully removed.`);
|
package/lib/options.js
CHANGED
|
@@ -207,8 +207,8 @@ class Options {
|
|
|
207
207
|
},
|
|
208
208
|
gradlePath: { type: "string", hasSensitiveValue: false },
|
|
209
209
|
gradleArgs: { type: "string", hasSensitiveValue: false },
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
hostProjectPath: { type: "string", hasSensitiveValue: false },
|
|
211
|
+
hostProjectModuleName: {
|
|
212
212
|
type: "string",
|
|
213
213
|
hasSensitiveValue: false,
|
|
214
214
|
default: constants_1.APP_FOLDER_NAME,
|
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.platformsDir = path.join(projectDir, constants.PLATFORMS_DIR_NAME);
|
|
75
78
|
this.projectFilePath = projectFilePath;
|
|
76
79
|
this.projectIdentifiers = this.initializeProjectIdentifiers(nsConfig);
|
|
@@ -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, this.$options.
|
|
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);
|
|
@@ -14,8 +14,7 @@ const path = require("path");
|
|
|
14
14
|
const constants_1 = require("../../common/constants");
|
|
15
15
|
const yok_1 = require("../../common/yok");
|
|
16
16
|
class GradleBuildArgsService {
|
|
17
|
-
constructor($
|
|
18
|
-
this.$androidToolsInfo = $androidToolsInfo;
|
|
17
|
+
constructor($hooksService, $analyticsService, $staticConfig, $projectData, $logger) {
|
|
19
18
|
this.$hooksService = $hooksService;
|
|
20
19
|
this.$analyticsService = $analyticsService;
|
|
21
20
|
this.$staticConfig = $staticConfig;
|
|
@@ -42,11 +41,8 @@ class GradleBuildArgsService {
|
|
|
42
41
|
}
|
|
43
42
|
getBaseTaskArgs(buildData) {
|
|
44
43
|
const args = this.getBuildLoggingArgs();
|
|
45
|
-
const toolsInfo = this.$androidToolsInfo.getToolsInfo({
|
|
46
|
-
projectDir: buildData.projectDir,
|
|
47
|
-
});
|
|
48
44
|
this.$projectData.initializeProjectData(buildData.projectDir);
|
|
49
|
-
args.push(`-
|
|
45
|
+
args.push(`-PappPath=${this.$projectData.getAppDirectoryPath()}`, `-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`);
|
|
50
46
|
if (buildData.gradleArgs) {
|
|
51
47
|
args.push(buildData.gradleArgs);
|
|
52
48
|
}
|
|
@@ -28,12 +28,11 @@ class AndroidPluginBuildService {
|
|
|
28
28
|
get $platformsDataService() {
|
|
29
29
|
return this.$injector.resolve("platformsDataService");
|
|
30
30
|
}
|
|
31
|
-
constructor($fs, $childProcess, $hostInfo, $options, $
|
|
31
|
+
constructor($fs, $childProcess, $hostInfo, $options, $logger, $packageManager, $projectData, $projectDataService, $devicePlatformsConstants, $errors, $filesHashService, $hooksService, $injector, $watchIgnoreListService) {
|
|
32
32
|
this.$fs = $fs;
|
|
33
33
|
this.$childProcess = $childProcess;
|
|
34
34
|
this.$hostInfo = $hostInfo;
|
|
35
35
|
this.$options = $options;
|
|
36
|
-
this.$androidToolsInfo = $androidToolsInfo;
|
|
37
36
|
this.$logger = $logger;
|
|
38
37
|
this.$packageManager = $packageManager;
|
|
39
38
|
this.$projectData = $projectData;
|
|
@@ -261,6 +260,17 @@ class AndroidPluginBuildService {
|
|
|
261
260
|
this.replaceGradleAndroidPluginVersion(buildGradlePath, runtimeGradleVersions.gradleAndroidPluginVersion);
|
|
262
261
|
this.replaceFileContent(buildGradlePath, "{{pluginName}}", pluginName);
|
|
263
262
|
this.replaceFileContent(settingsGradlePath, "{{pluginName}}", pluginName);
|
|
263
|
+
const shortPluginName = (0, helpers_1.getShortPluginName)(pluginName);
|
|
264
|
+
const manifestPath = path.join(pluginTempDir, "src", "main", "AndroidManifest.xml");
|
|
265
|
+
const manifestContent = this.$fs.readText(manifestPath);
|
|
266
|
+
let packageName = `org.nativescript.${shortPluginName}`;
|
|
267
|
+
const xml = yield this.getXml(manifestContent);
|
|
268
|
+
if (xml["manifest"]) {
|
|
269
|
+
if (xml["manifest"]["$"]["package"]) {
|
|
270
|
+
packageName = xml["manifest"]["$"]["package"];
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
this.replaceFileContent(buildGradlePath, "{{pluginNamespace}}", packageName);
|
|
264
274
|
});
|
|
265
275
|
}
|
|
266
276
|
getRuntimeGradleVersions(projectDir) {
|
|
@@ -445,25 +455,12 @@ class AndroidPluginBuildService {
|
|
|
445
455
|
buildPlugin(pluginBuildSettings) {
|
|
446
456
|
var _a;
|
|
447
457
|
return __awaiter(this, void 0, void 0, function* () {
|
|
448
|
-
if (!pluginBuildSettings.androidToolsInfo) {
|
|
449
|
-
this.$androidToolsInfo.validateInfo({
|
|
450
|
-
showWarningsAsErrors: true,
|
|
451
|
-
validateTargetSdk: true,
|
|
452
|
-
projectDir: pluginBuildSettings.projectDir,
|
|
453
|
-
});
|
|
454
|
-
pluginBuildSettings.androidToolsInfo =
|
|
455
|
-
this.$androidToolsInfo.getToolsInfo({
|
|
456
|
-
projectDir: pluginBuildSettings.projectDir,
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
458
|
const gradlew = (_a = pluginBuildSettings.gradlePath) !== null && _a !== void 0 ? _a : (this.$hostInfo.isWindows ? "gradlew.bat" : "./gradlew");
|
|
460
459
|
const localArgs = [
|
|
461
460
|
"-p",
|
|
462
461
|
pluginBuildSettings.pluginDir,
|
|
463
462
|
"assembleRelease",
|
|
464
463
|
`-PtempBuild=true`,
|
|
465
|
-
`-PcompileSdk=android-${pluginBuildSettings.androidToolsInfo.compileSdkVersion}`,
|
|
466
|
-
`-PbuildToolsVersion=${pluginBuildSettings.androidToolsInfo.buildToolsVersion}`,
|
|
467
464
|
`-PappPath=${this.$projectData.getAppDirectoryPath()}`,
|
|
468
465
|
`-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`,
|
|
469
466
|
];
|
|
@@ -478,8 +475,8 @@ class AndroidPluginBuildService {
|
|
|
478
475
|
stdio: "inherit",
|
|
479
476
|
shell: this.$hostInfo.isWindows,
|
|
480
477
|
};
|
|
481
|
-
if (this.$options.
|
|
482
|
-
opts.env = Object.assign({ USER_PROJECT_PLATFORMS_ANDROID: path.resolve((0, process_1.cwd)(), this.$options.
|
|
478
|
+
if (this.$options.hostProjectPath) {
|
|
479
|
+
opts.env = Object.assign({ USER_PROJECT_PLATFORMS_ANDROID: path.resolve((0, process_1.cwd)(), this.$options.hostProjectPath) }, process.env);
|
|
483
480
|
}
|
|
484
481
|
try {
|
|
485
482
|
yield this.$childProcess.spawnFromEvent(gradlew, localArgs, "close", opts);
|
|
@@ -69,26 +69,26 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
69
69
|
throw new Error("First call of getPlatformData without providing projectData.");
|
|
70
70
|
}
|
|
71
71
|
if (projectData && projectData.platformsDir) {
|
|
72
|
-
const projectRoot = this.$options.
|
|
73
|
-
? this.$options.
|
|
72
|
+
const projectRoot = this.$options.hostProjectPath
|
|
73
|
+
? this.$options.hostProjectPath
|
|
74
74
|
: path.join(projectData.platformsDir, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
75
75
|
const appDestinationDirectoryArr = [
|
|
76
76
|
projectRoot,
|
|
77
|
-
this.$options.
|
|
77
|
+
this.$options.hostProjectModuleName,
|
|
78
78
|
constants.SRC_DIR,
|
|
79
79
|
constants.MAIN_DIR,
|
|
80
80
|
constants.ASSETS_DIR,
|
|
81
81
|
];
|
|
82
82
|
const configurationsDirectoryArr = [
|
|
83
83
|
projectRoot,
|
|
84
|
-
this.$options.
|
|
84
|
+
this.$options.hostProjectModuleName,
|
|
85
85
|
constants.SRC_DIR,
|
|
86
86
|
constants.MAIN_DIR,
|
|
87
87
|
constants.MANIFEST_FILE_NAME,
|
|
88
88
|
];
|
|
89
89
|
const deviceBuildOutputArr = [
|
|
90
90
|
projectRoot,
|
|
91
|
-
this.$options.
|
|
91
|
+
this.$options.hostProjectModuleName,
|
|
92
92
|
constants.BUILD_DIR,
|
|
93
93
|
constants.OUTPUTS_DIR,
|
|
94
94
|
constants.APK_DIR,
|
|
@@ -104,7 +104,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
104
104
|
projectRoot: projectRoot,
|
|
105
105
|
getBuildOutputPath: (buildOptions) => {
|
|
106
106
|
if (buildOptions.androidBundle) {
|
|
107
|
-
return path.join(projectRoot, this.$options.
|
|
107
|
+
return path.join(projectRoot, this.$options.hostProjectModuleName, constants.BUILD_DIR, constants.OUTPUTS_DIR, constants.BUNDLE_DIR);
|
|
108
108
|
}
|
|
109
109
|
return path.join(...deviceBuildOutputArr);
|
|
110
110
|
},
|
|
@@ -115,8 +115,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
115
115
|
if (buildOptions.androidBundle) {
|
|
116
116
|
return {
|
|
117
117
|
packageNames: [
|
|
118
|
-
`${this.$options.
|
|
119
|
-
`${this.$options.
|
|
118
|
+
`${this.$options.hostProjectModuleName}${constants.AAB_EXTENSION_NAME}`,
|
|
119
|
+
`${this.$options.hostProjectModuleName}-${buildMode}${constants.AAB_EXTENSION_NAME}`,
|
|
120
120
|
],
|
|
121
121
|
};
|
|
122
122
|
}
|
|
@@ -125,10 +125,10 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
125
125
|
`${packageName}-${buildMode}${constants.APK_EXTENSION_NAME}`,
|
|
126
126
|
`${projectData.projectName}-${buildMode}${constants.APK_EXTENSION_NAME}`,
|
|
127
127
|
`${projectData.projectName}${constants.APK_EXTENSION_NAME}`,
|
|
128
|
-
`${this.$options.
|
|
128
|
+
`${this.$options.hostProjectModuleName}-${buildMode}${constants.APK_EXTENSION_NAME}`,
|
|
129
129
|
],
|
|
130
130
|
regexes: [
|
|
131
|
-
new RegExp(`(${packageName}|${this.$options.
|
|
131
|
+
new RegExp(`(${packageName}|${this.$options.hostProjectModuleName})-.*-(${constants_1.Configurations.Debug}|${constants_1.Configurations.Release})(-unsigned)?${constants.APK_EXTENSION_NAME}`, "i"),
|
|
132
132
|
],
|
|
133
133
|
};
|
|
134
134
|
},
|
|
@@ -291,7 +291,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
isPlatformPrepared(projectRoot, projectData) {
|
|
294
|
-
return this.$fs.exists(path.join(this.getPlatformData(projectData).appDestinationDirectoryPath, this.$options.
|
|
294
|
+
return this.$fs.exists(path.join(this.getPlatformData(projectData).appDestinationDirectoryPath, this.$options.hostProjectModuleName));
|
|
295
295
|
}
|
|
296
296
|
getFrameworkFilesExtensions() {
|
|
297
297
|
return [".jar", ".dat"];
|
|
@@ -392,8 +392,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
392
392
|
return _.values(depsDictionary);
|
|
393
393
|
}
|
|
394
394
|
provideDependenciesJson(projectData, dependencies) {
|
|
395
|
-
const platformDir = this.$options.
|
|
396
|
-
? this.$options.
|
|
395
|
+
const platformDir = this.$options.hostProjectPath
|
|
396
|
+
? this.$options.hostProjectPath
|
|
397
397
|
: path.join(projectData.platformsDir, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
398
398
|
const dependenciesJsonPath = path.join(platformDir, constants.DEPENDENCIES_JSON_NAME);
|
|
399
399
|
let nativeDependencyData = dependencies.filter(AndroidProjectService.isNativeAndroidDependency);
|
|
@@ -474,7 +474,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
474
474
|
}
|
|
475
475
|
getLegacyAppResourcesDestinationDirPath(projectData) {
|
|
476
476
|
const resourcePath = [
|
|
477
|
-
this.$options.
|
|
477
|
+
this.$options.hostProjectModuleName,
|
|
478
478
|
constants.SRC_DIR,
|
|
479
479
|
constants.MAIN_DIR,
|
|
480
480
|
constants.RESOURCES_DIR,
|
|
@@ -483,7 +483,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
483
483
|
}
|
|
484
484
|
getUpdatedAppResourcesDestinationDirPath(projectData) {
|
|
485
485
|
const resourcePath = [
|
|
486
|
-
this.$options.
|
|
486
|
+
this.$options.hostProjectModuleName,
|
|
487
487
|
constants.SRC_DIR,
|
|
488
488
|
];
|
|
489
489
|
return path.join(this.getPlatformData(projectData).projectRoot, ...resourcePath);
|
|
@@ -38,7 +38,7 @@ class AssetsGenerationService {
|
|
|
38
38
|
}
|
|
39
39
|
generateIcons(resourceGenerationData) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
if (this.$options.
|
|
41
|
+
if (this.$options.hostProjectPath) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
this.$logger.info("Generating icons ...");
|
|
@@ -48,9 +48,6 @@ class AssetsGenerationService {
|
|
|
48
48
|
}
|
|
49
49
|
generateSplashScreens(splashesGenerationData) {
|
|
50
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
if (this.$options.nativeHost) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
51
|
this.$logger.info("Generating splash screens ...");
|
|
55
52
|
yield this.generateImagesForDefinitions(splashesGenerationData, this.propertiesToEnumerate.splash);
|
|
56
53
|
this.$logger.info("Splash screens generation completed.");
|
|
@@ -42,7 +42,7 @@ class FilesHashService {
|
|
|
42
42
|
}
|
|
43
43
|
generateHashesForProject(platformData) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const appFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
45
|
+
const appFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName);
|
|
46
46
|
const files = this.$fs.enumerateFilesInDirectorySync(appFilesPath);
|
|
47
47
|
const hashes = yield this.generateHashes(files);
|
|
48
48
|
return hashes;
|
|
@@ -90,8 +90,8 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
90
90
|
projectData.platformsDir &&
|
|
91
91
|
this._platformsDirCache !== projectData.platformsDir) {
|
|
92
92
|
const platform = this.$mobileHelper.normalizePlatformName((_a = this.$options.platformOverride) !== null && _a !== void 0 ? _a : this.$devicePlatformsConstants.iOS);
|
|
93
|
-
const projectRoot = this.$options.
|
|
94
|
-
? this.$options.
|
|
93
|
+
const projectRoot = this.$options.hostProjectPath
|
|
94
|
+
? this.$options.hostProjectPath
|
|
95
95
|
: path.join(projectData.platformsDir, platform.toLowerCase());
|
|
96
96
|
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, platform.toLowerCase());
|
|
97
97
|
this._platformData = {
|
|
@@ -330,8 +330,8 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
330
330
|
}
|
|
331
331
|
prepareProject(projectData, prepareData) {
|
|
332
332
|
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
-
const projectRoot = this.$options.
|
|
334
|
-
? this.$options.
|
|
333
|
+
const projectRoot = this.$options.hostProjectPath
|
|
334
|
+
? this.$options.hostProjectPath
|
|
335
335
|
: path.join(projectData.platformsDir, this.$devicePlatformsConstants.iOS.toLowerCase());
|
|
336
336
|
const platformData = this.getPlatformData(projectData);
|
|
337
337
|
const pluginsData = this.getAllProductionPlugins(projectData);
|
|
@@ -349,16 +349,16 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
349
349
|
}
|
|
350
350
|
const project = this.createPbxProj(projectData);
|
|
351
351
|
const resources = project.pbxGroupByName("Resources");
|
|
352
|
-
if (this.$options.
|
|
352
|
+
if (this.$options.hostProjectPath) {
|
|
353
353
|
try {
|
|
354
|
-
project.addResourceFile(path.join(this.$options.
|
|
354
|
+
project.addResourceFile(path.join(this.$options.hostProjectPath, projectData.projectName));
|
|
355
355
|
this.savePbxProj(project, projectData);
|
|
356
356
|
}
|
|
357
357
|
catch (err) {
|
|
358
358
|
console.log(err);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
if (resources && !this.$options.
|
|
361
|
+
if (resources && !this.$options.hostProjectPath) {
|
|
362
362
|
const references = project.pbxFileReferenceSection();
|
|
363
363
|
const xcodeProjectImages = _.map(resources.children, (resource) => this.replace(references[resource.value].name));
|
|
364
364
|
this.$logger.trace("Images from Xcode project");
|
|
@@ -506,8 +506,8 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
506
506
|
return frameworkPath;
|
|
507
507
|
}
|
|
508
508
|
getPbxProjPath(projectData) {
|
|
509
|
-
if (this.$options.
|
|
510
|
-
let xcodeProjectPath = this.$xcprojService.findXcodeProject(this.$options.
|
|
509
|
+
if (this.$options.hostProjectPath) {
|
|
510
|
+
let xcodeProjectPath = this.$xcprojService.findXcodeProject(this.$options.hostProjectPath);
|
|
511
511
|
if (!xcodeProjectPath) {
|
|
512
512
|
this.$errors.fail("Xcode project not found at the specified directory");
|
|
513
513
|
}
|
|
@@ -180,7 +180,7 @@ class AndroidDeviceSocketsLiveSyncService extends android_device_livesync_servic
|
|
|
180
180
|
connectLivesyncTool(appIdentifier, connectTimeout) {
|
|
181
181
|
return __awaiter(this, void 0, void 0, function* () {
|
|
182
182
|
const platformData = this.platformsDataService.getPlatformData(this.$devicePlatformsConstants.Android, this.data);
|
|
183
|
-
const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
183
|
+
const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName);
|
|
184
184
|
if (!this.livesyncTool.hasConnection()) {
|
|
185
185
|
yield this.livesyncTool.connect({
|
|
186
186
|
appIdentifier,
|
|
@@ -82,7 +82,7 @@ class PlatformLiveSyncServiceBase {
|
|
|
82
82
|
if (deviceLiveSyncService.beforeLiveSyncAction) {
|
|
83
83
|
yield deviceLiveSyncService.beforeLiveSyncAction(deviceAppData);
|
|
84
84
|
}
|
|
85
|
-
const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
85
|
+
const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName);
|
|
86
86
|
const localToDevicePaths = yield this.$projectFilesManager.createLocalToDevicePaths(deviceAppData, projectFilesPath, null, []);
|
|
87
87
|
const modifiedFilesData = yield this.transferFiles(deviceAppData, localToDevicePaths, projectFilesPath, projectData, syncInfo.liveSyncDeviceData, { isFullSync: true, force: syncInfo.force });
|
|
88
88
|
return {
|
|
@@ -113,7 +113,7 @@ class PlatformLiveSyncServiceBase {
|
|
|
113
113
|
}
|
|
114
114
|
if (existingFiles.length) {
|
|
115
115
|
const platformData = this.$platformsDataService.getPlatformData(device.deviceInfo.platform, projectData);
|
|
116
|
-
const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
116
|
+
const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName);
|
|
117
117
|
const localToDevicePaths = yield this.$projectFilesManager.createLocalToDevicePaths(deviceAppData, projectFilesPath, existingFiles, []);
|
|
118
118
|
modifiedLocalToDevicePaths.push(...localToDevicePaths);
|
|
119
119
|
modifiedLocalToDevicePaths = yield this.transferFiles(deviceAppData, localToDevicePaths, projectFilesPath, projectData, liveSyncInfo.liveSyncDeviceData, { isFullSync: false, force: liveSyncInfo.force });
|
|
@@ -122,7 +122,7 @@ class LogSourceMapService {
|
|
|
122
122
|
return runtimeVersion;
|
|
123
123
|
}
|
|
124
124
|
getOriginalFileLocation(platform, parsedLine, projectData) {
|
|
125
|
-
const fileLocation = path.join(this.getFilesLocation(platform, projectData), this.$options.
|
|
125
|
+
const fileLocation = path.join(this.getFilesLocation(platform, projectData), this.$options.hostProjectModuleName);
|
|
126
126
|
if (parsedLine && parsedLine.filePath) {
|
|
127
127
|
const sourceMapFile = path.join(fileLocation, parsedLine.filePath);
|
|
128
128
|
const smc = this.cache[sourceMapFile];
|
|
@@ -98,10 +98,9 @@ class AddPlatformService {
|
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
100
|
addNativePlatform(platformData, projectData, frameworkDirPath, frameworkVersion) {
|
|
101
|
+
var _a;
|
|
101
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
const platformDir = this.$options.
|
|
103
|
-
? this.$options.nativeHost
|
|
104
|
-
: path.join(projectData.platformsDir, platformData.normalizedPlatformName.toLowerCase());
|
|
103
|
+
const platformDir = (_a = this.$options.hostProjectPath) !== null && _a !== void 0 ? _a : path.join(projectData.platformsDir, platformData.normalizedPlatformName.toLowerCase());
|
|
105
104
|
this.$fs.deleteDirectory(platformDir);
|
|
106
105
|
yield platformData.platformProjectService.createProject(path.resolve(frameworkDirPath), frameworkVersion, projectData);
|
|
107
106
|
platformData.platformProjectService.ensureConfigurationFileInAppResources(projectData);
|
|
@@ -41,10 +41,10 @@ class PrepareNativePlatformService {
|
|
|
41
41
|
if (changesInfo.hasChanges) {
|
|
42
42
|
yield this.cleanProject(platformData, { release });
|
|
43
43
|
}
|
|
44
|
-
if (!this.$options.
|
|
44
|
+
if (!this.$options.hostProjectPath) {
|
|
45
45
|
platformData.platformProjectService.prepareAppResources(projectData);
|
|
46
46
|
}
|
|
47
|
-
if (hasChangesRequirePrepare || this.$options.
|
|
47
|
+
if (hasChangesRequirePrepare || this.$options.hostProjectPath) {
|
|
48
48
|
yield platformData.platformProjectService.prepareProject(projectData, prepareData);
|
|
49
49
|
}
|
|
50
50
|
if (hasNativeModulesChange) {
|
|
@@ -412,7 +412,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
412
412
|
const isPlatformInstalled = this.$fs.exists(path.join(projectData.platformsDir, platform.toLowerCase()));
|
|
413
413
|
if (isPlatformInstalled) {
|
|
414
414
|
const platformData = this.$platformsDataService.getPlatformData(platform.toLowerCase(), projectData);
|
|
415
|
-
const pluginDestinationPath = path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
415
|
+
const pluginDestinationPath = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, "tns_modules");
|
|
416
416
|
yield action(pluginDestinationPath, platform.toLowerCase(), platformData);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
@@ -450,7 +450,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
452
|
getAllPluginsNativeHashes(pathToPluginsBuildFile) {
|
|
453
|
-
if (this.$options.
|
|
453
|
+
if (this.$options.hostProjectPath) {
|
|
454
454
|
return {};
|
|
455
455
|
}
|
|
456
456
|
let data = {};
|
|
@@ -460,7 +460,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
460
460
|
return data;
|
|
461
461
|
}
|
|
462
462
|
setPluginNativeHashes(opts) {
|
|
463
|
-
if (this.$options.
|
|
463
|
+
if (this.$options.hostProjectPath) {
|
|
464
464
|
return;
|
|
465
465
|
}
|
|
466
466
|
opts.allPluginsNativeHashes[opts.pluginData.name] =
|
|
@@ -131,7 +131,7 @@ class ProjectChangesService {
|
|
|
131
131
|
return prepareInfoFilePath;
|
|
132
132
|
}
|
|
133
133
|
getPrepareInfo(platformData) {
|
|
134
|
-
if (this.$options.
|
|
134
|
+
if (this.$options.hostProjectPath) {
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
137
|
const prepareInfoFilePath = this.getPrepareInfoFilePath(platformData);
|
|
@@ -151,7 +151,7 @@ class ProjectChangesService {
|
|
|
151
151
|
if (!this._prepareInfo) {
|
|
152
152
|
yield this.ensurePrepareInfo(platformData, projectData, prepareData);
|
|
153
153
|
}
|
|
154
|
-
if (this.$options.
|
|
154
|
+
if (this.$options.hostProjectPath) {
|
|
155
155
|
return null;
|
|
156
156
|
}
|
|
157
157
|
const prepareInfoFilePath = this.getPrepareInfoFilePath(platformData);
|
|
@@ -195,7 +195,7 @@ export default {
|
|
|
195
195
|
singleQuote: true,
|
|
196
196
|
};
|
|
197
197
|
this.$logger.trace("updating config, prettier options: ", prettierOptions);
|
|
198
|
-
this.$fs.writeFile(configFilePath, (0, prettier_1.format)(newContent, Object.assign(Object.assign({}, prettierOptions), { parser: "typescript" })));
|
|
198
|
+
this.$fs.writeFile(configFilePath, (0, prettier_1.format)(newContent, Object.assign(Object.assign({}, prettierOptions), { parser: "typescript", plugins: [] })));
|
|
199
199
|
}
|
|
200
200
|
catch (error) {
|
|
201
201
|
this.$logger.error(`Failed to update config.` + error);
|
|
@@ -94,8 +94,8 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
94
94
|
hash: "",
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
const files = result.emittedFiles.map((file) => path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
98
|
-
const fallbackFiles = result.fallbackFiles.map((file) => path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
97
|
+
const files = result.emittedFiles.map((file) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, file));
|
|
98
|
+
const fallbackFiles = result.fallbackFiles.map((file) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, file));
|
|
99
99
|
const data = {
|
|
100
100
|
files,
|
|
101
101
|
hasOnlyHotUpdateFiles: files.every((f) => f.indexOf("hot-update") > -1),
|
|
@@ -218,11 +218,11 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
218
218
|
cwd: projectData.projectDir,
|
|
219
219
|
stdio,
|
|
220
220
|
};
|
|
221
|
-
if (this.$options.
|
|
221
|
+
if (this.$options.hostProjectPath) {
|
|
222
222
|
options.env = {
|
|
223
|
-
USER_PROJECT_PLATFORMS_ANDROID: this.$options.
|
|
224
|
-
USER_PROJECT_PLATFORMS_ANDROID_MODULE: this.$options.
|
|
225
|
-
USER_PROJECT_PLATFORMS_IOS: this.$options.
|
|
223
|
+
USER_PROJECT_PLATFORMS_ANDROID: this.$options.hostProjectPath,
|
|
224
|
+
USER_PROJECT_PLATFORMS_ANDROID_MODULE: this.$options.hostProjectModuleName,
|
|
225
|
+
USER_PROJECT_PLATFORMS_IOS: this.$options.hostProjectPath,
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
const childProcess = this.$childProcess.spawn(process.execPath, args, options);
|
|
@@ -345,8 +345,8 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
347
|
this.$logger.trace("Webpack build done!");
|
|
348
|
-
const files = message.data.emittedAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
349
|
-
const staleFiles = message.data.staleAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.
|
|
348
|
+
const files = message.data.emittedAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
|
|
349
|
+
const staleFiles = message.data.staleAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
|
|
350
350
|
const lastHash = (() => {
|
|
351
351
|
const absoluteFileNameWithLastHash = files.find((fileName) => fileName.endsWith("hot-update.js"));
|
|
352
352
|
if (!absoluteFileNameWithLastHash) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nativescript",
|
|
3
3
|
"main": "./lib/nativescript-cli-lib.js",
|
|
4
|
-
"version": "8.8.0-embed.
|
|
4
|
+
"version": "8.8.0-embed.1",
|
|
5
5
|
"author": "NativeScript <support@nativescript.org>",
|
|
6
6
|
"description": "Command-line interface for building NativeScript projects",
|
|
7
7
|
"bin": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Downloaded from https://github.com/google/bundletool/releases/tag/1.
|
|
1
|
+
Downloaded from https://github.com/google/bundletool/releases/tag/1.15.6
|
|
Binary file
|
|
@@ -30,11 +30,11 @@ buildscript {
|
|
|
30
30
|
def getDepPlatformDir = { dep ->
|
|
31
31
|
file("${project.ext.USER_PROJECT_PLATFORMS_ANDROID}/${dep.directory}/$PLATFORMS_ANDROID")
|
|
32
32
|
}
|
|
33
|
-
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "
|
|
33
|
+
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "2.0.0" }
|
|
34
34
|
def kotlinVersion = computeKotlinVersion()
|
|
35
35
|
repositories {
|
|
36
36
|
google()
|
|
37
|
-
|
|
37
|
+
mavenCentral()
|
|
38
38
|
}
|
|
39
39
|
dependencies {
|
|
40
40
|
classpath 'com.android.tools.build:gradle:{{runtimeAndroidPluginVersion}}'
|
|
@@ -150,7 +150,6 @@ allprojects {
|
|
|
150
150
|
url 'https://maven.google.com/'
|
|
151
151
|
name 'Google'
|
|
152
152
|
}
|
|
153
|
-
jcenter()
|
|
154
153
|
if (pluginDependencies.size() > 0) {
|
|
155
154
|
flatDir {
|
|
156
155
|
dirs pluginDependencies
|
|
@@ -160,13 +159,29 @@ allprojects {
|
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
|
|
163
|
-
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk :
|
|
164
|
-
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk :
|
|
162
|
+
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 34 }
|
|
163
|
+
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : 34 as int }
|
|
165
164
|
def computeBuildToolsVersion = { ->
|
|
166
|
-
project.hasProperty("buildToolsVersion") ? buildToolsVersion : "
|
|
165
|
+
project.hasProperty("buildToolsVersion") ? buildToolsVersion : "34.0.0"
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
android {
|
|
169
|
+
namespace "{{pluginNamespace}}"
|
|
170
|
+
|
|
171
|
+
kotlinOptions {
|
|
172
|
+
jvmTarget = '17'
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
compileOptions {
|
|
176
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
177
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
if (project.hasProperty("ndkVersion")) {
|
|
182
|
+
ndkVersion project.ndkVersion
|
|
183
|
+
}
|
|
184
|
+
|
|
170
185
|
def applyPluginGradleConfigurations = { ->
|
|
171
186
|
nativescriptDependencies.each { dep ->
|
|
172
187
|
def includeGradlePath = "${getDepPlatformDir(dep)}/include.gradle"
|
|
@@ -220,15 +235,6 @@ task addDependenciesFromNativeScriptPlugins {
|
|
|
220
235
|
}
|
|
221
236
|
}
|
|
222
237
|
|
|
223
|
-
afterEvaluate {
|
|
224
|
-
def generateBuildConfig = project.hasProperty("generateBuildConfig") ? project.generateBuildConfig : false
|
|
225
|
-
def generateR = project.hasProperty("generateR") ? project.generateR : false
|
|
226
|
-
generateReleaseBuildConfig.enabled = generateBuildConfig
|
|
227
|
-
generateDebugBuildConfig.enabled = generateBuildConfig
|
|
228
|
-
generateReleaseResValues.enabled = generateR
|
|
229
|
-
generateDebugResValues.enabled = generateR
|
|
230
|
-
}
|
|
231
|
-
|
|
232
238
|
tasks.whenTaskAdded({ DefaultTask currentTask ->
|
|
233
239
|
if (currentTask.name == 'bundleRelease' || currentTask.name == 'bundleDebug') {
|
|
234
240
|
def generateBuildConfig = project.hasProperty("generateBuildConfig") ? project.generateBuildConfig : false
|
|
@@ -12,8 +12,6 @@ if (USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV != null && !USER_PROJECT_PLATFORMS_A
|
|
|
12
12
|
USER_PROJECT_PLATFORMS_ANDROID = "$rootDir/../../../platforms/android"
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
System.out.println("!!!!! VM: USER_PROJECT_PLATFORMS_ANDROID: " + USER_PROJECT_PLATFORMS_ANDROID);
|
|
16
|
-
|
|
17
15
|
def dependenciesJson = file("${USER_PROJECT_PLATFORMS_ANDROID}/dependencies.json")
|
|
18
16
|
def appDependencies = new JsonSlurper().parseText(dependenciesJson.text)
|
|
19
17
|
def pluginData = appDependencies.find { it.name == PLUGIN_NAME }
|