Skip to content

Commit 20295e0

Browse files
Update README.md for gradle builds
Update README in order to describe new sys requirements.
1 parent c291f2c commit 20295e0

File tree

1 file changed

+95
-38
lines changed

1 file changed

+95
-38
lines changed

README.md

Lines changed: 95 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -69,52 +69,60 @@ 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-
* [Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
72+
* [Node.js 0.10.35][Node.js 0.10.35] or a later stable 0.x release
7373
* (Optional) [Chocolatey][Chocolatey]
7474
* [JDK 8][JDK 8] or a later stable official release
75-
* [Apache Ant 1.8][Apache Ant 1.8] or a later stable official release
76-
* [Android SDK 19][Android SDK 19] or a later stable official release
75+
* [Gradle 2.3][Gradle 2.3] or a later stable official release
76+
* [Android SDK 21][Android SDK 21] or a later stable official release
77+
* [Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
78+
* [Android Support Repository][Android Support Repository]
7779
* (Optional) [Genymotion][Genymotion]
7880

7981
If you want to develop for Android, verify that you have added the following paths in the `PATH` system environment variable.
8082

8183
```
82-
Path to the bin directory in the Apache Ant installation folder
84+
Path to the bin directory in the Gradle installation folder
8385
Path to tools directory in the Android SDK installation folder
8486
Path to platform-tools directory in the Android SDK installation folder
8587
```
8688

87-
For example: PATH=...;...;C:\tools\apache-ant-1.9.4\bin;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools;
89+
For example: PATH=...;...;C:\tools\gradle\bin;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools;
8890

89-
If you have installed Chocolatey, you can complete these steps to set up JDK, Apache Ant, and Android SDK.
91+
If you have installed Chocolatey, you can complete these steps to set up JDK, Gradle, and Android SDK.
9092

9193
1. Run a Windows command prompt.
9294
1. To install JDK, run the following command.
9395

9496
```Shell
9597
choco install java.jdk
9698
```
97-
1. If not present, create the following environment variable.
99+
1. If not present, create the following environment variables.
98100

99101
```
100102
JAVA_HOME=Path to the jdk* install folder
101103
```
102104

103105
For example: JAVA_HOME=C:\Program Files\Java\jdk1.8.0_11
104-
1. To install Apache Ant, run the following command.
106+
107+
```
108+
ANDROID_HOME=Path to Android installation directory
109+
```
110+
111+
For example: ANDROID_HOME=C:\Android\android-sdk
112+
1. To install Gradle, run the following command.
105113

106114
```Shell
107-
choco install ant
115+
choco install gradle
108116
```
109117
1. If not present, add the following file path to the `PATH` system environment variable.
110118

111119
```
112-
Path to the bin directory in the Apache Ant installation folder
120+
Path to the bin directory in the Gradle installation folder
113121
```
114122

115-
For example: PATH=...;...;C:\tools\apache-ant-1.9.4\bin
123+
For example: PATH=...;...;C:\tools\gradle\bin
116124
1. To install the Android SDK, run the following command.
117-
125+
118126
```Shell
119127
choco install android-sdk
120128
```
@@ -126,50 +134,78 @@ If you have installed Chocolatey, you can complete these steps to set up JDK, Ap
126134
```
127135

128136
For example: PATH=...;...;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools
129-
1. To update the Android SDK to 19 or later, run the following command.
137+
1. To update the Android SDK to 21 or later, run the following command.
130138

131139
```Shell
132140
android update sdk
133141
```
134-
1. Select all packages for the Android 19 SDK and any other SDKs that you want to install, click **Install** and wait for the installation to complete.
142+
1. Select all packages for the Android 21 SDK and any other SDKs that you want to install, click **Install** and wait for the installation to complete.
143+
1. Select Android SDK Build-tools 22.0.0 or later stable version, click **Install** and wait for the installation to complete.
144+
1. Select Extras/Android Support Repository, click **Install** and wait for the installation to complete.
145+
146+
> NOTE: You can install required Android Tools with the following command:
147+
```Shell
148+
android update sdk --filter tools,platform-tools,android-22,android-17,build-tools-22.0.1,sys-img-x86-android-22,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui
149+
```
135150

136151
## OS X
137152

138153
> On OS X systems, you can develop, build, and deploy NativeScript projects that target iOS and Android.
139154
140155
* OS X Mavericks
141-
* [Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
156+
* [Node.js 0.10.35][Node.js 0.10.35] or a later stable 0.x release
142157
* For iOS development
143158
* [Latest Xcode][12]
144159
* [Xcode command-line tools][12]
145160
* For Android development
146-
* [JDK 8][JDK 8] or a later stable official release
147-
* [Apache Ant 1.8][Apache Ant 1.8] or a later stable official release
148-
* [Android SDK 19][Android SDK 19] or a later stable official release
161+
* [JDK 8][JDK 8] or a later stable official release
162+
* [Gradle 2.3][Gradle 2.3] or a later stable official release
163+
* [Android SDK 21][Android SDK 21] or a later stable official release
164+
* [Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
165+
* [Android Support Repository][Android Support Repository]
149166
* (Optional) [Genymotion][Genymotion]
150167

151168
If you want to develop for Android, verify that you have added the following paths in your `PATH` in `~/.bash_profile`.
152169

153170
```
154-
Path to the bin subdirectory in the Apache Ant installation directory
171+
Path to the bin subdirectory in the Gradle installation directory
155172
Path to the tools subdirectory in the Android SDK installation directory
156173
Path to the platform-tools subdirectory in the Android SDK installation directory
157174
```
158175

159176
For example:
160177
```
161-
export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android\ Studio.app/sdk/tools:/Applications/Android\ Studio.app/sdk/platform-tools
178+
export PATH=${PATH}:/gradle/bin:/Applications/Android\ Studio.app/sdk/tools:/Applications/Android\ Studio.app/sdk/platform-tools
179+
```
180+
181+
If not present, create the following environment variables.
182+
183+
```
184+
JAVA_HOME=Path to the jdk* install folder
185+
```
186+
187+
For example: JAVA_HOME=/usr/bin/java
188+
189+
```
190+
ANDROID_HOME=Path to Android installation directory
191+
```
192+
193+
For example: ANDROID_HOME=/Applications/Android\ Studio.app/sdk/
194+
195+
> NOTE: You can install required Android Tools with the following command:
196+
```Shell
197+
echo yes | android update sdk --filter tools,platform-tools,android-22,android-17,build-tools-22.0.1,sys-img-x86-android-22,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui
162198
```
163199

164200
## Linux
165201

166202
> On Linux systems, you can develop, build, and deploy NativeScript projects that target Android.
167203
168204
* Ubuntu 14.04 LTS
169-
* [Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
205+
* [Node.js 0.10.35][Node.js 0.10.35] or a later stable 0.x release
170206

171207
> **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.
172-
208+
173209
* G++ compiler
174210

175211
```Shell
@@ -182,21 +218,42 @@ export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android\ Studio.app/
182218
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 libstdc++6:i386
183219
```
184220
* [JDK 8][JDK 8] or a later stable official release
185-
* [Apache Ant 1.8][Apache Ant 1.8] or a later stable official release
186-
* [Android SDK 19][Android SDK 19] or a later stable official release
221+
* [Gradle 2.3][Gradle 2.3] or a later stable official release
222+
* [Android SDK 21][Android SDK 21] or a later stable official release
223+
* [Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
224+
* [Android Support Repository][Android Support Repository]
187225
* (Optional) [Genymotion][Genymotion]
188226

189227
Verify that you have added the following paths in your `PATH`.
190228

191229
```
192-
Path to the bin subdirectory in the Apache Ant installation directory
230+
Path to the bin subdirectory in the Gradle installation directory
193231
Path to the tools subdirectory in the Android SDK installation directory
194232
Path to the platform-tools subdirectory in the Android SDK installation directory
195233
```
196234

197235
For example:
198236
```
199-
export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android Studio.app/sdk/tools:/Applications/Android Studio.app/sdk/platform-tools
237+
export PATH=${PATH}:/gradle/bin:/home/user/android-sdk/tools:/home/user/android-sdk/platform-tools
238+
```
239+
240+
If not present, create the following environment variables.
241+
242+
```
243+
JAVA_HOME=Path to the jdk* install folder
244+
```
245+
246+
For example: JAVA_HOME=/usr/bin/java
247+
248+
```
249+
ANDROID_HOME=Path to Android installation directory
250+
```
251+
252+
For example: ANDROID_HOME=/home/user/android-sdk
253+
254+
> NOTE: You can install required Android Tools with the following command:
255+
```Shell
256+
echo yes | android update sdk --filter tools,platform-tools,android-22,android-17,build-tools-22.0.1,sys-img-x86-android-22,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui
200257
```
201258

202259
[Back to Top][1]
@@ -263,7 +320,7 @@ Run `tns help` to view all available commands in the browser. Run `tns help <Com
263320
* `library add <Platform> <Library Path>` adds a locally stored native library to the current project.
264321
* `prepare <Platform>` copies cross-platform and selected platform-specific content to the subdirectory for the target platform.
265322
* `build <Platform>` builds the project for the selected target platform.
266-
* `emulate <Platform>` builds the project for the selected target platform and runs it in the native emulator, if configured.
323+
* `emulate <Platform>` builds the project for the selected target platform and runs it in the native emulator, if configured.
267324
* `deploy <Platform> [--device <Device ID>]` deploys an already built application on connected device.
268325
* `run <Platform> [--device <Device ID>]` executes `prepare`, `build`, and `deploy`.
269326
* `livesync <Platform>` synchronizes changes from your project to an already deployed application on device.
@@ -314,8 +371,8 @@ MyApp/
314371
└── ...
315372
```
316373

317-
* The `app` directory is the **development space for your application**. You should modify all common and platform-specific code within this directory. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
318-
* The `platforms` directory is created empty. When you add a target platform to your project, the NativeScript CLI creates a new subdirectory with the platform name. The subdirectory contains the ready-to-build resources of your app. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content from the `app` directory to the platform-specific subdirectory for each target platform.<br/>In the `platforms` directory, you can safely modify configuration files such as `AndroidManifest.xml` and `Info.plist`.
374+
* The `app` directory is the **development space for your application**. You should modify all common and platform-specific code within this directory. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
375+
* The `platforms` directory is created empty. When you add a target platform to your project, the NativeScript CLI creates a new subdirectory with the platform name. The subdirectory contains the ready-to-build resources of your app. When you run `prepare <Platform>`, the NativeScript CLI copies relevant content from the `app` directory to the platform-specific subdirectory for each target platform.<br/>In the `platforms` directory, you can safely modify configuration files such as `AndroidManifest.xml` and `Info.plist`.
319376

320377
[Back to Top][1]
321378

@@ -330,7 +387,7 @@ tns platform add android
330387
tns platform add ios
331388
```
332389

333-
`platform add` creates the `android` and the `ios` subdirectories in the `platforms` directory. These subdirectories have the platform-specific project structure required for native development with the native SDKs for the platform.
390+
`platform add` creates the `android` and the `ios` subdirectories in the `platforms` directory. These subdirectories have the platform-specific project structure required for native development with the native SDKs for the platform.
334391

335392
```
336393
...
@@ -380,9 +437,9 @@ For more information about working with NativeScript, see the following resource
380437

381438
### Development in `app`
382439

383-
The `app` directory in the root of the project is the development space for your project. **Place all your common and platform-specific code in this directory.** When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
440+
The `app` directory in the root of the project is the development space for your project. **Place all your common and platform-specific code in this directory.** When you run `prepare <Platform>`, the NativeScript CLI copies relevant content to the platform-specific folders for each target platform.
384441

385-
In the `app` directory, you can use **platform-specific files** to provide customized functionality and design for each target platform. To indicate that a file is platform-specific, make sure that the file name is in the following format: `name.ios.extension` or `name.android.extension`. For example: `main.ios.js` or `main.android.js`.
442+
In the `app` directory, you can use **platform-specific files** to provide customized functionality and design for each target platform. To indicate that a file is platform-specific, make sure that the file name is in the following format: `name.ios.extension` or `name.android.extension`. For example: `main.ios.js` or `main.android.js`.
386443

387444
You can develop shared functionality or design in common files. To indicate that a file is common, make sure that the file name does not contain a `.android.` or `.ios.` string.
388445

@@ -420,7 +477,7 @@ tns build android
420477
tns build ios
421478
```
422479

423-
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally.
480+
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally.
424481

425482
When you build for Android, the NativeScript CLI saves the application package as an `APK` in `platforms` &#8594; `android` &#8594; `bin`.
426483

@@ -450,7 +507,7 @@ tns deploy android
450507
tns deploy ios
451508
```
452509

453-
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally. After the build is complete, the NativeScript CLI downloads and installs the application package on your connected devices.
510+
The NativeScript CLI calls the SDK for the selected target platform and uses it to build your app locally. After the build is complete, the NativeScript CLI downloads and installs the application package on your connected devices.
454511

455512
On Android devices, the app runs automatically.
456513

@@ -473,7 +530,7 @@ This operation calls the SDK for the selected target platform, builds your app l
473530

474531
For Android, the NativeScript CLI runs your app in the earliest created virtual device or the currently running Android Virtual Device. Before running your app in the Android native emulator, make sure that you have configured at least one virtual device in the Android Virtual Device manager.
475532

476-
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
533+
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
477534

478535
[Back to Top][1]
479536

@@ -553,9 +610,9 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
553610
[10]: http://developer.telerik.com/featured/nativescript-android/
554611
[11]: http://blogs.telerik.com/valentinstoychev/posts.aspx/14-06-12/announcing-nativescript---cross-platform-framework-for-building-native-mobile-applications
555612
[12]: https://developer.apple.com/xcode/downloads/
556-
[Node.js 0.10.26]: http://nodejs.org/download/
613+
[Node.js 0.10.35]: https://nodejs.org/dist/v0.10.35/
557614
[Chocolatey]: https://chocolatey.org/
558615
[JDK 8]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
559-
[Apache Ant 1.8]: http://ant.apache.org/bindownload.cgi
560-
[Android SDK 19]: http://developer.android.com/sdk/index.html
616+
[Gradle 2.3]: https://gradle.org/gradle-download/
617+
[Android SDK 21]: http://developer.android.com/sdk/index.html
561618
[Genymotion]: https://www.genymotion.com/#!/

0 commit comments

Comments
 (0)