Skip to content

Commit d98b7fd

Browse files
Fatme HavaluovaFatme Havaluova
authored andcommitted
Merge branch 'release' into fatme/merge-release-0.9.2
Conflicts: lib/definitions/project.d.ts lib/services/android-project-service.ts lib/services/ios-project-service.ts test/stubs.ts
2 parents 987adf3 + a5c9481 commit d98b7fd

File tree

6 files changed

+79
-10
lines changed

6 files changed

+79
-10
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
NativeScript CLI Changelog
2+
================
3+
4+
0.9.2 (2015, March 17)
5+
===
6+
7+
### New
8+
9+
* [Implemented #305](https://github.com/NativeScript/nativescript-cli/issues/305), [#322](https://github.com/NativeScript/nativescript-cli/issues/322): You can quickly add or update your platform runtime to a specific version by running `tns platform update platform@version`<br/>For example: `tns platform update ios@0.9.2-beta`<br/>The NativeScript team will publish experimental support for the latest versions of iOS and Android.<br/>To list all available versions for android, run $ npm view tns-android versions<br/>To list only experimental versions for android, run $ npm view tns-android dist-tags
10+
To list all available versions for ios, run $ npm view tns-ios versions<br/>To list only experimental versions for ios, run $ npm view tns-ios dist-tags
11+
* [Implemented #302](https://github.com/NativeScript/nativescript-cli/issues/302): You can configure proxy settings for the NativeScript CLI.
12+
13+
### Fixed
14+
15+
* [Fixed #299](https://github.com/NativeScript/nativescript-cli/issues/299): You cannot build the default `Hello World` app for Android on OS X systems.
16+
* [Fixed #297](https://github.com/NativeScript/nativescript-cli/issues/297): You cannot install the NativeScript CLI.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The NativeScript CLI lets you create, build, and deploy NativeScript-based proje
1010
* [Supported Platforms](#supported-platforms "The mobile platforms you can target with NativeScript")
1111
* [System Requirements](#system-requirements "The hardware and software requirements for setting up and working with the NativeScript CLI")
1212
* [Installation](#installation "How to configure and install the NativeScript CLI")
13+
* [Install the NativeScript CLI](#install-the-nativescript-cli)
14+
* [Configure Proxy Usage](#configure-proxy-usage)
1315
* [Quick Start](#quick-start "Get started with the NativeScript CLI")
1416
* [The Commands](#the-commands)
1517
* [Create Project](#create-project)
@@ -203,6 +205,8 @@ export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android Studio.app/s
203205
Installation
204206
===
205207

208+
## Install the NativeScript CLI
209+
206210
The NativeScript CLI is available for installing as an npm package.
207211

208212
In the command prompt, run the following command.
@@ -213,6 +217,18 @@ npm install nativescript -g
213217

214218
> On OS X and Linux systems, you might need to run this command using sudo.
215219
220+
## Configure Proxy Usage
221+
222+
If you are working with the NativeScript CLI behind a web proxy, you might need to configure your proxy settings.
223+
224+
1. On your file system, locate the directory where the **nativescript** npm package is installed.
225+
1. In a text editor, open `config` &#8594; `config.json`.
226+
1. Set `USE_PROXY` to `true`.
227+
1. Set `PROXY_PORT`.
228+
1. Set `PROXY_HOSTNAME`.
229+
230+
> Make sure to preserve the quotation marks and commas as in the initial `config.json` file.
231+
216232
[Back to Top][1]
217233

218234
Quick Start
@@ -334,6 +350,9 @@ For more information about the structure of Android native projects, see [Androi
334350

335351
For more information about the structure iOS native projects, see [Code Organization in Xcode Projects](http://akosma.com/2009/07/28/code-organization-in-xcode-projects/).
336352

353+
> **TIP:** The NativeScript team provides experimental support for the latest versions of iOS and Android. You can choose which platform runtime to use in your project by running `tns platform add <platform>@<Version>`<br/>To list all available versions for android, run $ npm view tns-android versions<br/>To list only experimental versions for android, run $ npm view tns-android dist-tags
354+
To list all available versions for ios, run $ npm view tns-ios versions<br/>To list only experimental versions for ios, run $ npm view tns-ios dist-tags
355+
337356
[Back to Top][1]
338357

339358
## Develop Your Project

lib/services/android-project-service.ts

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import os = require("os");
1414
class AndroidProjectService implements IPlatformProjectService {
1515
private SUPPORTED_TARGETS = ["android-17", "android-18", "android-19", "android-21"];
1616
private static METADATA_DIRNAME = "__metadata";
17+
private static RES_DIRNAME = "res";
18+
private static VALUES_DIRNAME = "values";
19+
private static VALUES_VERSION_DIRNAME_PREFIX = AndroidProjectService.VALUES_DIRNAME + "-v";
20+
1721
private targetApi: string;
1822

1923
constructor(private $androidEmulatorServices: Mobile.IEmulatorPlatformServices,
@@ -53,19 +57,20 @@ class AndroidProjectService implements IPlatformProjectService {
5357
public createProject(projectRoot: string, frameworkDir: string): IFuture<void> {
5458
return (() => {
5559
this.$fs.ensureDirectoryExists(projectRoot).wait();
56-
60+
var newTarget = this.getLatestValidAndroidTarget(frameworkDir).wait();
61+
var versionNumber = _.last(newTarget.split("-"));
5762
if(options.symlink) {
58-
this.copy(projectRoot, frameworkDir, "res", "-R").wait();
63+
this.copyResValues(projectRoot, frameworkDir, versionNumber).wait();
5964
this.copy(projectRoot, frameworkDir, ".project AndroidManifest.xml project.properties", "-f").wait();
6065

6166
this.symlinkDirectory("assets", projectRoot, frameworkDir).wait();
6267
this.symlinkDirectory("libs", projectRoot, frameworkDir).wait();
6368
} else {
64-
this.copy(projectRoot, frameworkDir, "assets libs res", "-R").wait();
69+
this.copyResValues(projectRoot, frameworkDir, versionNumber).wait();
70+
this.copy(projectRoot, frameworkDir, "assets libs", "-R").wait();
6571
this.copy(projectRoot, frameworkDir, ".project AndroidManifest.xml project.properties", "-f").wait();
6672
}
6773

68-
var newTarget = this.getLatestValidAndroidTarget(frameworkDir).wait();
6974
if(newTarget) {
7075
this.updateTarget(projectRoot, newTarget).wait();
7176
}
@@ -79,6 +84,21 @@ class AndroidProjectService implements IPlatformProjectService {
7984
}).future<any>()();
8085
}
8186

87+
private copyResValues(projectRoot: string, frameworkDir: string, versionNumber: string): IFuture<void> {
88+
return (() => {
89+
var resSourceDir = path.join(frameworkDir, AndroidProjectService.RES_DIRNAME);
90+
var resDestinationDir = path.join(projectRoot, AndroidProjectService.RES_DIRNAME);
91+
this.$fs.createDirectory(resDestinationDir).wait();
92+
var versionDirName = AndroidProjectService.VALUES_VERSION_DIRNAME_PREFIX + versionNumber;
93+
var directoriesToCopy = [AndroidProjectService.VALUES_DIRNAME];
94+
if(this.$fs.exists(path.join(resSourceDir, versionDirName)).wait()) {
95+
directoriesToCopy.push(versionDirName);
96+
}
97+
98+
this.copy(resDestinationDir, resSourceDir, directoriesToCopy.join(" "), "-R").wait();
99+
}).future<void>()();
100+
}
101+
82102
public interpolateData(projectRoot: string): IFuture<void> {
83103
return (() => {
84104
// Interpolate the activity name and package

lib/services/ios-project-service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,16 @@ class IOSProjectService implements IPlatformProjectService {
8989

9090
public interpolateData(projectRoot: string): IFuture<void> {
9191
return (() => {
92+
var infoPlistFilePath = path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER, util.format("%s-%s", IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER, "Info.plist"));
93+
shell.sed('-i', "__CFBundleIdentifier__", this.$projectData.projectId, infoPlistFilePath);
94+
9295
this.replaceFileName("-Info.plist", path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)).wait();
9396
this.replaceFileName("-Prefix.pch", path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)).wait();
9497
this.replaceFileName(IOSProjectService.XCODE_PROJECT_EXT_NAME, projectRoot).wait();
9598

9699
var pbxprojFilePath = path.join(projectRoot, this.$projectData.projectName + IOSProjectService.XCODE_PROJECT_EXT_NAME, "project.pbxproj");
97100
this.replaceFileContent(pbxprojFilePath).wait();
101+
98102
}).future<void>()();
99103
}
100104

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
33
"preferGlobal": true,
4-
"version": "0.9.1",
4+
"version": "0.9.2",
55
"author": "Telerik <support@telerik.com>",
66
"description": "Command-line interface for building NativeScript projects",
77
"bin": {

resources/help.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,20 @@ Lists all platforms that the project currently targets. You can build and deploy
108108
--[platform|add]--
109109

110110
Usage:
111-
$ tns platform add <Platform> [--frameworkPath <File Path>] [--symlink]
111+
$ tns platform add <Platform>[@<Version>] [--frameworkPath <File Path>] [--symlink]
112112

113113
Platform-specific usage:
114114
$ tns platform add android [--frameworkPath <File Path>] [--symlink]
115-
$ tns platform add ios [--frameworkPath <File Path>] [--symlink]
115+
$ tns platform add android[@<Version>] [--frameworkPath <File Path>] [--symlink]
116+
$ tns platform add ios [--frameworkPath <File Path>] [--symlink]
117+
$ tns platform add ios[@<Version>] [--frameworkPath <File Path>] [--symlink]
116118

117119
Configures the current project to target the selected platform.
118120

121+
<Version> is any available version of the respective platform runtime published in npm. If @<Version> is not specified, the NativeScript CLI installs the latest stable runtime for the selected platform.
122+
To list all available versions for android, run $ npm view tns-android versions. To list only experimental versions for android, run $ npm view tns-android dist-tags.
123+
To list all available versions for ios, run $ npm view tns-ios versions. To list only experimental versions for ios, run $ npm view tns-ios dist-tags.
124+
119125
<File Path> is the complete path to a valid npm package or a directory that contains a NativeScript runtime for the selected platform.
120126

121127
When you add a target platform, the NativeScript CLI adds a corresponding platform-specific subdirectory under the platforms directory. This platform-specific directory contains the necessary files to let you build your project for the target platform.
@@ -152,11 +158,15 @@ This operation deletes the subdirectory for the selected platform from the platf
152158
--[platform|update]--
153159

154160
Usage:
155-
$ tns platform update <Platform>
161+
$ tns platform update <Platform>[@<Version>]
156162

157163
Platform-specific usage:
158-
$ tns platform update android
159-
$ tns platform update ios
164+
$ tns platform update android[@<Version>]
165+
$ tns platform update ios[@<Version>]
166+
167+
<Version> is any available version of the respective platform runtime published in npm. If @<Version> is not specified, the NativeScript CLI installs the latest stable runtime for the selected platform.
168+
To list all available versions for android, run $ npm view tns-android versions. To list only experimental versions for android, run $ npm view tns-android dist-tags.
169+
To list all available versions for ios, run $ npm view tns-ios versions. To list only experimental versions for ios, run $ npm view tns-ios dist-tags.
160170

161171
Updates the NativeScript runtime for the specified platform.
162172
--[/]--

0 commit comments

Comments
 (0)