nativescript 9.0.6-dev.0 → 9.0.6-dev.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.
|
@@ -7,24 +7,52 @@ const yok_1 = require("../common/yok");
|
|
|
7
7
|
const trapezedev_project_1 = require("@nstudio/trapezedev-project");
|
|
8
8
|
const minimatch_1 = require("minimatch");
|
|
9
9
|
const sourceExtensions = [
|
|
10
|
-
|
|
10
|
+
".swift",
|
|
11
|
+
".m",
|
|
12
|
+
".mm",
|
|
13
|
+
".c",
|
|
14
|
+
".cpp",
|
|
15
|
+
".cc",
|
|
16
|
+
".cxx",
|
|
17
|
+
".h",
|
|
18
|
+
".hpp",
|
|
11
19
|
];
|
|
12
20
|
const resourceExtensions = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
".png",
|
|
22
|
+
".jpg",
|
|
23
|
+
".jpeg",
|
|
24
|
+
".gif",
|
|
25
|
+
".svg",
|
|
26
|
+
".pdf", // Images
|
|
27
|
+
".ttf",
|
|
28
|
+
".otf",
|
|
29
|
+
".woff",
|
|
30
|
+
".woff2", // Fonts
|
|
31
|
+
".xcassets", // Asset catalogs
|
|
32
|
+
".storyboard",
|
|
33
|
+
".xib", // Interface files
|
|
34
|
+
".strings",
|
|
35
|
+
".stringsdict", // Localization
|
|
36
|
+
".json",
|
|
37
|
+
".xml",
|
|
38
|
+
".plist", // Data files
|
|
39
|
+
".m4a",
|
|
40
|
+
".mp3",
|
|
41
|
+
".wav",
|
|
42
|
+
".caf", // Audio
|
|
43
|
+
".mp4",
|
|
44
|
+
".mov", // Video
|
|
45
|
+
".bundle", // Resource bundles
|
|
22
46
|
];
|
|
23
47
|
const WATCH_APP_IDENTIFIER = "watchkitapp";
|
|
24
48
|
const WACTCH_EXTENSION_IDENTIFIER = "watchkitextension";
|
|
25
49
|
const CONFIG_FILE_WATCHAPP = "watchapp.json";
|
|
26
50
|
const CONFIG_FILE_EXTENSION = "extension.json";
|
|
27
|
-
const RESOURCES_TO_IGNORE = [
|
|
51
|
+
const RESOURCES_TO_IGNORE = [
|
|
52
|
+
CONFIG_FILE_WATCHAPP,
|
|
53
|
+
CONFIG_FILE_EXTENSION,
|
|
54
|
+
"node_modules",
|
|
55
|
+
];
|
|
28
56
|
class IOSWatchAppService {
|
|
29
57
|
constructor($fs, $pbxprojDomXcode, $xcode, $iOSNativeTargetService, $logger) {
|
|
30
58
|
this.$fs = $fs;
|
|
@@ -33,11 +61,11 @@ class IOSWatchAppService {
|
|
|
33
61
|
this.$iOSNativeTargetService = $iOSNativeTargetService;
|
|
34
62
|
this.$logger = $logger;
|
|
35
63
|
}
|
|
36
|
-
addResourceFile(project, path, opt, group =
|
|
64
|
+
addResourceFile(project, path, opt, group = "WatchResources") {
|
|
37
65
|
const file = project.addResourceFile(path, opt, group);
|
|
38
66
|
project.addToResourcesPbxGroup(file, group);
|
|
39
67
|
}
|
|
40
|
-
addSourceFile(project, path, opt, group =
|
|
68
|
+
addSourceFile(project, path, opt, group = "WatchSrc") {
|
|
41
69
|
const file = project.addSourceFile(path, opt, group);
|
|
42
70
|
project.addToResourcesPbxGroup(file, group);
|
|
43
71
|
}
|
|
@@ -46,6 +74,8 @@ class IOSWatchAppService {
|
|
|
46
74
|
const targetUuids = [];
|
|
47
75
|
const targetNames = [];
|
|
48
76
|
const appPath = path.join(watchAppFolderPath, constants_1.IOS_WATCHAPP_FOLDER);
|
|
77
|
+
const extensionPath = path.join(watchAppFolderPath, constants_1.IOS_WATCHAPP_EXTENSION_FOLDER);
|
|
78
|
+
const hasWatchExtension = this.$fs.exists(extensionPath);
|
|
49
79
|
// Check if watchapp exists - it's required
|
|
50
80
|
if (!this.$fs.exists(appPath)) {
|
|
51
81
|
return false;
|
|
@@ -54,21 +84,24 @@ class IOSWatchAppService {
|
|
|
54
84
|
const project = new this.$xcode.project(pbxProjPath);
|
|
55
85
|
project.parseSync();
|
|
56
86
|
const configPath = path.join(path.join(appPath, appFolder), "watchapp.json");
|
|
57
|
-
const config = this.$fs.exists(configPath)
|
|
87
|
+
const config = this.$fs.exists(configPath)
|
|
88
|
+
? this.$fs.readJson(configPath)
|
|
89
|
+
: null;
|
|
58
90
|
const targetType = (_a = config === null || config === void 0 ? void 0 : config.targetType) !== null && _a !== void 0 ? _a : constants_1.IOSNativeTargetTypes.watchApp;
|
|
59
91
|
project.removeTargetsByProductType(constants_1.IOSNativeTargetProductTypes.watchApp);
|
|
60
92
|
project.removeTargetsByProductType(targetType);
|
|
61
93
|
const parentTargetUuid = project.getFirstTarget().uuid;
|
|
62
94
|
const watchApptarget = this.addTarget(appPath, appFolder, targetType, project, platformData, parentTargetUuid, constants_1.IOSNativeTargetTypes.watchApp);
|
|
63
|
-
await this.configureTarget(appFolder, path.join(appPath, appFolder), `${projectData.projectIdentifiers.ios}.${WATCH_APP_IDENTIFIER}`, configPath, config, watchApptarget, project, projectData, platformData, pbxProjPath);
|
|
95
|
+
await this.configureTarget(appFolder, path.join(appPath, appFolder), `${projectData.projectIdentifiers.ios}.${WATCH_APP_IDENTIFIER}`, configPath, config, watchApptarget, project, projectData, platformData, pbxProjPath, !hasWatchExtension);
|
|
64
96
|
targetUuids.push(watchApptarget.uuid);
|
|
65
97
|
targetNames.push(appFolder);
|
|
66
|
-
const extensionPath = path.join(watchAppFolderPath, constants_1.IOS_WATCHAPP_EXTENSION_FOLDER);
|
|
67
98
|
// Extension is optional (Xcode 14+ supports single target)
|
|
68
|
-
if (
|
|
99
|
+
if (hasWatchExtension) {
|
|
69
100
|
const extensionFolder = this.$iOSNativeTargetService.getTargetDirectories(extensionPath)[0];
|
|
70
101
|
const configPath = path.join(path.join(extensionPath, extensionFolder), "extension.json");
|
|
71
|
-
const config = this.$fs.exists(configPath)
|
|
102
|
+
const config = this.$fs.exists(configPath)
|
|
103
|
+
? this.$fs.readJson(configPath)
|
|
104
|
+
: null;
|
|
72
105
|
const targetType = (_b = config === null || config === void 0 ? void 0 : config.targetType) !== null && _b !== void 0 ? _b : constants_1.IOSNativeTargetTypes.watchExtension;
|
|
73
106
|
project.removeTargetsByProductType(constants_1.IOSNativeTargetProductTypes.watchExtension);
|
|
74
107
|
project.removeTargetsByProductType(targetType);
|
|
@@ -96,7 +129,7 @@ class IOSWatchAppService {
|
|
|
96
129
|
project.addBuildPhase([], "PBXSourcesBuildPhase", "Sources", target.uuid);
|
|
97
130
|
project.addBuildPhase([], "PBXResourcesBuildPhase", "Resources", target.uuid);
|
|
98
131
|
project.addBuildPhase([], "PBXFrameworksBuildPhase", "Frameworks", target.uuid);
|
|
99
|
-
project.addBuildPhase([], "PBXCopyFilesBuildPhase", "Embed Frameworks", target.uuid);
|
|
132
|
+
project.addBuildPhase([], "PBXCopyFilesBuildPhase", "Embed Frameworks", target.uuid, "frameworks");
|
|
100
133
|
project.addToHeaderSearchPaths(targetPath, target.pbxNativeTarget.productName);
|
|
101
134
|
return target;
|
|
102
135
|
}
|
|
@@ -137,20 +170,21 @@ class IOSWatchAppService {
|
|
|
137
170
|
const items = this.$fs.readDirectory(dirPath);
|
|
138
171
|
for (const item of items) {
|
|
139
172
|
// Skip hidden files and excluded files/directories
|
|
140
|
-
if (item.startsWith(
|
|
173
|
+
if (item.startsWith(".") || RESOURCES_TO_IGNORE.indexOf(item) !== -1) {
|
|
141
174
|
continue;
|
|
142
175
|
}
|
|
143
176
|
const itemPath = path.join(dirPath, item);
|
|
144
177
|
const stats = this.$fs.getFsStats(itemPath);
|
|
145
178
|
const relativePath = path.relative(platformData.projectRoot, itemPath);
|
|
146
179
|
// Check if file/directory should be excluded based on patterns
|
|
147
|
-
if (excludePatterns &&
|
|
180
|
+
if (excludePatterns &&
|
|
181
|
+
this.shouldExclude(relativePath, excludePatterns)) {
|
|
148
182
|
this.$logger.debug(`Excluding from resources: ${relativePath}`);
|
|
149
183
|
continue;
|
|
150
184
|
}
|
|
151
185
|
if (stats.isDirectory()) {
|
|
152
186
|
// Special handling for .xcassets, .bundle, and other resource bundles
|
|
153
|
-
if (item.endsWith(
|
|
187
|
+
if (item.endsWith(".xcassets") || item.endsWith(".bundle")) {
|
|
154
188
|
this.$logger.debug(`Adding resource bundle: ${relativePath}`);
|
|
155
189
|
this.addResourceFile(project, relativePath, { target: targetUuid }, groupName);
|
|
156
190
|
}
|
|
@@ -180,7 +214,7 @@ class IOSWatchAppService {
|
|
|
180
214
|
const watchAppPath = path.join(projectData.getAppResourcesDirectoryPath(), platformData.normalizedPlatformName, constants_1.IOS_WATCHAPP_FOLDER);
|
|
181
215
|
return this.$fs.exists(watchAppPath);
|
|
182
216
|
}
|
|
183
|
-
async configureTarget(targetName, targetPath, identifier, configPath, config, target, project, projectData, platformData, pbxProjPath) {
|
|
217
|
+
async configureTarget(targetName, targetPath, identifier, configPath, config, target, project, projectData, platformData, pbxProjPath, disableStubBinary = false) {
|
|
184
218
|
const identifierParts = identifier.split(".");
|
|
185
219
|
identifierParts.pop();
|
|
186
220
|
const wkAppBundleIdentifier = identifierParts.join(".");
|
|
@@ -192,6 +226,9 @@ class IOSWatchAppService {
|
|
|
192
226
|
{ name: "WATCHOS_DEPLOYMENT_TARGET", value: 5.2 },
|
|
193
227
|
{ name: "WK_APP_BUNDLE_IDENTIFIER", value: wkAppBundleIdentifier },
|
|
194
228
|
];
|
|
229
|
+
if (disableStubBinary) {
|
|
230
|
+
buildConfigProperties.push({ name: "PRODUCT_BINARY_SOURCE_PATH", value: '""' }, { name: "PRODUCT_TYPE_HAS_STUB_BINARY", value: "NO" });
|
|
231
|
+
}
|
|
195
232
|
const resourcesGroup = targetName + "Resources";
|
|
196
233
|
project.addPbxGroup([], resourcesGroup, project.filepath, null, {
|
|
197
234
|
isMain: true,
|
|
@@ -224,7 +261,7 @@ class IOSWatchAppService {
|
|
|
224
261
|
const relativeInfoPlistPath = path.relative(platformData.projectRoot, infoPlistPath);
|
|
225
262
|
buildConfigProperties.push({
|
|
226
263
|
name: "INFOPLIST_FILE",
|
|
227
|
-
value: `"${infoPlistPath}"
|
|
264
|
+
value: `"${infoPlistPath}"`,
|
|
228
265
|
});
|
|
229
266
|
resourcesExclude.push(relativeInfoPlistPath);
|
|
230
267
|
}
|
|
@@ -248,7 +285,7 @@ class IOSWatchAppService {
|
|
|
248
285
|
this.$iOSNativeTargetService.setConfigurationsFromJsonFile(configPath, target.uuid, targetName, project);
|
|
249
286
|
project.addToHeaderSearchPaths(targetPath, target.pbxNativeTarget.productName);
|
|
250
287
|
if ((config === null || config === void 0 ? void 0 : config.importSourcesFromMainFolder) !== false) {
|
|
251
|
-
await this.addSourceFilesFromDirectory(path.dirname(configPath), target.uuid, project, platformData, targetName +
|
|
288
|
+
await this.addSourceFilesFromDirectory(path.dirname(configPath), target.uuid, project, platformData, targetName + "Src", srcExclude);
|
|
252
289
|
}
|
|
253
290
|
if ((config === null || config === void 0 ? void 0 : config.importResourcesFromMainFolder) !== false) {
|
|
254
291
|
await this.addTargetResources(path.dirname(configPath), [target.uuid], project, platformData, resourcesGroup, resourcesExclude);
|
|
@@ -270,7 +307,7 @@ class IOSWatchAppService {
|
|
|
270
307
|
if (config.src && Array.isArray(config.src)) {
|
|
271
308
|
this.$logger.debug(`Processing ${config.src.length} custom source file(s) for watch target: ${targetName}`);
|
|
272
309
|
for (const srcPath of config.src) {
|
|
273
|
-
this.addCustomSourceFile(srcPath, target.uuid, project, projectData, platformData, srcExclude, targetName +
|
|
310
|
+
this.addCustomSourceFile(srcPath, target.uuid, project, projectData, platformData, srcExclude, targetName + "Src", basedir);
|
|
274
311
|
}
|
|
275
312
|
}
|
|
276
313
|
if (config.SPMPackages && Array.isArray(config.SPMPackages)) {
|
|
@@ -301,7 +338,8 @@ class IOSWatchAppService {
|
|
|
301
338
|
const stats = this.$fs.getFsStats(resolvedPath);
|
|
302
339
|
if (stats.isDirectory()) {
|
|
303
340
|
this.$logger.debug(`Recursively adding files from resource directory: ${resourcePath}`);
|
|
304
|
-
if (relativePath.endsWith(
|
|
341
|
+
if (relativePath.endsWith(".xcassets") ||
|
|
342
|
+
relativePath.endsWith(".bundle")) {
|
|
305
343
|
this.$logger.debug(`Adding resource bundle: ${relativePath} for target:${targetUuid}`);
|
|
306
344
|
this.addResourceFile(project, relativePath, { target: targetUuid }, groupName);
|
|
307
345
|
}
|
|
@@ -355,19 +393,20 @@ class IOSWatchAppService {
|
|
|
355
393
|
addAllResourcesRecursively(dirPath, targetUuid, project, platformData, groupName, excludePatterns) {
|
|
356
394
|
const items = this.$fs.readDirectory(dirPath);
|
|
357
395
|
for (const item of items) {
|
|
358
|
-
if (item.startsWith(
|
|
396
|
+
if (item.startsWith(".")) {
|
|
359
397
|
continue;
|
|
360
398
|
}
|
|
361
399
|
const itemPath = path.join(dirPath, item);
|
|
362
400
|
const stats = this.$fs.getFsStats(itemPath);
|
|
363
401
|
const relativePath = path.relative(platformData.projectRoot, itemPath);
|
|
364
|
-
if (excludePatterns &&
|
|
402
|
+
if (excludePatterns &&
|
|
403
|
+
this.shouldExclude(relativePath, excludePatterns)) {
|
|
365
404
|
this.$logger.debug(`Excluding from resources: ${relativePath}`);
|
|
366
405
|
return;
|
|
367
406
|
}
|
|
368
407
|
if (stats.isDirectory()) {
|
|
369
408
|
// Special handling for .xcassets, .bundle - add as bundles, not recursively
|
|
370
|
-
if (item.endsWith(
|
|
409
|
+
if (item.endsWith(".xcassets") || item.endsWith(".bundle")) {
|
|
371
410
|
this.$logger.debug(`Adding resource bundle: ${relativePath} for target:${targetUuid}`);
|
|
372
411
|
this.addResourceFile(project, relativePath, { target: targetUuid }, groupName);
|
|
373
412
|
}
|
|
@@ -391,7 +430,7 @@ class IOSWatchAppService {
|
|
|
391
430
|
}
|
|
392
431
|
const relativePath = path.relative(platformData.projectRoot, modulePath);
|
|
393
432
|
const stats = this.$fs.getFsStats(modulePath);
|
|
394
|
-
const isFramework = modulePath.endsWith(
|
|
433
|
+
const isFramework = modulePath.endsWith(".framework") || modulePath.endsWith(".xcframework");
|
|
395
434
|
const isFolder = stats.isDirectory() && !isFramework;
|
|
396
435
|
this.$logger.debug(`Adding module dependency: ${JSON.stringify(moduleDef)} to ${targetName}, basedir:${basedir}, isFramework:${isFramework} isFolder:${isFolder}`);
|
|
397
436
|
if (isFramework) {
|
|
@@ -405,7 +444,8 @@ class IOSWatchAppService {
|
|
|
405
444
|
else {
|
|
406
445
|
this.$logger.warn(`Unknown module type for: ${modulePath}`);
|
|
407
446
|
}
|
|
408
|
-
if (moduleDef.headerSearchPaths &&
|
|
447
|
+
if (moduleDef.headerSearchPaths &&
|
|
448
|
+
Array.isArray(moduleDef.headerSearchPaths)) {
|
|
409
449
|
for (const headerPath of moduleDef.headerSearchPaths) {
|
|
410
450
|
const resolvedPath = this.resolvePathWithBasedir(headerPath, basedir, projectData.projectDir);
|
|
411
451
|
const relPath = path.relative(platformData.projectRoot, resolvedPath);
|
|
@@ -430,12 +470,15 @@ class IOSWatchAppService {
|
|
|
430
470
|
}
|
|
431
471
|
getFolderFiles(dirPath, rootPath, excludePatterns) {
|
|
432
472
|
const result = [];
|
|
433
|
-
const files = this.$fs
|
|
473
|
+
const files = this.$fs
|
|
474
|
+
.readDirectory(dirPath)
|
|
475
|
+
.filter((fileName) => !fileName.startsWith("."));
|
|
434
476
|
for (const item of files) {
|
|
435
477
|
const itemPath = path.join(dirPath, item);
|
|
436
478
|
const stats = this.$fs.getFsStats(itemPath);
|
|
437
479
|
const relativePath = path.relative(rootPath, itemPath);
|
|
438
|
-
if (excludePatterns &&
|
|
480
|
+
if (excludePatterns &&
|
|
481
|
+
this.shouldExclude(relativePath, excludePatterns)) {
|
|
439
482
|
this.$logger.debug(`Excluding from src: ${relativePath}`);
|
|
440
483
|
continue;
|
|
441
484
|
}
|
|
@@ -458,22 +501,22 @@ class IOSWatchAppService {
|
|
|
458
501
|
var _a;
|
|
459
502
|
const moduleName = moduleDef.name || path.basename(modulePath);
|
|
460
503
|
const targetRelativePath = path.relative(platformData.projectRoot, modulePath);
|
|
461
|
-
const moduleTarget = project.addTarget(moduleName, (_a = moduleDef.targetType) !== null && _a !== void 0 ? _a :
|
|
504
|
+
const moduleTarget = project.addTarget(moduleName, (_a = moduleDef.targetType) !== null && _a !== void 0 ? _a : "framework", targetRelativePath, target.uuid);
|
|
462
505
|
this.$logger.debug(`Adding folder module ${moduleName} with path ${modulePath} with target uuid:${moduleTarget.uuid}`);
|
|
463
506
|
const { path: filePath, name, dependencies, frameworks, buildConfigurationProperties, src, resources, SPMPackages, ...otherProps } = moduleDef;
|
|
464
|
-
project.addFramework(moduleName +
|
|
507
|
+
project.addFramework(moduleName + ".framework", {
|
|
465
508
|
target: target.uuid,
|
|
466
509
|
basename: moduleName,
|
|
467
|
-
path: moduleName +
|
|
510
|
+
path: moduleName + ".framework",
|
|
468
511
|
customFramework: true,
|
|
469
|
-
explicitFileType:
|
|
470
|
-
...otherProps
|
|
512
|
+
explicitFileType: "wrapper.framework",
|
|
513
|
+
...otherProps,
|
|
471
514
|
});
|
|
472
515
|
// Add build phases
|
|
473
516
|
project.addBuildPhase([], "PBXSourcesBuildPhase", "Sources", moduleTarget.uuid);
|
|
474
517
|
project.addBuildPhase([], "PBXResourcesBuildPhase", "Resources", moduleTarget.uuid);
|
|
475
518
|
project.addBuildPhase([], "PBXFrameworksBuildPhase", "Frameworks", moduleTarget.uuid);
|
|
476
|
-
project.addBuildPhase([], "PBXCopyFilesBuildPhase", "Embed Frameworks", moduleTarget.uuid);
|
|
519
|
+
project.addBuildPhase([], "PBXCopyFilesBuildPhase", "Embed Frameworks", moduleTarget.uuid, "frameworks");
|
|
477
520
|
const files = this.getFolderFiles(modulePath, platformData.projectRoot, srcExclude);
|
|
478
521
|
this.$logger.debug(`module ${moduleName} has ${files.length} files`);
|
|
479
522
|
if (files.length > 0) {
|
|
@@ -487,11 +530,14 @@ class IOSWatchAppService {
|
|
|
487
530
|
this.$logger.debug(`Adding ${moduleDef.frameworks.length} framework(s) for module ${JSON.stringify(moduleDef)}`);
|
|
488
531
|
for (const framework of moduleDef.frameworks) {
|
|
489
532
|
this.$logger.debug(`Adding framework ${JSON.stringify(framework)} for module ${JSON.stringify(moduleDef)}`);
|
|
490
|
-
if (typeof framework ===
|
|
533
|
+
if (typeof framework === "string") {
|
|
491
534
|
project.addFramework(framework, { target: moduleTarget.uuid });
|
|
492
535
|
}
|
|
493
536
|
else {
|
|
494
|
-
project.addFramework(framework.path, {
|
|
537
|
+
project.addFramework(framework.path, {
|
|
538
|
+
target: moduleTarget.uuid,
|
|
539
|
+
...framework,
|
|
540
|
+
});
|
|
495
541
|
}
|
|
496
542
|
this.$logger.debug(`Added framework dependency: ${framework}`);
|
|
497
543
|
}
|
|
@@ -499,7 +545,7 @@ class IOSWatchAppService {
|
|
|
499
545
|
if (moduleDef.src && Array.isArray(moduleDef.src)) {
|
|
500
546
|
this.$logger.debug(`Processing ${config.src.length} custom source file(s) for target: ${moduleName}`);
|
|
501
547
|
for (const srcPath of moduleDef.src) {
|
|
502
|
-
this.addCustomSourceFile(srcPath, moduleTarget.uuid, project, projectData, platformData, srcExclude, moduleName +
|
|
548
|
+
this.addCustomSourceFile(srcPath, moduleTarget.uuid, project, projectData, platformData, srcExclude, moduleName + "Src", basedir);
|
|
503
549
|
}
|
|
504
550
|
}
|
|
505
551
|
if (moduleDef.resources && Array.isArray(moduleDef.resources)) {
|
|
@@ -510,28 +556,41 @@ class IOSWatchAppService {
|
|
|
510
556
|
}
|
|
511
557
|
if (moduleDef.dependencies && Array.isArray(moduleDef.dependencies)) {
|
|
512
558
|
const currentTargets = project.pbxNativeTargetSection();
|
|
513
|
-
const currentTargetsArray = Object.keys(currentTargets)
|
|
514
|
-
|
|
559
|
+
const currentTargetsArray = Object.keys(currentTargets)
|
|
560
|
+
.map((k) => currentTargets[k]["name"]
|
|
561
|
+
? { uuid: k, name: currentTargets[k]["name"] }
|
|
562
|
+
: null)
|
|
563
|
+
.filter((t) => !!t);
|
|
564
|
+
const targets = moduleDef.dependencies
|
|
565
|
+
.map((dependency) => currentTargetsArray.find((t) => t.name === `\"${dependency}\"`))
|
|
566
|
+
.filter((s) => !!s);
|
|
515
567
|
if (targets.length) {
|
|
516
|
-
this.$logger.debug(`Adding target dependencies ${moduleDef.dependencies} with uuids:${targets.map(t => t.uuid)} for module ${moduleDef.name}`);
|
|
517
|
-
project.addTargetDependency(moduleTarget.uuid, targets.map(t => t.uuid));
|
|
568
|
+
this.$logger.debug(`Adding target dependencies ${moduleDef.dependencies} with uuids:${targets.map((t) => t.uuid)} for module ${moduleDef.name}`);
|
|
569
|
+
project.addTargetDependency(moduleTarget.uuid, targets.map((t) => t.uuid));
|
|
518
570
|
}
|
|
519
571
|
}
|
|
520
572
|
if (moduleDef.SPMPackages && Array.isArray(moduleDef.SPMPackages)) {
|
|
521
573
|
// to be able to add SPM the file needs to be saved
|
|
522
574
|
// but it means we need to reload it again after spm packages addition
|
|
523
575
|
this.$fs.writeFile(project.filepath, project.writeSync({ omitEmptyValues: true }));
|
|
524
|
-
await this.applySPMPackagesToTargets([moduleName], platformData, basedir, moduleDef.SPMPackages.map(t => {
|
|
525
|
-
if (typeof t ===
|
|
526
|
-
return config.SPMPackages.find(s => s.name === t);
|
|
576
|
+
await this.applySPMPackagesToTargets([moduleName], platformData, basedir, moduleDef.SPMPackages.map((t) => {
|
|
577
|
+
if (typeof t === "string") {
|
|
578
|
+
return config.SPMPackages.find((s) => s.name === t);
|
|
527
579
|
}
|
|
528
580
|
return t;
|
|
529
581
|
}));
|
|
530
582
|
project.parseSync();
|
|
531
583
|
}
|
|
532
|
-
if (moduleDef.buildConfigurationProperties ||
|
|
533
|
-
|
|
534
|
-
|
|
584
|
+
if (moduleDef.buildConfigurationProperties ||
|
|
585
|
+
config.sharedModulesBuildConfigurationProperties) {
|
|
586
|
+
const configurationProperties = {
|
|
587
|
+
...(config.sharedModulesBuildConfigurationProperties || {}),
|
|
588
|
+
...(moduleDef.buildConfigurationProperties || {}),
|
|
589
|
+
};
|
|
590
|
+
this.$iOSNativeTargetService.setXcodeTargetBuildConfigurationProperties(Object.keys(configurationProperties).map((k) => ({
|
|
591
|
+
name: k,
|
|
592
|
+
value: configurationProperties[k],
|
|
593
|
+
})), moduleName, project);
|
|
535
594
|
}
|
|
536
595
|
this.$logger.debug(`Added folder-based module ${moduleName} at ${relativePath}`);
|
|
537
596
|
}
|
|
@@ -542,7 +601,9 @@ class IOSWatchAppService {
|
|
|
542
601
|
for (const flag of flags) {
|
|
543
602
|
const currentFlags = this.getBuildProperty("OTHER_LDFLAGS", targetName, project);
|
|
544
603
|
const flagsArray = currentFlags
|
|
545
|
-
?
|
|
604
|
+
? Array.isArray(currentFlags)
|
|
605
|
+
? currentFlags
|
|
606
|
+
: [currentFlags]
|
|
546
607
|
: ['"$(inherited)"'];
|
|
547
608
|
if (!flagsArray.includes(flag)) {
|
|
548
609
|
flagsArray.push(flag);
|
|
@@ -566,7 +627,8 @@ class IOSWatchAppService {
|
|
|
566
627
|
}
|
|
567
628
|
for (const key in configurations) {
|
|
568
629
|
const config = configurations[key];
|
|
569
|
-
if (config &&
|
|
630
|
+
if (config &&
|
|
631
|
+
config.buildSettings &&
|
|
570
632
|
(config.buildSettings.PRODUCT_NAME === targetName ||
|
|
571
633
|
config.buildSettings.PRODUCT_NAME === `"${targetName}"`)) {
|
|
572
634
|
return config.buildSettings[propertyName];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nativescript",
|
|
3
3
|
"main": "./lib/nativescript-cli-lib.js",
|
|
4
|
-
"version": "9.0.6-dev.
|
|
4
|
+
"version": "9.0.6-dev.2",
|
|
5
5
|
"author": "NativeScript <oss@nativescript.org>",
|
|
6
6
|
"description": "Command-line interface for building NativeScript projects",
|
|
7
7
|
"bin": {
|