From c2aaed3d15c56c1428613d5607465379b9665b09 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 9 Jan 2020 10:10:06 +0200 Subject: [PATCH 1/3] chore: set release version to 6.3.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 914a1c5f07..349795898d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "6.3.1", + "version": "6.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 672fa8599d..d4c91177bb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "6.3.1", + "version": "6.3.2", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": { From d6a59ce6c28046920a63f9f49ccafbc71356be7e Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 9 Jan 2020 10:10:10 +0200 Subject: [PATCH 2/3] fix: emulator 29 is not started by default In case you have emulator with API Level 29 and other older emulators, CLI should run the latest available (29), but it doesn't. The problem is in the parsing of the string version - '9.0.0' is always newer than '10.0.0' which corresponds to API level 29. Fix the parsing, so now `tns run android` will correctly start latest available emulator in case there's nothing running. --- lib/common/mobile/android/android-emulator-services.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/common/mobile/android/android-emulator-services.ts b/lib/common/mobile/android/android-emulator-services.ts index a901981d19..414eeb1976 100644 --- a/lib/common/mobile/android/android-emulator-services.ts +++ b/lib/common/mobile/android/android-emulator-services.ts @@ -144,7 +144,15 @@ export class AndroidEmulatorServices implements Mobile.IEmulatorPlatformService } private getBestFit(emulators: Mobile.IDeviceInfo[]) { - const best = _(emulators).maxBy(emulator => emulator.version); + let best: Mobile.IDeviceInfo = null; + for (const emulator of emulators) { + const currentVersion = emulator.version && semver.coerce(emulator.version); + const currentBestVersion = best && best.version && semver.coerce(best.version); + if (!best || (currentVersion && currentBestVersion && semver.gt(currentVersion, currentBestVersion))) { + best = emulator; + } + } + const minVersion = semver.coerce(AndroidVirtualDevice.MIN_ANDROID_VERSION); const bestVersion = best && best.version && semver.coerce(best.version); From a360ba2e9cb34c3854af9420fbfcb88ccf3dff59 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 9 Jan 2020 10:41:02 +0200 Subject: [PATCH 3/3] chore: fix flaky unit test --- .../test/unit-tests/services/json-file-settings-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/test/unit-tests/services/json-file-settings-service.ts b/lib/common/test/unit-tests/services/json-file-settings-service.ts index 2ca75d297f..a7e946fcb3 100644 --- a/lib/common/test/unit-tests/services/json-file-settings-service.ts +++ b/lib/common/test/unit-tests/services/json-file-settings-service.ts @@ -129,7 +129,7 @@ describe("jsonFileSettingsService", () => { const result = await new Promise((resolve, reject) => { setTimeout(() => { jsonFileSettingsService.getSettingValue("prop1", { cacheTimeout: 1 }).then(resolve, reject); - }, 2); + }, 10); }); assert.equal(result, null);