Skip to content

Commit a4f5b45

Browse files
committed
Merge branch 'release' into fatme/merge-rel-master
# Conflicts: # lib/common # npm-shrinkwrap.json # package.json
2 parents 1084a26 + 5fa0308 commit a4f5b45

6 files changed

+54
-8
lines changed

CHANGELOG.md

+43
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
11
NativeScript CLI Changelog
22
================
33

4+
4.2.1 (2018, August 10)
5+
==
6+
7+
### Fixed
8+
* [Fixed #3763](https://github.com/NativeScript/nativescript-cli/issues/3763): Duplicated entries in `tns run` log while livesyncing
9+
* [Fixed #3802](https://github.com/NativeScript/nativescript-cli/issues/3802): Unable to use templates without `App_Resources`
10+
* [Fixed #3803](https://github.com/NativeScript/nativescript-cli/issues/3803): `tns run ios` command fails if tns-ios version is a tag
11+
* [Fixed #3805](https://github.com/NativeScript/nativescript-cli/issues/3805): `tns run android` fails in case you do not have Android emulator images
12+
13+
14+
4.2.0 (2018, August 7)
15+
==
16+
17+
### New
18+
* [Implemented #3023](https://github.com/NativeScript/nativescript-cli/issues/3023): `tns device --available-devices` to list all emulator images
19+
* [Implemented #3717](https://github.com/NativeScript/nativescript-cli/pull/3717): Speed up device detection
20+
* [Implemented #3718](https://github.com/NativeScript/nativescript-cli/issues/3718): Install the Android project dependencies only when needed
21+
* [Implemented #3719](https://github.com/NativeScript/nativescript-cli/issues/3719): Build plugins with the same gradle versions as the runtime
22+
* [Implemented #3735](https://github.com/NativeScript/nativescript-cli/pull/3735): Speed up adding native platform
23+
* [Implemented #3750](https://github.com/NativeScript/nativescript-cli/pull/3750): Add hook for `checkForChanges`
24+
* [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.
25+
* [Implemented #3797](https://github.com/NativeScript/nativescript-cli/issues/3797): Use sockets to LiveSync changes on Android
26+
* [Implemented #3798](https://github.com/NativeScript/nativescript-cli/issues/3798): Allow templates to be full application - full support
27+
28+
### Fixed
29+
* [Fixed #2485](https://github.com/NativeScript/nativescript-cli/issues/2485): EACCES (Permission denied) when livesync Angular projects on Samsung devices
30+
* [Fixed #2547](https://github.com/NativeScript/nativescript-cli/issues/2547): `tns-android` remains inside dependencies when `tns build/run android` fails
31+
* [Fixed #3132](https://github.com/NativeScript/nativescript-cli/issues/3132): Xcode 9: Requires Provisioning Profile Error
32+
* [Fixed #3602](https://github.com/NativeScript/nativescript-cli/issues/3602): Livesync does not work on Android P
33+
* [Fixed #3610](https://github.com/NativeScript/nativescript-cli/issues/3610): Livesync ignores aar file changes inside a plugin
34+
* [Fixed #3672](https://github.com/NativeScript/nativescript-cli/issues/3672): `tns run/debug ios --syncAllFiles` with cocoapods has issues
35+
* [Fixed #3707](https://github.com/NativeScript/nativescript-cli/issues/3707): CLI generates aar files on changes in `app/` (livesync with webpack)
36+
* [Fixed #3710](https://github.com/NativeScript/nativescript-cli/issues/3710): CLI regenerates ALL aar files on changes in `node_modules`
37+
* [Fixed #3723](https://github.com/NativeScript/nativescript-cli/issues/3723): iOS build for device fails with Xcode 10 beta versions
38+
* [Fixed #3729](https://github.com/NativeScript/nativescript-cli/pull/3729): File references inside .pbxproject are incorrect when there's space in project path
39+
* [Fixed #3741](https://github.com/NativeScript/nativescript-cli/issues/3741): Platforms folder need to be removed after a bitcode error
40+
* [Fixed #3744](https://github.com/NativeScript/nativescript-cli/pull/3744): During all gradle operations "Gradle build" message is printed
41+
* [Fixed #3751](https://github.com/NativeScript/nativescript-cli/issues/3751): Problem building nativescript-google-maps-sdk on Android
42+
* [Fixed #3752](https://github.com/NativeScript/nativescript-cli/issues/3752): Increase the default timeout for debug command from 5 to 10 seconds
43+
* [Fixed #3768](https://github.com/NativeScript/nativescript-cli/pull/3768): Skip preparation of plugins native files in case they are not changed
44+
* [Fixed #3794](https://github.com/NativeScript/nativescript-cli/pull/3794): Update lodash to fix a security vulnerability.
45+
46+
447
4.1.2 (2018, June 26)
548
==
649

lib/services/ios-debugger-port-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class IOSDebuggerPortService implements IIOSDebuggerPortService {
5252
private canStartLookingForDebuggerPort(data: IProjectDir): boolean {
5353
const projectData = this.$projectDataService.getProjectData(data && data.projectDir);
5454
const frameworkVersion = this.$iOSProjectService.getFrameworkVersion(projectData);
55-
return !frameworkVersion || semver.gt(frameworkVersion, IOSDebuggerPortService.MIN_REQUIRED_FRAMEWORK_VERSION);
55+
return !frameworkVersion || !semver.valid(frameworkVersion) || semver.gt(frameworkVersion, IOSDebuggerPortService.MIN_REQUIRED_FRAMEWORK_VERSION);
5656
}
5757

5858
@cache()

lib/services/livesync/android-device-livesync-sockets-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
3131
const pathToLiveSyncFile = temp.path({ prefix: "livesync" });
3232
this.$fs.writeFile(pathToLiveSyncFile, "");
3333
await this.device.fileSystem.putFile(pathToLiveSyncFile, this.getPathToLiveSyncFileOnDevice(deviceAppData.appIdentifier), deviceAppData.appIdentifier);
34-
await this.device.applicationManager.startApplication({ appId: deviceAppData.appIdentifier, projectName: this.data.projectName });
34+
await this.device.applicationManager.startApplication({ appId: deviceAppData.appIdentifier, projectName: this.data.projectName, justLaunch: true });
3535
await this.connectLivesyncTool(projectFilesPath, this.data.projectId);
3636
}
3737

lib/services/livesync/livesync-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,6 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
459459
const platformLiveSyncService = this.getLiveSyncService(platform);
460460
const deviceBuildInfoDescriptor = _.find(deviceDescriptors, dd => dd.identifier === device.deviceInfo.identifier);
461461

462-
await platformLiveSyncService.prepareForLiveSync(device, projectData, liveSyncData, deviceBuildInfoDescriptor.debugOptions);
463-
464462
await this.ensureLatestAppPackageIsInstalledOnDevice({
465463
device,
466464
preparedPlatforms,
@@ -474,6 +472,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
474472
env: liveSyncData.env
475473
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });
476474

475+
await platformLiveSyncService.prepareForLiveSync(device, projectData, liveSyncData, deviceBuildInfoDescriptor.debugOptions);
476+
477477
const liveSyncResultInfo = await platformLiveSyncService.fullSync({
478478
projectData, device,
479479
syncAllFiles: liveSyncData.watchAllFiles,

lib/services/project-service.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as shelljs from "shelljs";
44
import { format } from "util";
55
import { exported } from "../common/decorators";
66
import { Hooks, TemplatesV2PackageJsonKeysToRemove } from "../constants";
7+
import * as temp from "temp";
78

89
export class ProjectService implements IProjectService {
910

@@ -131,14 +132,16 @@ export class ProjectService implements IProjectService {
131132

132133
private async ensureAppResourcesExist(projectDir: string): Promise<void> {
133134
const projectData = this.$projectDataService.getProjectData(projectDir);
134-
const appPath = projectData.getAppDirectoryPath(projectDir);
135135
const appResourcesDestinationPath = projectData.getAppResourcesDirectoryPath(projectDir);
136136

137137
if (!this.$fs.exists(appResourcesDestinationPath)) {
138138
this.$fs.createDirectory(appResourcesDestinationPath);
139-
139+
const tempDir = temp.mkdirSync("ns-default-template");
140140
// the template installed doesn't have App_Resources -> get from a default template
141-
await this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], appPath, { filter: (name: string, entry: any) => entry.path.indexOf(constants.APP_RESOURCES_FOLDER_NAME) !== -1 });
141+
await this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], tempDir);
142+
const templateProjectData = this.$projectDataService.getProjectData(tempDir);
143+
const templateAppResourcesDir = templateProjectData.getAppResourcesDirectoryPath(tempDir);
144+
this.$fs.copyFile(path.join(templateAppResourcesDir, "*"), appResourcesDestinationPath);
142145
}
143146
}
144147

0 commit comments

Comments
 (0)