nativescript 9.1.0-alpha.11 → 9.1.0-alpha.12
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.
|
@@ -201,7 +201,10 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
async createProject(frameworkDir, frameworkVersion, projectData) {
|
|
204
|
-
|
|
204
|
+
var _a;
|
|
205
|
+
const packageName = ((_a = projectData.nsConfig.android) === null || _a === void 0 ? void 0 : _a.runtimePackageName) || constants.SCOPED_ANDROID_RUNTIME_NAME;
|
|
206
|
+
if (packageName === constants.SCOPED_ANDROID_RUNTIME_NAME &&
|
|
207
|
+
semver.lt(frameworkVersion, AndroidProjectService.MIN_RUNTIME_VERSION_WITH_GRADLE)) {
|
|
205
208
|
this.$errors.fail(`The NativeScript CLI requires Android runtime ${AndroidProjectService.MIN_RUNTIME_VERSION_WITH_GRADLE} or later to work properly.`);
|
|
206
209
|
}
|
|
207
210
|
this.$fs.ensureDirectoryExists(this.getPlatformData(projectData).projectRoot);
|
|
@@ -288,7 +291,10 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
288
291
|
return null;
|
|
289
292
|
}
|
|
290
293
|
async updatePlatform(currentVersion, newVersion, canUpdate, projectData, addPlatform, removePlatforms) {
|
|
291
|
-
|
|
294
|
+
var _a;
|
|
295
|
+
const packageName = ((_a = projectData.nsConfig.android) === null || _a === void 0 ? void 0 : _a.runtimePackageName) || constants.SCOPED_ANDROID_RUNTIME_NAME;
|
|
296
|
+
if (packageName === constants.SCOPED_ANDROID_RUNTIME_NAME &&
|
|
297
|
+
semver.eq(newVersion, AndroidProjectService.MIN_RUNTIME_VERSION_WITH_GRADLE)) {
|
|
292
298
|
const platformLowercase = this.getPlatformData(projectData).normalizedPlatformName.toLowerCase();
|
|
293
299
|
await removePlatforms([platformLowercase.split("@")[0]]);
|
|
294
300
|
await addPlatform(platformLowercase);
|
|
@@ -128,7 +128,7 @@ class SPMService {
|
|
|
128
128
|
let lineBuffer = "";
|
|
129
129
|
const render = () => {
|
|
130
130
|
const elapsed = Math.round((Date.now() - startedAt) / 1000);
|
|
131
|
-
spinner.text = `${activity}… ${color_1.color.dim(`(${elapsed}
|
|
131
|
+
spinner.text = `${activity}… ${color_1.color.dim(`(${this.formatElapsed(elapsed)})`)}`;
|
|
132
132
|
};
|
|
133
133
|
// keep the elapsed timer ticking even when xcodebuild is silent (e.g.
|
|
134
134
|
// while a binary artifact downloads) so the user can see it's alive.
|
|
@@ -207,10 +207,10 @@ class SPMService {
|
|
|
207
207
|
return "Downloading Swift Package binaries (first build only)";
|
|
208
208
|
}
|
|
209
209
|
if (/^Fetching\b/i.test(trimmed)) {
|
|
210
|
-
return
|
|
210
|
+
return this.describePackageActivity("Fetching", trimmed);
|
|
211
211
|
}
|
|
212
212
|
if (/^Cloning\b/i.test(trimmed)) {
|
|
213
|
-
return
|
|
213
|
+
return this.describePackageActivity("Cloning", trimmed);
|
|
214
214
|
}
|
|
215
215
|
if (/Computing version for/i.test(trimmed)) {
|
|
216
216
|
return "Computing package versions";
|
|
@@ -223,17 +223,36 @@ class SPMService {
|
|
|
223
223
|
}
|
|
224
224
|
return null;
|
|
225
225
|
}
|
|
226
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* Builds a stable, self-explanatory activity label with the package being
|
|
228
|
+
* worked on in parentheses, e.g. "Fetching Swift Packages (Auth0.swift)".
|
|
229
|
+
*/
|
|
230
|
+
describePackageActivity(verb, line) {
|
|
231
|
+
const packageRef = this.shortenPackageRef(line);
|
|
232
|
+
return packageRef
|
|
233
|
+
? `${verb} Swift Packages (${packageRef})`
|
|
234
|
+
: `${verb} Swift Packages`;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Extracts a short, readable name from a SwiftPM repo URL/log line, or null
|
|
238
|
+
* when the line contains no URL to name the package by.
|
|
239
|
+
*/
|
|
227
240
|
shortenPackageRef(line) {
|
|
228
241
|
const match = line.match(/https?:\/\/\S+/);
|
|
229
242
|
if (!match) {
|
|
230
|
-
return
|
|
243
|
+
return null;
|
|
231
244
|
}
|
|
232
245
|
return path
|
|
233
246
|
.basename(match[0])
|
|
234
247
|
.replace(/\.git$/, "")
|
|
235
248
|
.replace(/[)\s].*$/, "");
|
|
236
249
|
}
|
|
250
|
+
/** Formats an elapsed duration in whole seconds as "5m 15s". */
|
|
251
|
+
formatElapsed(totalSeconds) {
|
|
252
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
253
|
+
const seconds = totalSeconds % 60;
|
|
254
|
+
return `${minutes}m ${seconds}s`;
|
|
255
|
+
}
|
|
237
256
|
/** True when the Xcode project references any Swift packages. */
|
|
238
257
|
hasSPMReferences(platformData, projectData) {
|
|
239
258
|
const pbxprojPath = path.join(platformData.projectRoot, `${projectData.projectName}.xcodeproj`, "project.pbxproj");
|
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.1.0-alpha.
|
|
4
|
+
"version": "9.1.0-alpha.12",
|
|
5
5
|
"author": "NativeScript <oss@nativescript.org>",
|
|
6
6
|
"description": "Command-line interface for building NativeScript projects",
|
|
7
7
|
"bin": {
|