nativescript 8.8.0-embed.0 → 8.8.0-embed.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/add-platform.js +1 -1
- package/lib/commands/embedding/embed.js +84 -0
- package/lib/commands/native-add.js +299 -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
|
@@ -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] =
|