nativescript 8.6.1 → 8.6.2-embed.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/add-platform.js +1 -1
- package/lib/controllers/prepare-controller.js +1 -0
- package/lib/data/build-data.js +2 -0
- package/lib/data/prepare-data.js +1 -0
- package/lib/declarations.d.ts +9 -1
- package/lib/definitions/platform.d.ts +1 -0
- package/lib/helpers/platform-command-helper.js +7 -3
- package/lib/options.js +3 -1
- package/lib/services/android-project-service.js +7 -4
- package/lib/services/assets-generation/assets-generation-service.js +8 -1
- package/lib/services/ios-project-service.js +25 -4
- package/lib/services/platform/add-platform-service.js +8 -2
- package/lib/services/platform/prepare-native-platform-service.js +6 -3
- package/lib/services/platform-environment-requirements.js +3 -1
- package/lib/services/webpack/webpack-compiler-service.js +9 -2
- package/lib/services/xcproj-service.js +12 -0
- package/package.json +2 -2
- package/vendor/gradle-plugin/build.gradle +21 -6
- package/vendor/gradle-plugin/settings.gradle +13 -3
|
@@ -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, this.$options.nativeHost);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
canExecute(args) {
|
|
@@ -272,6 +272,7 @@ class PrepareController extends events_1.EventEmitter {
|
|
|
272
272
|
packagePath = path.join(platformData.projectRoot, projectData.projectName, "app", "package.json");
|
|
273
273
|
}
|
|
274
274
|
else {
|
|
275
|
+
console.log("!!!!! VM: proj root: " + platformData.projectRoot);
|
|
275
276
|
packagePath = path.join(platformData.projectRoot, "app", "src", "main", "assets", "app", "package.json");
|
|
276
277
|
}
|
|
277
278
|
try {
|
package/lib/data/build-data.js
CHANGED
|
@@ -23,6 +23,7 @@ class IOSBuildData extends BuildData {
|
|
|
23
23
|
this.mobileProvisionData = data.mobileProvisionData;
|
|
24
24
|
this.buildForAppStore = data.buildForAppStore;
|
|
25
25
|
this.iCloudContainerEnvironment = data.iCloudContainerEnvironment;
|
|
26
|
+
this.nativeHost = data.nativeHost;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
exports.IOSBuildData = IOSBuildData;
|
|
@@ -36,6 +37,7 @@ class AndroidBuildData extends BuildData {
|
|
|
36
37
|
this.androidBundle = data.androidBundle || data.aab;
|
|
37
38
|
this.gradlePath = data.gradlePath;
|
|
38
39
|
this.gradleArgs = data.gradleArgs;
|
|
40
|
+
this.nativeHost = data.nativeHost;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
exports.AndroidBuildData = AndroidBuildData;
|
package/lib/data/prepare-data.js
CHANGED
package/lib/declarations.d.ts
CHANGED
|
@@ -581,6 +581,11 @@ interface IAndroidBundleOptions {
|
|
|
581
581
|
interface IAndroidOptions {
|
|
582
582
|
gradlePath: string;
|
|
583
583
|
gradleArgs: string;
|
|
584
|
+
nativeHost: string;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
interface IIOSOptions {
|
|
588
|
+
nativeHost: string;
|
|
584
589
|
}
|
|
585
590
|
|
|
586
591
|
interface ITypingsOptions {
|
|
@@ -603,6 +608,7 @@ interface IOptions
|
|
|
603
608
|
IProvision,
|
|
604
609
|
ITeamIdentifier,
|
|
605
610
|
IAndroidOptions,
|
|
611
|
+
IIOSOptions,
|
|
606
612
|
IAndroidReleaseOptions,
|
|
607
613
|
IAndroidBundleOptions,
|
|
608
614
|
INpmInstallConfigurationOptions,
|
|
@@ -1000,6 +1006,7 @@ interface IXcprojService {
|
|
|
1000
1006
|
* @return {string} The full path to the xcodeproj
|
|
1001
1007
|
*/
|
|
1002
1008
|
getXcodeprojPath(projectData: IProjectData, projectRoot: string): string;
|
|
1009
|
+
findXcodeProject(dir: string): string;
|
|
1003
1010
|
}
|
|
1004
1011
|
|
|
1005
1012
|
/**
|
|
@@ -1207,7 +1214,8 @@ interface IPlatformCommandHelper {
|
|
|
1207
1214
|
addPlatforms(
|
|
1208
1215
|
platforms: string[],
|
|
1209
1216
|
projectData: IProjectData,
|
|
1210
|
-
frameworkPath?: string
|
|
1217
|
+
frameworkPath?: string,
|
|
1218
|
+
nativeHost?: string
|
|
1211
1219
|
): Promise<void>;
|
|
1212
1220
|
cleanPlatforms(
|
|
1213
1221
|
platforms: string[],
|
|
@@ -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;
|
|
@@ -30,7 +31,7 @@ class PlatformCommandHelper {
|
|
|
30
31
|
this.$projectDataService = $projectDataService;
|
|
31
32
|
this.$tempService = $tempService;
|
|
32
33
|
}
|
|
33
|
-
addPlatforms(platforms, projectData, frameworkPath) {
|
|
34
|
+
addPlatforms(platforms, projectData, frameworkPath, nativeHost) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
36
|
const platformsDir = projectData.platformsDir;
|
|
36
37
|
this.$fs.ensureDirectoryExists(platformsDir);
|
|
@@ -45,6 +46,7 @@ class PlatformCommandHelper {
|
|
|
45
46
|
projectDir: projectData.projectDir,
|
|
46
47
|
platform,
|
|
47
48
|
frameworkPath,
|
|
49
|
+
nativeHost,
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
});
|
|
@@ -72,7 +74,9 @@ class PlatformCommandHelper {
|
|
|
72
74
|
errorMessage = err.message;
|
|
73
75
|
}
|
|
74
76
|
try {
|
|
75
|
-
const platformDir =
|
|
77
|
+
const platformDir = this.$options.nativeHost
|
|
78
|
+
? this.$options.nativeHost
|
|
79
|
+
: path.join(projectData.platformsDir, platform.toLowerCase());
|
|
76
80
|
this.$fs.deleteDirectory(platformDir);
|
|
77
81
|
yield this.$packageInstallationManager.uninstall(platformData.frameworkPackageName, projectData.projectDir);
|
|
78
82
|
this.$logger.info(`Platform ${platform} successfully removed.`);
|
package/lib/options.js
CHANGED
|
@@ -200,6 +200,7 @@ class Options {
|
|
|
200
200
|
},
|
|
201
201
|
gradlePath: { type: "string", hasSensitiveValue: false },
|
|
202
202
|
gradleArgs: { type: "string", hasSensitiveValue: false },
|
|
203
|
+
nativeHost: { type: "string", hasSensitiveValue: false },
|
|
203
204
|
aab: { type: "boolean", hasSensitiveValue: false },
|
|
204
205
|
performance: { type: "object", hasSensitiveValue: true },
|
|
205
206
|
appleApplicationSpecificPassword: {
|
|
@@ -337,7 +338,8 @@ class Options {
|
|
|
337
338
|
this.$settingsService.setSettings({
|
|
338
339
|
profileDir: this.argv.profileDir,
|
|
339
340
|
});
|
|
340
|
-
this.argv.profileDir = this.argv["profile-dir"] =
|
|
341
|
+
this.argv.profileDir = this.argv["profile-dir"] =
|
|
342
|
+
this.$settingsService.getProfileDir();
|
|
341
343
|
if (this.argv.justlaunch) {
|
|
342
344
|
this.argv.watch = false;
|
|
343
345
|
}
|
|
@@ -69,7 +69,9 @@ 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 =
|
|
72
|
+
const projectRoot = this.$options.nativeHost
|
|
73
|
+
? this.$options.nativeHost
|
|
74
|
+
: path.join(projectData.platformsDir, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
73
75
|
const appDestinationDirectoryArr = [
|
|
74
76
|
projectRoot,
|
|
75
77
|
constants.APP_FOLDER_NAME,
|
|
@@ -247,8 +249,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
247
249
|
});
|
|
248
250
|
}
|
|
249
251
|
interpolateConfigurationFile(projectData) {
|
|
250
|
-
const manifestPath = this.getPlatformData(projectData)
|
|
251
|
-
.configurationFilePath;
|
|
252
|
+
const manifestPath = this.getPlatformData(projectData).configurationFilePath;
|
|
252
253
|
shell.sed("-i", /__PACKAGE__/, projectData.projectIdentifiers.android, manifestPath);
|
|
253
254
|
}
|
|
254
255
|
getProjectNameFromId(projectData) {
|
|
@@ -391,7 +392,9 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
391
392
|
return _.values(depsDictionary);
|
|
392
393
|
}
|
|
393
394
|
provideDependenciesJson(projectData, dependencies) {
|
|
394
|
-
const platformDir =
|
|
395
|
+
const platformDir = this.$options.nativeHost
|
|
396
|
+
? this.$options.nativeHost
|
|
397
|
+
: path.join(projectData.platformsDir, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
395
398
|
const dependenciesJsonPath = path.join(platformDir, constants.DEPENDENCIES_JSON_NAME);
|
|
396
399
|
let nativeDependencyData = dependencies.filter(AndroidProjectService.isNativeAndroidDependency);
|
|
397
400
|
let nativeDependencies = nativeDependencyData.map(({ name, directory, dependencies }) => {
|
|
@@ -30,13 +30,17 @@ class AssetsGenerationService {
|
|
|
30
30
|
splash: ["splashBackgrounds", "splashCenterImages", "splashImages"],
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
constructor($logger, $projectDataService, $fs) {
|
|
33
|
+
constructor($logger, $projectDataService, $fs, $options) {
|
|
34
34
|
this.$logger = $logger;
|
|
35
35
|
this.$projectDataService = $projectDataService;
|
|
36
36
|
this.$fs = $fs;
|
|
37
|
+
this.$options = $options;
|
|
37
38
|
}
|
|
38
39
|
generateIcons(resourceGenerationData) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (this.$options.nativeHost) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
40
44
|
this.$logger.info("Generating icons ...");
|
|
41
45
|
yield this.generateImagesForDefinitions(resourceGenerationData, this.propertiesToEnumerate.icon);
|
|
42
46
|
this.$logger.info("Icons generation completed.");
|
|
@@ -44,6 +48,9 @@ class AssetsGenerationService {
|
|
|
44
48
|
}
|
|
45
49
|
generateSplashScreens(splashesGenerationData) {
|
|
46
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
if (this.$options.nativeHost) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
47
54
|
this.$logger.info("Generating splash screens ...");
|
|
48
55
|
yield this.generateImagesForDefinitions(splashesGenerationData, this.propertiesToEnumerate.splash);
|
|
49
56
|
this.$logger.info("Splash screens generation completed.");
|
|
@@ -36,13 +36,14 @@ const FRAMEWORK_EXTENSIONS = [".framework", ".xcframework"];
|
|
|
36
36
|
const getPlatformSdkName = (forDevice) => forDevice ? DevicePlatformSdkName : SimulatorPlatformSdkName;
|
|
37
37
|
const getConfigurationName = (release) => release ? constants_1.Configurations.Release : constants_1.Configurations.Debug;
|
|
38
38
|
class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase {
|
|
39
|
-
constructor($fs, $childProcess, $cocoapodsService, $errors, $logger, $injector, $projectDataService, $devicePlatformsConstants, $hostInfo, $xcprojService, $iOSProvisionService, $iOSSigningService, $pbxprojDomXcode, $xcode, $iOSEntitlementsService, $platformEnvironmentRequirements, $plistParser, $xcconfigService, $xcodebuildService, $iOSExtensionsService, $iOSWatchAppService, $iOSNativeTargetService, $sysInfo, $tempService, $spmService) {
|
|
39
|
+
constructor($fs, $childProcess, $cocoapodsService, $errors, $logger, $injector, $projectDataService, $options, $devicePlatformsConstants, $hostInfo, $xcprojService, $iOSProvisionService, $iOSSigningService, $pbxprojDomXcode, $xcode, $iOSEntitlementsService, $platformEnvironmentRequirements, $plistParser, $xcconfigService, $xcodebuildService, $iOSExtensionsService, $iOSWatchAppService, $iOSNativeTargetService, $sysInfo, $tempService, $spmService) {
|
|
40
40
|
super($fs, $projectDataService);
|
|
41
41
|
this.$childProcess = $childProcess;
|
|
42
42
|
this.$cocoapodsService = $cocoapodsService;
|
|
43
43
|
this.$errors = $errors;
|
|
44
44
|
this.$logger = $logger;
|
|
45
45
|
this.$injector = $injector;
|
|
46
|
+
this.$options = $options;
|
|
46
47
|
this.$devicePlatformsConstants = $devicePlatformsConstants;
|
|
47
48
|
this.$hostInfo = $hostInfo;
|
|
48
49
|
this.$xcprojService = $xcprojService;
|
|
@@ -71,7 +72,9 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
71
72
|
if (projectData &&
|
|
72
73
|
projectData.platformsDir &&
|
|
73
74
|
this._platformsDirCache !== projectData.platformsDir) {
|
|
74
|
-
const projectRoot =
|
|
75
|
+
const projectRoot = this.$options.nativeHost
|
|
76
|
+
? this.$options.nativeHost
|
|
77
|
+
: path.join(projectData.platformsDir, this.$devicePlatformsConstants.iOS.toLowerCase());
|
|
75
78
|
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "ios");
|
|
76
79
|
this._platformData = {
|
|
77
80
|
frameworkPackageName: runtimePackage.name,
|
|
@@ -309,7 +312,9 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
309
312
|
}
|
|
310
313
|
prepareProject(projectData, prepareData) {
|
|
311
314
|
return __awaiter(this, void 0, void 0, function* () {
|
|
312
|
-
const projectRoot =
|
|
315
|
+
const projectRoot = this.$options.nativeHost
|
|
316
|
+
? this.$options.nativeHost
|
|
317
|
+
: path.join(projectData.platformsDir, this.$devicePlatformsConstants.iOS.toLowerCase());
|
|
313
318
|
const platformData = this.getPlatformData(projectData);
|
|
314
319
|
const pluginsData = this.getAllProductionPlugins(projectData);
|
|
315
320
|
const pbxProjPath = this.getPbxProjPath(projectData);
|
|
@@ -326,7 +331,16 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
326
331
|
}
|
|
327
332
|
const project = this.createPbxProj(projectData);
|
|
328
333
|
const resources = project.pbxGroupByName("Resources");
|
|
329
|
-
if (
|
|
334
|
+
if (this.$options.nativeHost) {
|
|
335
|
+
try {
|
|
336
|
+
project.addResourceFile(path.join(this.$options.nativeHost, projectData.projectName));
|
|
337
|
+
this.savePbxProj(project, projectData);
|
|
338
|
+
}
|
|
339
|
+
catch (err) {
|
|
340
|
+
console.log(err);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (resources && !this.$options.nativeHost) {
|
|
330
344
|
const references = project.pbxFileReferenceSection();
|
|
331
345
|
const xcodeProjectImages = _.map(resources.children, (resource) => this.replace(references[resource.value].name));
|
|
332
346
|
this.$logger.trace("Images from Xcode project");
|
|
@@ -465,6 +479,13 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
465
479
|
return frameworkPath;
|
|
466
480
|
}
|
|
467
481
|
getPbxProjPath(projectData) {
|
|
482
|
+
if (this.$options.nativeHost) {
|
|
483
|
+
let xcodeProjectPath = this.$xcprojService.findXcodeProject(this.$options.nativeHost);
|
|
484
|
+
if (!xcodeProjectPath) {
|
|
485
|
+
this.$errors.fail("Xcode project not found at the specified directory");
|
|
486
|
+
}
|
|
487
|
+
return path.join(xcodeProjectPath, "project.pbxproj");
|
|
488
|
+
}
|
|
468
489
|
return path.join(this.$xcprojService.getXcodeprojPath(projectData, this.getPlatformData(projectData).projectRoot), "project.pbxproj");
|
|
469
490
|
}
|
|
470
491
|
createPbxProj(projectData) {
|
|
@@ -21,13 +21,17 @@ const constants_1 = require("../../constants");
|
|
|
21
21
|
const decorators_1 = require("../../common/decorators");
|
|
22
22
|
const yok_1 = require("../../common/yok");
|
|
23
23
|
class AddPlatformService {
|
|
24
|
-
constructor($fs, $logger, $packageManager, $terminalSpinnerService, $analyticsService) {
|
|
24
|
+
constructor($fs, $logger, $options, $packageManager, $terminalSpinnerService, $analyticsService) {
|
|
25
25
|
this.$fs = $fs;
|
|
26
26
|
this.$logger = $logger;
|
|
27
|
+
this.$options = $options;
|
|
27
28
|
this.$packageManager = $packageManager;
|
|
28
29
|
this.$terminalSpinnerService = $terminalSpinnerService;
|
|
29
30
|
this.$analyticsService = $analyticsService;
|
|
30
31
|
}
|
|
32
|
+
addProjectHost() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
34
|
+
}
|
|
31
35
|
addPlatformSafe(projectData, platformData, packageToInstall, addPlatformData) {
|
|
32
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
37
|
const spinner = this.$terminalSpinnerService.createSpinner();
|
|
@@ -95,7 +99,9 @@ class AddPlatformService {
|
|
|
95
99
|
}
|
|
96
100
|
addNativePlatform(platformData, projectData, frameworkDirPath, frameworkVersion) {
|
|
97
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const platformDir =
|
|
102
|
+
const platformDir = this.$options.nativeHost
|
|
103
|
+
? this.$options.nativeHost
|
|
104
|
+
: path.join(projectData.platformsDir, platformData.normalizedPlatformName.toLowerCase());
|
|
99
105
|
this.$fs.deleteDirectory(platformDir);
|
|
100
106
|
yield platformData.platformProjectService.createProject(path.resolve(frameworkDirPath), frameworkVersion, projectData);
|
|
101
107
|
platformData.platformProjectService.ensureConfigurationFileInAppResources(projectData);
|
|
@@ -20,11 +20,12 @@ const helpers_1 = require("../../common/helpers");
|
|
|
20
20
|
const decorators_1 = require("../../common/decorators");
|
|
21
21
|
const yok_1 = require("../../common/yok");
|
|
22
22
|
class PrepareNativePlatformService {
|
|
23
|
-
constructor($hooksService, $nodeModulesBuilder, $projectChangesService, $metadataFilteringService) {
|
|
23
|
+
constructor($hooksService, $nodeModulesBuilder, $projectChangesService, $metadataFilteringService, $options) {
|
|
24
24
|
this.$hooksService = $hooksService;
|
|
25
25
|
this.$nodeModulesBuilder = $nodeModulesBuilder;
|
|
26
26
|
this.$projectChangesService = $projectChangesService;
|
|
27
27
|
this.$metadataFilteringService = $metadataFilteringService;
|
|
28
|
+
this.$options = $options;
|
|
28
29
|
}
|
|
29
30
|
prepareNativePlatform(platformData, projectData, prepareData) {
|
|
30
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -40,8 +41,10 @@ class PrepareNativePlatformService {
|
|
|
40
41
|
if (changesInfo.hasChanges) {
|
|
41
42
|
yield this.cleanProject(platformData, { release });
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
if (!this.$options.nativeHost) {
|
|
45
|
+
platformData.platformProjectService.prepareAppResources(projectData);
|
|
46
|
+
}
|
|
47
|
+
if (hasChangesRequirePrepare || this.$options.nativeHost) {
|
|
45
48
|
yield platformData.platformProjectService.prepareProject(projectData, prepareData);
|
|
46
49
|
}
|
|
47
50
|
if (hasNativeModulesChange) {
|
|
@@ -74,7 +74,9 @@ class PlatformEnvironmentRequirements {
|
|
|
74
74
|
win32: "windows",
|
|
75
75
|
darwin: "macos",
|
|
76
76
|
}[process.platform];
|
|
77
|
-
const anchor = platform
|
|
77
|
+
const anchor = platform
|
|
78
|
+
? `#setting-up-${os}-for-${platform.toLowerCase()}`
|
|
79
|
+
: "";
|
|
78
80
|
return (`Verify that your environment is configured according to the system requirements described at\n` +
|
|
79
81
|
`https://docs.nativescript.org/setup/${os}${anchor}.`);
|
|
80
82
|
}
|
|
@@ -214,10 +214,17 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
214
214
|
args.push("--watch");
|
|
215
215
|
}
|
|
216
216
|
const stdio = prepareData.watch ? ["ipc"] : "inherit";
|
|
217
|
-
const
|
|
217
|
+
const options = {
|
|
218
218
|
cwd: projectData.projectDir,
|
|
219
219
|
stdio,
|
|
220
|
-
}
|
|
220
|
+
};
|
|
221
|
+
if (this.$options.nativeHost) {
|
|
222
|
+
options.env = {
|
|
223
|
+
USER_PROJECT_PLATFORMS_ANDROID: this.$options.nativeHost,
|
|
224
|
+
USER_PROJECT_PLATFORMS_IOS: this.$options.nativeHost,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
const childProcess = this.$childProcess.spawn(process.execPath, args, options);
|
|
221
228
|
this.webpackProcesses[platformData.platformNameLowerCase] = childProcess;
|
|
222
229
|
yield this.$cleanupService.addKillProcess(childProcess.pid.toString());
|
|
223
230
|
return childProcess;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const path = require("path");
|
|
4
|
+
const fs = require("fs");
|
|
4
5
|
const constants_1 = require("../constants");
|
|
5
6
|
const yok_1 = require("../common/yok");
|
|
6
7
|
class XcprojService {
|
|
7
8
|
getXcodeprojPath(projectData, projectRoot) {
|
|
8
9
|
return path.join(projectRoot, projectData.projectName + constants_1.IosProjectConstants.XcodeProjExtName);
|
|
9
10
|
}
|
|
11
|
+
findXcodeProject(dir) {
|
|
12
|
+
const filesAndDirs = fs.readdirSync(dir);
|
|
13
|
+
for (let i = 0; i < filesAndDirs.length; i++) {
|
|
14
|
+
const fullPath = path.join(dir, filesAndDirs[i]);
|
|
15
|
+
if (fs.statSync(fullPath).isDirectory() &&
|
|
16
|
+
filesAndDirs[i].endsWith(".xcodeproj")) {
|
|
17
|
+
return fullPath;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
10
22
|
}
|
|
11
23
|
yok_1.injector.register("xcprojService", XcprojService);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nativescript",
|
|
3
3
|
"preferGlobal": true,
|
|
4
|
-
"version": "8.6.
|
|
4
|
+
"version": "8.6.2-embed.0",
|
|
5
5
|
"author": "NativeScript <support@nativescript.org>",
|
|
6
6
|
"description": "Command-line interface for building NativeScript projects",
|
|
7
7
|
"bin": {
|
|
@@ -185,4 +185,4 @@
|
|
|
185
185
|
"@npmcli/move-file",
|
|
186
186
|
"stringify-package"
|
|
187
187
|
]
|
|
188
|
-
}
|
|
188
|
+
}
|
|
@@ -8,8 +8,27 @@ apply plugin: 'kotlin-android'
|
|
|
8
8
|
apply plugin: 'kotlin-parcelize'
|
|
9
9
|
|
|
10
10
|
buildscript {
|
|
11
|
+
// project.ext.USER_PROJECT_ROOT = "$rootDir/../../.."
|
|
12
|
+
project.ext.PLATFORMS_ANDROID = "platforms/android"
|
|
13
|
+
project.ext.PLUGIN_NAME = "{{pluginName}}"
|
|
14
|
+
|
|
15
|
+
def USER_PROJECT_ROOT_FROM_ENV = System.getenv('USER_PROJECT_ROOT');
|
|
16
|
+
if (USER_PROJECT_ROOT_FROM_ENV != null && !USER_PROJECT_ROOT_FROM_ENV.equals("")) {
|
|
17
|
+
project.ext.USER_PROJECT_ROOT = USER_PROJECT_ROOT_FROM_ENV;
|
|
18
|
+
} else {
|
|
19
|
+
project.ext.USER_PROJECT_ROOT = "$rootDir/../../../"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
def USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV = System.getenv('USER_PROJECT_PLATFORMS_ANDROID');
|
|
23
|
+
if (USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV != null && !USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV.equals("")) {
|
|
24
|
+
project.ext.USER_PROJECT_PLATFORMS_ANDROID = USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV;
|
|
25
|
+
} else {
|
|
26
|
+
project.ext.USER_PROJECT_PLATFORMS_ANDROID = project.ext.USER_PROJECT_ROOT + PLATFORMS_ANDROID
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
11
30
|
def getDepPlatformDir = { dep ->
|
|
12
|
-
file("${project.ext.
|
|
31
|
+
file("${project.ext.USER_PROJECT_PLATFORMS_ANDROID}/${dep.directory}/$PLATFORMS_ANDROID")
|
|
13
32
|
}
|
|
14
33
|
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "1.8.20" }
|
|
15
34
|
def kotlinVersion = computeKotlinVersion()
|
|
@@ -29,12 +48,8 @@ buildscript {
|
|
|
29
48
|
project.ext.getDepPlatformDir = getDepPlatformDir
|
|
30
49
|
project.ext.outLogger = services.get(StyledTextOutputFactory).create("colouredOutputLogger")
|
|
31
50
|
|
|
32
|
-
project.ext.USER_PROJECT_ROOT = "$rootDir/../../.."
|
|
33
|
-
project.ext.PLATFORMS_ANDROID = "platforms/android"
|
|
34
|
-
project.ext.PLUGIN_NAME = "{{pluginName}}"
|
|
35
|
-
|
|
36
51
|
// the build script will not work with previous versions of the CLI (3.1 or earlier)
|
|
37
|
-
def dependenciesJson = file("${project.ext.
|
|
52
|
+
def dependenciesJson = file("${project.ext.USER_PROJECT_PLATFORMS_ANDROID}/dependencies.json")
|
|
38
53
|
def appDependencies = new JsonSlurper().parseText(dependenciesJson.text)
|
|
39
54
|
def pluginData = appDependencies.find { it.name == project.ext.PLUGIN_NAME }
|
|
40
55
|
project.ext.nativescriptDependencies = appDependencies.findAll{pluginData.dependencies.contains(it.name)}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import groovy.json.JsonSlurper
|
|
2
2
|
|
|
3
|
-
def USER_PROJECT_ROOT = "$rootDir/../../../"
|
|
3
|
+
// def USER_PROJECT_ROOT = "$rootDir/../../../"
|
|
4
4
|
def PLATFORMS_ANDROID = "platforms/android"
|
|
5
5
|
def PLUGIN_NAME = "{{pluginName}}"
|
|
6
6
|
|
|
7
|
-
def
|
|
7
|
+
def USER_PROJECT_PLATFORMS_ANDROID
|
|
8
|
+
def USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV = System.getenv('USER_PROJECT_PLATFORMS_ANDROID');
|
|
9
|
+
if (USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV != null && !USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV.equals("")) {
|
|
10
|
+
USER_PROJECT_PLATFORMS_ANDROID = USER_PROJECT_PLATFORMS_ANDROID_FROM_ENV;
|
|
11
|
+
} else {
|
|
12
|
+
USER_PROJECT_PLATFORMS_ANDROID = "$rootDir/../../../platforms/android"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
System.out.println("!!!!! VM: USER_PROJECT_PLATFORMS_ANDROID: " + USER_PROJECT_PLATFORMS_ANDROID);
|
|
16
|
+
|
|
17
|
+
def dependenciesJson = file("${USER_PROJECT_PLATFORMS_ANDROID}/dependencies.json")
|
|
8
18
|
def appDependencies = new JsonSlurper().parseText(dependenciesJson.text)
|
|
9
19
|
def pluginData = appDependencies.find { it.name == PLUGIN_NAME }
|
|
10
20
|
def nativescriptDependencies = appDependencies.findAll{pluginData.name == it.name}
|
|
11
21
|
|
|
12
22
|
def getDepPlatformDir = { dep ->
|
|
13
|
-
file("$
|
|
23
|
+
file("$USER_PROJECT_PLATFORMS_ANDROID/${dep.directory}/$PLATFORMS_ANDROID")
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
def applyIncludeSettingsGradlePlugin = {
|