Skip to content

Commit 809915d

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

File tree

1 file changed

+80
-38
lines changed

1 file changed

+80
-38
lines changed

README.md

Lines changed: 80 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 official 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,68 @@ 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.
135145

136146
## OS X
137147

138148
> On OS X systems, you can develop, build, and deploy NativeScript projects that target iOS and Android.
139149
140150
* OS X Mavericks
141-
* [Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
151+
* [Node.js 0.10.35][Node.js 0.10.35] or a later stable official release
142152
* For iOS development
143153
* [Latest Xcode][12]
144154
* [Xcode command-line tools][12]
145155
* 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
156+
* [JDK 8][JDK 8] or a later stable official release
157+
* [Gradle 2.3][Gradle 2.3] or a later stable official release
158+
* [Android SDK 21][Android SDK 21] or a later stable official release
159+
* [Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
160+
* [Android Support Repository][Android Support Repository]
149161
* (Optional) [Genymotion][Genymotion]
150162

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

153165
```
154-
Path to the bin subdirectory in the Apache Ant installation directory
166+
Path to the bin subdirectory in the Gradle installation directory
155167
Path to the tools subdirectory in the Android SDK installation directory
156168
Path to the platform-tools subdirectory in the Android SDK installation directory
157169
```
158170

159171
For example:
160172
```
161-
export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android\ Studio.app/sdk/tools:/Applications/Android\ Studio.app/sdk/platform-tools
173+
export PATH=${PATH}:/gradle/bin:/Applications/Android\ Studio.app/sdk/tools:/Applications/Android\ Studio.app/sdk/platform-tools
174+
```
175+
176+
If not present, create the following environment variables.
177+
178+
```
179+
JAVA_HOME=Path to the jdk* install folder
180+
```
181+
182+
For example: JAVA_HOME=/usr/bin/java
183+
184+
```
185+
ANDROID_HOME=Path to Android installation directory
162186
```
163187

188+
For example: ANDROID_HOME=/Applications/Android\ Studio.app/sdk/
189+
164190
## Linux
165191

166192
> On Linux systems, you can develop, build, and deploy NativeScript projects that target Android.
167193
168194
* Ubuntu 14.04 LTS
169-
* [Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
195+
* [Node.js 0.10.35][Node.js 0.10.35] or a later stable official release
170196

171197
> **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-
198+
173199
* G++ compiler
174200

175201
```Shell
@@ -182,23 +208,39 @@ export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android\ Studio.app/
182208
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 libstdc++6:i386
183209
```
184210
* [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
211+
* [Gradle 2.3][Gradle 2.3] or a later stable official release
212+
* [Android SDK 21][Android SDK 21] or a later stable official release
213+
* [Android SDK Build-tools 22.0.0][Android SDK Build-tools 22.0.0] or a later stable official release
214+
* [Android Support Repository][Android Support Repository]
187215
* (Optional) [Genymotion][Genymotion]
188216

189217
Verify that you have added the following paths in your `PATH`.
190218

191219
```
192-
Path to the bin subdirectory in the Apache Ant installation directory
220+
Path to the bin subdirectory in the Gradle installation directory
193221
Path to the tools subdirectory in the Android SDK installation directory
194222
Path to the platform-tools subdirectory in the Android SDK installation directory
195223
```
196224

197225
For example:
198226
```
199-
export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android Studio.app/sdk/tools:/Applications/Android Studio.app/sdk/platform-tools
227+
export PATH=${PATH}:/gradle/bin:/home/user/android-sdk/tools:/home/user/android-sdk/platform-tools
228+
```
229+
230+
If not present, create the following environment variables.
231+
232+
```
233+
JAVA_HOME=Path to the jdk* install folder
234+
```
235+
236+
For example: JAVA_HOME=/usr/bin/java
237+
238+
```
239+
ANDROID_HOME=Path to Android installation directory
200240
```
201241

242+
For example: ANDROID_HOME=/home/user/android-sdk
243+
202244
[Back to Top][1]
203245

204246
Installation
@@ -263,7 +305,7 @@ Run `tns help` to view all available commands in the browser. Run `tns help <Com
263305
* `library add <Platform> <Library Path>` adds a locally stored native library to the current project.
264306
* `prepare <Platform>` copies cross-platform and selected platform-specific content to the subdirectory for the target platform.
265307
* `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.
308+
* `emulate <Platform>` builds the project for the selected target platform and runs it in the native emulator, if configured.
267309
* `deploy <Platform> [--device <Device ID>]` deploys an already built application on connected device.
268310
* `run <Platform> [--device <Device ID>]` executes `prepare`, `build`, and `deploy`.
269311
* `livesync <Platform>` synchronizes changes from your project to an already deployed application on device.
@@ -314,8 +356,8 @@ MyApp/
314356
└── ...
315357
```
316358

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`.
359+
* 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.
360+
* 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`.
319361

320362
[Back to Top][1]
321363

@@ -330,7 +372,7 @@ tns platform add android
330372
tns platform add ios
331373
```
332374

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.
375+
`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.
334376

335377
```
336378
...
@@ -380,9 +422,9 @@ For more information about working with NativeScript, see the following resource
380422

381423
### Development in `app`
382424

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.
425+
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.
384426

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`.
427+
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`.
386428

387429
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.
388430

@@ -420,7 +462,7 @@ tns build android
420462
tns build ios
421463
```
422464

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

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

@@ -450,7 +492,7 @@ tns deploy android
450492
tns deploy ios
451493
```
452494

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.
495+
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.
454496

455497
On Android devices, the app runs automatically.
456498

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

474516
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.
475517

476-
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
518+
For iOS, the NativeScript CLI runs your app in the iOS Simulator.
477519

478520
[Back to Top][1]
479521

@@ -553,9 +595,9 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
553595
[10]: http://developer.telerik.com/featured/nativescript-android/
554596
[11]: http://blogs.telerik.com/valentinstoychev/posts.aspx/14-06-12/announcing-nativescript---cross-platform-framework-for-building-native-mobile-applications
555597
[12]: https://developer.apple.com/xcode/downloads/
556-
[Node.js 0.10.26]: http://nodejs.org/download/
598+
[Node.js 0.10.35]: http://nodejs.org/download/
557599
[Chocolatey]: https://chocolatey.org/
558600
[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
601+
[Gradle 2.3]: https://gradle.org/gradle-download/
602+
[Android SDK 21]: http://developer.android.com/sdk/index.html
561603
[Genymotion]: https://www.genymotion.com/#!/

0 commit comments

Comments
 (0)