Skip to content

Commit 637746a

Browse files
Merge pull request #1352 from NativeScript/vladimirov/merge-rel-master
Merge release in master
2 parents aff4391 + 90a4cc0 commit 637746a

15 files changed

+65
-66
lines changed

CHANGELOG.md

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

4+
1.5.2 (2015, December 12)
5+
==
6+
### New
7+
* [Implemented #1247](https://github.com/NativeScript/nativescript-cli/issues/1247): Do not kill adb server if possible.
8+
9+
### Fixed
10+
* [Fixed #956](https://github.com/NativeScript/nativescript-cli/issues/956): Better error reporting for deploy on device.
11+
* [Fixed #1210](https://github.com/NativeScript/nativescript-cli/issues/1210): LiveSync does not handle correctly removed files on iOS simulator.
12+
* [Fixes #1308](https://github.com/NativeScript/nativescript-cli/issues/1308): Livesync ends up with an endless loop for projects that have before-prepare hook that changes some project file.
13+
* [Fixed #1313](https://github.com/NativeScript/nativescript-cli/issues/1313): `tns livesync ios --watch --emulator` command does not process platform specific files.
14+
415
1.5.1 (2015, December 03)
516
==
617
### New

PLUGINS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ my-plugin/
112112
* `platforms\android\include.gradle`: This file modifies the native Android configuration of your NativeScript project such as native dependencies, build types and configurations. For more information about the format of `include.gradle`, see [`include.gradle` file](#includegradle-specification).
113113
* `platforms\ios`: This directory contains native dynamic iOS Cocoa Touch Frameworks (`.framework`) and Cocoa Touch Static Libraries (`.a`). During the plugin installation, the NativeScript CLI will copy these files to `lib\iOS` in your project and will configure the iOS project in `platforms\ios` to work with the libraries. If the library is written in Swift, only APIs exposed to Objective-C are exposed to NativeScript. In case the plugin contains a Cocoa Touch Static Library (`.a`), you must place all public headers (`.h`) under `include\<Static Library Name>\`. Make sure that the static libraries are built at least for the following processor architectures - armv7, arm64, i386.
114114
* `platforms\ios\build.xcconfig`: This file modifies the native iOS configuration of your NativeScript project such as native dependencies and configurations. For more information about the format of `build.xcconfig`, see [`build.xcconfig` file](#buildxcconfig-specification).
115-
* `platforms\ios\Podfile`: This file describes the dependency to the library that you want to use. For more information, see [CocoaPods.md](CocoaPods.md).
115+
* `platforms\ios\Podfile`: This file describes the dependency to the library that you want to use. For more information, see [the CocoaPods article](CocoaPods.md).
116116

117117
### Package.json Specification
118118

README.md

+14-48
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,14 @@ You can install and run the NativeScript CLI on Windows or OS X.
6969
> On Windows systems, you can develop, build, and deploy NativeScript projects that target Android.
7070
7171
* Windows Vista or later
72-
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/), [0.12.x](https://nodejs.org/dist/latest-v0.12.x/) or [4.2.x](https://nodejs.org/dist/latest-v4.x/) stable official release
72+
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/), [0.12.x](https://nodejs.org/dist/latest-v0.12.x/), [4.2.x](https://nodejs.org/dist/latest-v4.x/) or [5.x](https://nodejs.org/dist/latest-v5.x/) stable official release
7373
* (Optional) [Chocolatey][Chocolatey]
7474
* [JDK 8][JDK 8] or a later stable official release
7575
* [Android SDK 22][Android SDK 22] or a later stable official release
7676
* [Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
7777
* [Android Support Repository][Android Support Repository]
7878
* (Optional) [Genymotion][Genymotion]
7979

80-
If you want to develop for Android, verify that you have added the following paths in the `PATH` system environment variable.
81-
82-
```
83-
Path to tools directory in the Android SDK installation folder
84-
Path to platform-tools directory in the Android SDK installation folder
85-
```
86-
87-
For example: PATH=...;...;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools;
88-
8980
If you have installed Chocolatey, you can complete these steps to set up JDK, and Android SDK.
9081

9182
1. Run a Windows command prompt.
@@ -97,7 +88,7 @@ If you have installed Chocolatey, you can complete these steps to set up JDK, an
9788
1. If not present, create the following environment variables.
9889

9990
```
100-
JAVA_HOME=Path to the jdk* install folder
91+
JAVA_HOME=Path to the jdk* install directory
10192
```
10293

10394
For example: JAVA_HOME=C:\Program Files\Java\jdk1.8.0_66
@@ -107,19 +98,14 @@ If you have installed Chocolatey, you can complete these steps to set up JDK, an
10798
```
10899

109100
For example: ANDROID_HOME=C:\Android\android-sdk
101+
102+
> NOTE: This is the directory that contains `tools` and `platform-tools` directories.
103+
110104
1. To install the Android SDK, run the following command.
111105

112106
```Shell
113107
choco install android-sdk
114108
```
115-
1. If not present, add the following file path to the `PATH` system environment variable.
116-
117-
```
118-
Path to tools directory in the Android SDK installation folder
119-
Path to platform-tools directory in the Android SDK installation folder
120-
```
121-
122-
For example: PATH=...;...;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools
123109
1. To update the Android SDK to 22 or later, run the following command.
124110

125111
```Shell
@@ -139,7 +125,7 @@ android update sdk --filter tools,platform-tools,android-22,build-tools-22.0.1,s
139125
> On OS X systems, you can develop, build, and deploy NativeScript projects that target iOS and Android.
140126
141127
* OS X Mavericks
142-
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/) or [0.12.x](https://nodejs.org/dist/latest-v0.12.x/), or [4.2.x](https://nodejs.org/dist/latest-v4.x/) stable official release
128+
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/), [0.12.x](https://nodejs.org/dist/latest-v0.12.x/), [4.2.x](https://nodejs.org/dist/latest-v4.x/) or [5.x](https://nodejs.org/dist/latest-v5.x/) stable official release
143129
* For iOS development
144130
* [Latest Xcode][12]
145131
* [Xcode command-line tools][12]
@@ -151,22 +137,10 @@ android update sdk --filter tools,platform-tools,android-22,build-tools-22.0.1,s
151137
* [Android Support Repository][Android Support Repository]
152138
* (Optional) [Genymotion][Genymotion]
153139

154-
If you want to develop for Android, verify that you have added the following paths in your `PATH` in `~/.bash_profile`.
155-
156-
```
157-
Path to the tools subdirectory in the Android SDK installation directory
158-
Path to the platform-tools subdirectory in the Android SDK installation directory
159-
```
160-
161-
For example:
162-
```
163-
export PATH=${PATH}:/Applications/Android\ Studio.app/sdk/tools:/Applications/Android\ Studio.app/sdk/platform-tools
164-
```
165-
166140
If not present, create the following environment variables.
167141

168142
```
169-
JAVA_HOME=Path to the jdk* install folder
143+
JAVA_HOME=Path to the jdk* install directory
170144
```
171145

172146
For example: JAVA_HOME=/usr/bin/java
@@ -175,7 +149,9 @@ For example: JAVA_HOME=/usr/bin/java
175149
ANDROID_HOME=Path to Android installation directory
176150
```
177151

178-
For example: ANDROID_HOME=/Applications/Android\ Studio.app/sdk/
152+
For example: ANDROID_HOME=/usr/local/Cellar/android-sdk/24/
153+
154+
> NOTE: This is the directory that contains `tools` and `platform-tools` directories.
179155
180156
You can install the required Android tools with the following command:
181157

@@ -188,7 +164,7 @@ echo yes | android update sdk --filter tools,platform-tools,android-22,build-too
188164
> On Linux systems, you can develop, build, and deploy NativeScript projects that target Android.
189165
190166
* Ubuntu 14.04 LTS
191-
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/) or [0.12.x](https://nodejs.org/dist/latest-v0.12.x/), or [4.2.x](https://nodejs.org/dist/latest-v4.x/) stable official release
167+
* The latest Node.js [0.10.x](https://nodejs.org/dist/latest-v0.10.x/), [0.12.x](https://nodejs.org/dist/latest-v0.12.x/), [4.2.x](https://nodejs.org/dist/latest-v4.x/) or [5.x](https://nodejs.org/dist/latest-v5.x/) stable official release
192168

193169
> **TIP:** You can follow the instructions provided [here](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) to install Node.js on your system.
194170

@@ -209,22 +185,10 @@ echo yes | android update sdk --filter tools,platform-tools,android-22,build-too
209185
* [Android Support Repository][Android Support Repository]
210186
* (Optional) [Genymotion][Genymotion]
211187

212-
Verify that you have added the following paths in your `PATH`.
213-
214-
```
215-
Path to the tools subdirectory in the Android SDK installation directory
216-
Path to the platform-tools subdirectory in the Android SDK installation directory
217-
```
218-
219-
For example:
220-
```
221-
export PATH=${PATH}:/home/user/android-sdk/tools:/home/user/android-sdk/platform-tools
222-
```
223-
224188
If not present, create the following environment variables.
225189

226190
```
227-
JAVA_HOME=Path to the jdk* install folder
191+
JAVA_HOME=Path to the jdk* install directory
228192
```
229193

230194
For example: JAVA_HOME=/usr/bin/java
@@ -235,6 +199,8 @@ ANDROID_HOME=Path to Android installation directory
235199

236200
For example: ANDROID_HOME=/home/user/android-sdk
237201

202+
> NOTE: This is the directory that contains `tools` and `platform-tools` directories.
203+
238204
You can install required Android Tools with the following command.
239205

240206
```Shell

docs/man_pages/project/testing/emulate-android.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ Before running your app in the Android emulator from the Android SDK, verify tha
3636
* Verify that you have installed Genymotion.
3737
* On Windows and Linux systems, verify that you have added the Genymotion installation directory to the `PATH` environment variable.
3838
* On OS X systems, verify that you have added the following paths to the PATH environment variable.
39-
* `/Applications/Genymotion.app/Contents/MacOS/`
40-
* `/Applications/Genymotion Shell.app/Contents/MacOS/`
39+
* For Genymotion earlier than 2.6:
40+
* `/Applications/Genymotion.app/Contents/MacOS/`
41+
* `/Applications/Genymotion Shell.app/Contents/MacOS/`
42+
* For Genymotion 2.6:
43+
* `/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS`
44+
* `/Applications/Genymotion Shell.app/Contents/MacOS/`
4145

4246
### Command Limitations
4347

docs/man_pages/project/testing/run-android.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ Before running your app in the Android emulator from the Android SDK, verify tha
3434
* Verify that you have installed Genymotion.
3535
* On Windows and Linux systems, verify that you have added the Genymotion installation directory to the `PATH` environment variable.
3636
* On OS X systems, verify that you have added the following paths to the `PATH` environment variable.
37-
* `/Applications/Genymotion.app/Contents/MacOS/`
38-
* `/Applications/Genymotion Shell.app/Contents/MacOS/`
37+
* For Genymotion earlier than 2.6:
38+
* `/Applications/Genymotion.app/Contents/MacOS/`
39+
* `/Applications/Genymotion Shell.app/Contents/MacOS/`
40+
* For Genymotion 2.6:
41+
* `/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS`
42+
* `/Applications/Genymotion Shell.app/Contents/MacOS/`
43+
3944

4045
### Command Limitations
4146

lib/bootstrap.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require("./common/bootstrap");
2+
$injector.require("logger", "./common/logger");
23
$injector.require("config", "./config");
34
$injector.require("options", "./options");
45
// note: order above is important!

lib/declarations.ts

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ interface IOptions extends ICommonOptions {
8787
compileSdk: number;
8888
port: Number;
8989
copyTo: string;
90+
baseConfig: string;
9091
}
9192

9293
interface IProjectFilesManager {

lib/options.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class Options extends commonOptionsLibPath.OptionsBase {
3434
compileSdk: {type: OptionType.Number },
3535
port: { type: OptionType.Number },
3636
copyTo: { type: OptionType.String },
37+
baseConfig: { type: OptionType.String }
3738
},
3839
path.join($hostInfo.isWindows ? process.env.LocalAppData : path.join(osenv.home(), ".local/share"), ".nativescript-cli"),
3940
$errors, $staticConfig);

lib/services/android-project-service.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
222222
}
223223

224224
let gradleBin = this.useGradleWrapper(projectRoot) ? path.join(projectRoot, "gradlew") : "gradle";
225+
if (this.$hostInfo.isWindows) {
226+
gradleBin += ".bat"; // cmd command line parsing rules are weird. Avoid issues with quotes. See https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/lib/builders/GradleBuilder.js for another approach
227+
}
225228
this.spawn(gradleBin, buildOptions, { stdio: "inherit", cwd: this.platformData.projectRoot }).wait();
226229
} else {
227230
this.checkAnt().wait();
@@ -368,11 +371,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
368371
}
369372

370373
private spawn(command: string, args: string[], opts?: any): IFuture<void> {
371-
if (this.$hostInfo.isWindows) {
372-
args.unshift('/s', '/c', command);
373-
command = process.env.COMSPEC || 'cmd.exe';
374-
}
375-
376374
return this.$childProcess.spawnFromEvent(command, args, "close", opts || { stdio: "inherit"});
377375
}
378376

lib/services/doctor-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ class DoctorService implements IDoctorService {
4747
}
4848

4949
if(!sysInfo.cocoapodVer) {
50-
this.$logger.warn("WARNING: CocoaPod is not installed or is not configured properly.");
50+
this.$logger.warn("WARNING: CocoaPods is not installed or is not configured properly.");
5151
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
52-
+ "To be able to build such projects, verify that you have installed CocoaPod.");
52+
+ "To be able to build such projects, verify that you have installed CocoaPods.");
5353
result = true;
5454
}
5555

lib/services/platform-service.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export class PlatformService implements IPlatformService {
113113

114114
let sourceFrameworkDir = isFrameworkPathDirectory && this.$options.symlink ? path.join(this.$options.frameworkPath, "framework") : frameworkDir;
115115
platformData.platformProjectService.createProject(path.resolve(sourceFrameworkDir), installedVersion).wait();
116+
if(this.$options.baseConfig) {
117+
let newConfigFile = path.resolve(this.$options.baseConfig);
118+
this.$logger.trace(`Replacing '${platformData.configurationFilePath}' with '${newConfigFile}'.`);
119+
this.$fs.copyFile(newConfigFile, platformData.configurationFilePath).wait();
120+
}
116121

117122
if(isFrameworkPathDirectory || isFrameworkPathNotSymlinkedFile) {
118123
// Need to remove unneeded node_modules folder
@@ -224,7 +229,7 @@ export class PlatformService implements IPlatformService {
224229
.value();
225230

226231
// Copy all files from app dir, but make sure to exclude tns_modules
227-
let sourceFiles = this.$fs.enumerateFilesInDirectorySync(appSourceDirectoryPath);
232+
let sourceFiles = this.$fs.enumerateFilesInDirectorySync(appSourceDirectoryPath, null, { includeEmptyDirectories: true });
228233

229234
if (this.$options.release) {
230235
sourceFiles = sourceFiles.filter(source => source !== 'tests');
@@ -242,8 +247,11 @@ export class PlatformService implements IPlatformService {
242247
// Remove .ts and .js.map files
243248
PlatformService.EXCLUDE_FILES_PATTERN.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, {nocase: true})));
244249
let copyFileFutures = sourceFiles.map(source => {
245-
let destinationFile = path.join(appDestinationDirectoryPath, path.relative(appSourceDirectoryPath, source));
246-
return this.$fs.copyFile(source, destinationFile);
250+
let destinationPath = path.join(appDestinationDirectoryPath, path.relative(appSourceDirectoryPath, source));
251+
if (this.$fs.getFsStats(source).wait().isDirectory()) {
252+
return this.$fs.createDirectory(destinationPath);
253+
}
254+
return this.$fs.copyFile(source, destinationPath);
247255
});
248256
Future.wait(copyFileFutures);
249257

lib/services/plugins-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class PluginsService implements IPluginsService {
114114
npmInstallationManager.addToCache(platformData.frameworkPackageName, frameworkVersion).wait();
115115

116116
let cachedPackagePath = npmInstallationManager.getCachedPackagePath(platformData.frameworkPackageName, frameworkVersion);
117-
let cachedConfigurationFilePath = path.join(cachedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME, platformData.relativeToFrameworkConfigurationFilePath);
117+
let cachedConfigurationFilePath = this.$options.baseConfig ? path.resolve(this.$options.baseConfig) : path.join(cachedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME, platformData.relativeToFrameworkConfigurationFilePath);
118118
let cachedConfigurationFileContent = this.$fs.readText(cachedConfigurationFilePath).wait();
119119
this.$fs.writeFile(platformData.configurationFilePath, cachedConfigurationFileContent).wait();
120120

lib/services/usb-livesync-service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
157157

158158
let getApplicationPathForiOSSimulatorAction = (): IFuture<string> => {
159159
return (() => {
160+
if (!this.$fs.exists(platformData.emulatorBuildOutputPath).wait()) {
161+
this.$platformService.buildPlatform(platformData.normalizedPlatformName).wait();
162+
}
163+
160164
return this.$platformService.getLatestApplicationPackageForEmulator(platformData).wait().packageName;
161165
}).future<string>()();
162166
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"ref-struct": "https://github.com/telerik/ref-struct/tarball/v1.0.2.1",
6767
"rimraf": "2.4.2",
6868
"semver": "5.0.1",
69-
"shelljs": "0.5.1",
69+
"shelljs": "0.5.3",
7070
"tabtab": "https://github.com/Icenium/node-tabtab/tarball/master",
7171
"temp": "0.8.3",
7272
"through2": "2.0.0",

0 commit comments

Comments
 (0)