Skip to content

Development

Dieter Adriaenssens edited this page Jul 28, 2014 · 68 revisions

Setting up the development environment

Get the source code

Build dependencies

  • Android SDK (API 19) -> Check the system requirements
  • Android Build tools (20.0.0)
  • Java (OpenJDK 7 or Oracle JDK 8)
  • Maven (>= v3.1.1) or Gradle (1.10)
  • jUnit v4.8.2 (plugin installed from maven repo during build)
  • Robolectric v2.2 (plugin installed from maven repo during build)
  • Mockito v1.9.5 (plugin installed from maven repo during build)
  • used libraries :
    • Crouton v1.8.1, Apache 2.0 (installed from maven repo during build)
  • optional build tools :
    • cobertura-maven-plugin v2.5.2 (>= v2.6 throws an error in combination with Robolectric, see issue #144)
    • coveralls
    • checkstyle
    • javadoc

Deploy Android SDK to local maven repo

Only required when building with Maven!

This step only needs to be done once when installing the Android SDK for the first time, or when updating the SDK to a newer version.

Due to license issues, the Android API is not available in the central Maven repository. One of the solutions is to install the required Android API to your local Maven repo (usually located in ~/.m2/repository).

This script will install a tool to deploy the SDK and deploy the required version to the local Maven repo :

.utility/deploy-sdk-to-m2-repo.sh

  • The required Android SDK (see build dependencies for the correct version) should be installed before running this script.
  • ANDROID_HOME should be defined and point to the location of the Android SDK folder.

Build and test the code

build and test : mvn clean test or ./gradlew clean check

build and test with code coverage : mvn clean cobertura:cobertura

build, test and deploy to an Android device : mvn clean install android:deploy

build, test and deploy to an Android device and run the app : mvn clean install android:deploy android:run

To disable Unit tests in maven, run with -DskipTests=true

Clone this wiki locally