nativescript 8.2.1 → 8.2.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.
|
@@ -22,6 +22,7 @@ const helpers_1 = require("../common/helpers");
|
|
|
22
22
|
const xml2js_1 = require("xml2js");
|
|
23
23
|
const yok_1 = require("../common/yok");
|
|
24
24
|
const _ = require("lodash");
|
|
25
|
+
const resolve_package_path_1 = require("@rigor789/resolve-package-path");
|
|
25
26
|
class AndroidPluginBuildService {
|
|
26
27
|
constructor($fs, $childProcess, $hostInfo, $androidToolsInfo, $logger, $packageManager, $projectData, $projectDataService, $devicePlatformsConstants, $errors, $filesHashService, $hooksService, $injector, $watchIgnoreListService) {
|
|
27
28
|
this.$fs = $fs;
|
|
@@ -293,9 +294,40 @@ class AndroidPluginBuildService {
|
|
|
293
294
|
return runtimeVersion;
|
|
294
295
|
});
|
|
295
296
|
}
|
|
297
|
+
getLocalGradleVersions() {
|
|
298
|
+
const installedRuntimePackageJSONPath = (0, resolve_package_path_1.resolvePackageJSONPath)(constants_1.SCOPED_ANDROID_RUNTIME_NAME, {
|
|
299
|
+
paths: [this.$projectData.projectDir],
|
|
300
|
+
});
|
|
301
|
+
if (!installedRuntimePackageJSONPath) {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
const installedRuntimePackageJSON = this.$fs.readJson(installedRuntimePackageJSONPath);
|
|
305
|
+
if (!installedRuntimePackageJSON) {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
if (installedRuntimePackageJSON.version_info) {
|
|
309
|
+
const { gradle, gradleAndroid, } = installedRuntimePackageJSON.version_info;
|
|
310
|
+
return {
|
|
311
|
+
gradleVersion: gradle,
|
|
312
|
+
gradleAndroidPluginVersion: gradleAndroid,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (installedRuntimePackageJSON.gradle) {
|
|
316
|
+
const { version, android } = installedRuntimePackageJSON.gradle;
|
|
317
|
+
return {
|
|
318
|
+
gradleVersion: version,
|
|
319
|
+
gradleAndroidPluginVersion: android,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
296
324
|
getGradleVersions(runtimeVersion) {
|
|
297
325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
298
326
|
let runtimeGradleVersions = null;
|
|
327
|
+
const localVersionInfo = this.getLocalGradleVersions();
|
|
328
|
+
if (localVersionInfo) {
|
|
329
|
+
return localVersionInfo;
|
|
330
|
+
}
|
|
299
331
|
try {
|
|
300
332
|
let output = yield this.$packageManager.view(`${constants_1.SCOPED_ANDROID_RUNTIME_NAME}@${runtimeVersion}`, { version_info: true });
|
|
301
333
|
if (!output) {
|
|
@@ -27,18 +27,24 @@ const constants_1 = require("../common/constants");
|
|
|
27
27
|
const helpers_1 = require("../common/helpers");
|
|
28
28
|
const decorators_1 = require(".././common/decorators");
|
|
29
29
|
const yok_1 = require("../common/yok");
|
|
30
|
-
function topologicalSortNativeDependencies(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
function topologicalSortNativeDependencies(dependencies, start = [], depth = 0, total = 0) {
|
|
31
|
+
if (total === 0) {
|
|
32
|
+
total = dependencies.length;
|
|
33
|
+
}
|
|
34
|
+
const sortedDeps = dependencies.reduce((sortedDeps, currentDependency) => {
|
|
35
|
+
const allSubDependenciesProcessed = currentDependency.dependencies.every((subDependency) => {
|
|
36
|
+
return sortedDeps.some((dep) => dep.name === subDependency);
|
|
37
|
+
});
|
|
38
|
+
if (allSubDependenciesProcessed) {
|
|
39
|
+
sortedDeps.push(currentDependency);
|
|
34
40
|
}
|
|
35
|
-
return
|
|
41
|
+
return sortedDeps;
|
|
36
42
|
}, start);
|
|
37
|
-
const remainingDeps =
|
|
38
|
-
if (remainingDeps.length &&
|
|
39
|
-
return topologicalSortNativeDependencies(remainingDeps,
|
|
43
|
+
const remainingDeps = dependencies.filter((nativeDep) => !sortedDeps.includes(nativeDep));
|
|
44
|
+
if (remainingDeps.length && sortedDeps.length < total) {
|
|
45
|
+
return topologicalSortNativeDependencies(remainingDeps, sortedDeps, depth + 1, total);
|
|
40
46
|
}
|
|
41
|
-
return
|
|
47
|
+
return sortedDeps;
|
|
42
48
|
}
|
|
43
49
|
class AndroidProjectService extends projectServiceBaseLib.PlatformProjectServiceBase {
|
|
44
50
|
constructor($androidToolsInfo, $errors, $fs, $logger, $projectDataService, $options, $injector, $devicePlatformsConstants, $androidPluginBuildService, $platformEnvironmentRequirements, $androidResourcesMigrationService, $filesHashService, $gradleCommandService, $gradleBuildService, $analyticsService) {
|
package/package.json
CHANGED