| Building and running tests with Android |
| ======================================= |
| |
| The easiest way to build libaddressinput for Android and run all the tests is |
| using the Gradle project automation tool: |
| |
| http://tools.android.com/tech-docs/new-build-system |
| http://www.gradle.org/ |
| |
| |
| Prerequisite dependencies for using Gradle with Android |
| ------------------------------------------------------- |
| Android Studio: https://developer.android.com/sdk/index.html |
| or |
| Android SDK Tools: https://developer.android.com/sdk/index.html#Other |
| |
| Set the ANDROID_HOME environment variable to the root of the SDK. |
| |
| Install the following packages: |
| * Tools/Android SDK Build-tools (Rev. 21.1.2) |
| * Android 5.1 (API 22) |
| * Extras/Android Support Library |
| |
| Gradle (latest version): |
| https://services.gradle.org/distributions/gradle-2.3-bin.zip |
| |
| Note: Additionally you must take care to avoid having multiple versions of |
| Gradle on your path, as this can cause problems. |
| |
| |
| Building and Running |
| -------------------- |
| After installing all the prerequisites, check that everything is working by |
| running: |
| |
| $ gradle build |
| |
| With an Android emulator running or an Android device connected, the following |
| command line then builds the library and runs the tests: |
| |
| $ gradle connectedAndroidTest |
| |
| The test runner logs to the system log, which can be viewed using logcat: |
| |
| $ adb logcat |