Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: README.md

Issue 29349720: Issue 4324 - Add Gradle build config (Closed)
Patch Set: Created Aug. 11, 2016, 1:20 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: README.md
diff --git a/README.md b/README.md
index 4a78cef4f72945bd29fd910cb68b89e41ec22c18..ce2d29c550de70be4b3c4cb51557e0fd95199477 100644
--- a/README.md
+++ b/README.md
@@ -52,13 +52,38 @@ In the 'libadblockplus-android' directory run:
This will generate *.aar library artifact in the 'target' directory.
+Building with Gradle/Android Studio
+-----------------------------------
+
+### Requirements
+
+* [The Android SDK](http://developer.android.com/sdk)
+* Android SDK Build tools 22.0.1
+* [The Android NDK](https://developer.android.com/tools/sdk/ndk)
+
+Edit 'buildToolsVersion' in 'build.gradle' files if necessary.
+
+### Building from command-line
+
+In the project root directory create the file _local.properties_ and set
+_sdk.dir_ and _ndk.dir_ to where you installed it, e.g.:
+
+ sdk.dir = /some/where/sdk
+ ndk.dir = /some/where/ndk
+
+In the project root directory run:
+
+ ./gradlew assembleDebug
+
+This will generate *.aar library artifact in 'libadblockplus-android/build/outputs/aar/' directory.
+
## Library tests
### Requirements
Make sure _Library_ requirements are present.
-### Building
+### Building with Ant
Set ANDROID_HOME environment variable to your Android SDK directory.
@@ -66,7 +91,7 @@ In the 'libadblockplus-android-tests' run:
ant instrument
-### Testing
+### Testing with Ant
1. Connect an Android device or start the Android Emulator.
2. In the 'libadblockplus-android-tests' directory run:
@@ -93,4 +118,18 @@ To run specific **test method** run:
For example:
- ant testOnly -DtestClass=org.adblockplus.libadblockplus.tests.NotificationTest#testAddNotification
+ ant testOnly -DtestClass=org.adblockplus.libadblockplus.tests.NotificationTest#testAddNotification
+
+### Building with Gradle/Android Studio
+
+Make sure you've created _local.properties_ file to build the library (see above).
+In the project root directory run:
+
+ ./gradlew assembleDebugAndroidTest
+
+This will generate *.apk in 'libadblockplus-android-tests/build/outputs/apk/' directory.
+
+### Testing with Gradle/Android Studio
+
+You can select test class/method and click 'Run ..Test'. The library and test app will be
+compiled, installed to emuator/device and launched automatically.

Powered by Google App Engine
This is Rietveld