From 3b7de759608a7d3ab7d2ac3c70b838663108a885 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Tue, 7 Aug 2018 10:11:07 +0300 Subject: [PATCH 1/9] docs: update Changelog for 4.2.0 --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 969dc6f03c..a9a1afe7f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,39 @@ NativeScript CLI Changelog ================ +4.2.0 (2018, August 7) +== + +### New +* [Implemented #3023](https://github.com/NativeScript/nativescript-cli/issues/3023): `tns device --available-devices` to list all emulator images +* [Implemented #3717](https://github.com/NativeScript/nativescript-cli/pull/3717): Speed up device detection +* [Implemented #3718](https://github.com/NativeScript/nativescript-cli/issues/3718): Install the Android project dependencies only when needed +* [Implemented #3719](https://github.com/NativeScript/nativescript-cli/issues/3719): Build plugins with the same gradle versions as the runtime +* [Implemented #3735](https://github.com/NativeScript/nativescript-cli/pull/3735): Speed up adding native platform +* [Implemented #3750](https://github.com/NativeScript/nativescript-cli/pull/3750): Add hook for `checkForChanges` +* [Implemented #3733](https://github.com/NativeScript/nativescript-cli/issues/3733): [API] Expose API for listing and starting emulators and simulators when using CLI as library. +* [Implemented #3797](https://github.com/NativeScript/nativescript-cli/issues/3797): Use sockets to LiveSync changes on Android +* [Implemented #3798](https://github.com/NativeScript/nativescript-cli/issues/3798): Allow templates to be full application - full support + +### Fixed +* [Fixed #2485](https://github.com/NativeScript/nativescript-cli/issues/2485): EACCES (Permission denied) when livesync Angular projects on Samsung devices +* [Fixed #2547](https://github.com/NativeScript/nativescript-cli/issues/2547): `tns-android` remains inside dependencies when `tns build/run android` fails +* [Fixed #3132](https://github.com/NativeScript/nativescript-cli/issues/3132): Xcode 9: Requires Provisioning Profile Error +* [Fixed #3602](https://github.com/NativeScript/nativescript-cli/issues/3602): Livesync does not work on Android P +* [Fixed #3610](https://github.com/NativeScript/nativescript-cli/issues/3610): Livesync ignores aar file changes inside a plugin +* [Fixed #3672](https://github.com/NativeScript/nativescript-cli/issues/3672): `tns run/debug ios --syncAllFiles` with cocoapods has issues +* [Fixed #3707](https://github.com/NativeScript/nativescript-cli/issues/3707): CLI generates aar files on changes in `app/` (livesync with webpack) +* [Fixed #3710](https://github.com/NativeScript/nativescript-cli/issues/3710): CLI regenerates ALL aar files on changes in `node_modules` +* [Fixed #3723](https://github.com/NativeScript/nativescript-cli/issues/3723): iOS build for device fails with Xcode 10 beta versions +* [Fixed #3729](https://github.com/NativeScript/nativescript-cli/pull/3729): File references inside .pbxproject are incorrect when there's space in project path +* [Fixed #3741](https://github.com/NativeScript/nativescript-cli/issues/3741): Platforms folder need to be removed after a bitcode error +* [Fixed #3744](https://github.com/NativeScript/nativescript-cli/pull/3744): During all gradle operations "Gradle build" message is printed +* [Fixed #3751](https://github.com/NativeScript/nativescript-cli/issues/3751): Problem building nativescript-google-maps-sdk on Android +* [Fixed #3752](https://github.com/NativeScript/nativescript-cli/issues/3752): Increase the default timeout for debug command from 5 to 10 seconds +* [Fixed #3768](https://github.com/NativeScript/nativescript-cli/pull/3768): Skip preparation of plugins native files in case they are not changed +* [Fixed #3794](https://github.com/NativeScript/nativescript-cli/pull/3794): Update lodash to fix a security vulnerability. + + 4.1.2 (2018, June 26) == From 7ea02391767dce40e410979109d55a8b19bc93a9 Mon Sep 17 00:00:00 2001 From: Kristian Dimitrov Date: Tue, 7 Aug 2018 12:42:19 +0300 Subject: [PATCH 2/9] chore: bump version to 4.2.1 --- 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 d7c614ea19..d03661f709 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "4.2.0", + "version": "4.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cb894aa2d7..0f594a1488 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "4.2.0", + "version": "4.2.1", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": { From 60ee551e473be8ac881e76faa77e21789c1b77d6 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Tue, 7 Aug 2018 13:43:10 +0300 Subject: [PATCH 3/9] fix: incorrect project is created when template does not have App_Resources In case the project does not have App_Resources dir, CLI tries to extract the content of the default template's App_Resources. However, as the structure of the default template has changed (to v2), CLI extracts the resources to incorrect location. This makes the newly created project unbuildable. In order to fix this behavior and allow the default template to specify where App_Resources are located (via nsconfig.json file), change the logic in CLI to extract the default template to a temp location, read where the App_Resources is located and after that copy the content to the new project. --- lib/services/project-service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/services/project-service.ts b/lib/services/project-service.ts index 8e5addb6b0..a71156ee1d 100644 --- a/lib/services/project-service.ts +++ b/lib/services/project-service.ts @@ -4,6 +4,7 @@ import * as shelljs from "shelljs"; import { format } from "util"; import { exported } from "../common/decorators"; import { Hooks, TemplatesV2PackageJsonKeysToRemove } from "../constants"; +import * as temp from "temp"; export class ProjectService implements IProjectService { @@ -131,14 +132,16 @@ export class ProjectService implements IProjectService { private async ensureAppResourcesExist(projectDir: string): Promise { const projectData = this.$projectDataService.getProjectData(projectDir); - const appPath = projectData.getAppDirectoryPath(projectDir); const appResourcesDestinationPath = projectData.getAppResourcesDirectoryPath(projectDir); if (!this.$fs.exists(appResourcesDestinationPath)) { this.$fs.createDirectory(appResourcesDestinationPath); - + const tempDir = temp.mkdirSync("ns-default-template"); // the template installed doesn't have App_Resources -> get from a default template - await this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], appPath, { filter: (name: string, entry: any) => entry.path.indexOf(constants.APP_RESOURCES_FOLDER_NAME) !== -1 }); + await this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], tempDir); + const templateProjectData = this.$projectDataService.getProjectData(tempDir); + const templateAppResourcesDir = templateProjectData.getAppResourcesDirectoryPath(tempDir); + this.$fs.copyFile(path.join(templateAppResourcesDir, "*"), appResourcesDestinationPath); } } From d2d1ddbc9dc4b3c7f79ad080135a04392cf2aa57 Mon Sep 17 00:00:00 2001 From: Kristian Dimitrov Date: Tue, 7 Aug 2018 12:38:22 +0300 Subject: [PATCH 4/9] fix: cloud run fails if tns-ios version contains tags --- lib/services/ios-debugger-port-service.ts | 2 +- lib/services/livesync/livesync-service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/services/ios-debugger-port-service.ts b/lib/services/ios-debugger-port-service.ts index e16ae3e41e..8dac0bb27e 100644 --- a/lib/services/ios-debugger-port-service.ts +++ b/lib/services/ios-debugger-port-service.ts @@ -52,7 +52,7 @@ export class IOSDebuggerPortService implements IIOSDebuggerPortService { private canStartLookingForDebuggerPort(data: IProjectDir): boolean { const projectData = this.$projectDataService.getProjectData(data && data.projectDir); const frameworkVersion = this.$iOSProjectService.getFrameworkVersion(projectData); - return !frameworkVersion || semver.gt(frameworkVersion, IOSDebuggerPortService.MIN_REQUIRED_FRAMEWORK_VERSION); + return !frameworkVersion || !semver.valid(frameworkVersion) || semver.gt(frameworkVersion, IOSDebuggerPortService.MIN_REQUIRED_FRAMEWORK_VERSION); } @cache() diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index 5a6de53cd0..b7916eb699 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -459,8 +459,6 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi const platformLiveSyncService = this.getLiveSyncService(platform); const deviceBuildInfoDescriptor = _.find(deviceDescriptors, dd => dd.identifier === device.deviceInfo.identifier); - await platformLiveSyncService.prepareForLiveSync(device, projectData, liveSyncData, deviceBuildInfoDescriptor.debugOptions); - await this.ensureLatestAppPackageIsInstalledOnDevice({ device, preparedPlatforms, @@ -474,6 +472,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi env: liveSyncData.env }, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare }); + await platformLiveSyncService.prepareForLiveSync(device, projectData, liveSyncData, deviceBuildInfoDescriptor.debugOptions); + const liveSyncResultInfo = await platformLiveSyncService.fullSync({ projectData, device, syncAllFiles: liveSyncData.watchAllFiles, From 12bfeb5c2a94a4fd30d7efc21d793c6deb3aba7d Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Mon, 23 Jul 2018 17:51:34 +0300 Subject: [PATCH 5/9] fix: avoid getting logs from a wrong process or an old instance of the application --- lib/common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common b/lib/common index 44e2ee8053..7501f7545b 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 44e2ee8053ed68975d958ed4e9f5a168396e909d +Subproject commit 7501f7545b4ce1f7614449998de2815f55b227a4 From 270eddaa685125ea9160911dd20465d6fd1bd6d1 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Wed, 8 Aug 2018 18:02:24 +0300 Subject: [PATCH 6/9] fix: use `pid` logcat option only on supported Android devices --- lib/common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common b/lib/common index 7501f7545b..5e1da68399 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 7501f7545b4ce1f7614449998de2815f55b227a4 +Subproject commit 5e1da68399f8d9c6b1972b1fc5014d9bb63fd235 From c0a00767c64504b18c17929d448c4c72798af7aa Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 9 Aug 2018 08:55:38 +0300 Subject: [PATCH 7/9] fix: status of iOS Sim images and Android Emulator images are different Whenever CLI returns information for available emulators/simulators, the returned object for each of the image has a status property. For Android the status is "Running" or "Not running", for iOS it is "Connected" or "Disconnected". Unify the status properties - use "Running" and "Not running" for both of the images. Also, for iOS images, the imageIdentifier property has not been populated - fill it with the value of the identifier property, so the API will be consistent for both Android and iOS. As the property has not been populated for iOS Simulators, the events "emulatorImageFound" and "emulatorImageLost" were never triggered in case you add new iOS Simulator images. Now this should work correctly. Fix unit tests on Windows - the split by EOL when parsing the output of avdmanager executable is not working on Windows, as the EOL is `\r\n`, while the avdmanager prints results with `\n` only. Also the tests were failing on Windows due to the same reason - test case has `\n`, while split is by `\r\n`. Use some constants in the tests instead of strings for status property. --- lib/common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common b/lib/common index 5e1da68399..0405ea4eea 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 5e1da68399f8d9c6b1972b1fc5014d9bb63fd235 +Subproject commit 0405ea4eea768f4264ed68372e63094690371a86 From f7e2d607b79c0a46fef1aaea5b6376fb47f48f7d Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 9 Aug 2018 08:58:54 +0300 Subject: [PATCH 8/9] docs: update changelog for 4.2.1 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a1afe7f9..e2e4bf3540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ NativeScript CLI Changelog ================ +4.2.1 (2018, August 10) +== + +### Fixed +* [Fixed #3763](https://github.com/NativeScript/nativescript-cli/issues/3763): Duplicated entries in `tns run` log while livesyncing +* [Fixed #3802](https://github.com/NativeScript/nativescript-cli/issues/3802): Unable to use templates without `App_Resources` +* [Fixed #3803](https://github.com/NativeScript/nativescript-cli/issues/3803): `tns run ios` command fails if tns-ios version is a tag +* [Fixed #3805](https://github.com/NativeScript/nativescript-cli/issues/3805): `tns run android` fails in case you do not have Android emulator images + + 4.2.0 (2018, August 7) == From 87d7844b475c8620c65f297e673575655fd6d443 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Thu, 9 Aug 2018 16:33:07 +0300 Subject: [PATCH 9/9] fix: stop starting logcat helper when starting the app only for livesync in order to avoid duplicate logs --- lib/common | 2 +- .../livesync/android-device-livesync-sockets-service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common b/lib/common index 0405ea4eea..9100f6cc82 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 0405ea4eea768f4264ed68372e63094690371a86 +Subproject commit 9100f6cc828c6bc2c585c67c2d550425e907b7d8 diff --git a/lib/services/livesync/android-device-livesync-sockets-service.ts b/lib/services/livesync/android-device-livesync-sockets-service.ts index e2d172fda0..9a00dc1e94 100644 --- a/lib/services/livesync/android-device-livesync-sockets-service.ts +++ b/lib/services/livesync/android-device-livesync-sockets-service.ts @@ -31,7 +31,7 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa const pathToLiveSyncFile = temp.path({ prefix: "livesync" }); this.$fs.writeFile(pathToLiveSyncFile, ""); await this.device.fileSystem.putFile(pathToLiveSyncFile, this.getPathToLiveSyncFileOnDevice(deviceAppData.appIdentifier), deviceAppData.appIdentifier); - await this.device.applicationManager.startApplication({ appId: deviceAppData.appIdentifier, projectName: this.data.projectName }); + await this.device.applicationManager.startApplication({ appId: deviceAppData.appIdentifier, projectName: this.data.projectName, justLaunch: true }); await this.connectLivesyncTool(projectFilesPath, this.data.projectId); }