An android template project with the following:
- Spock unit testing
- Junit unit tests
- Robospock/Roboelectric unit tests
- Jacoco code coverage report
- Checkstyle
Fork it and save time on iteration zero!
Prerequisites
- Android studio 0.8.1 preview or later
- ANDROID_HOME variable is set.
- Fork or clone this repo
- Run the following to pull in all external dependencies:
./graldew clean build
- Import the project into android studio: File >> Open >> ..../android-template/build.gradle
- Rename the application id/package in /app/build.gradle
ext{
projectPackageName = "au.com.dius.android.template"
}
- Refactor the existing classes packaging to match your application
or
Delete everything under app/src and run
./gradlew createJvmSrcDirs -i
to recreate src dirs and packages
When adding new flavours of build types the following command will automatically create the source and res directories.
./gradlew app:createJvmSrcDirs -i
- Runs both instrumented tests within 'app' and all unit tests in the unit-test project
./gradlew clean build -i
The 'unit-test' module facilitates for unit testing without an emulator (non-connected). 'Connected` unit tests should live under /app/src/androidTest. see: Here "This can contain unit tests, instrumentation tests, and later uiautomator tests"
./gradlew :unit-test:test
- After unit tests have been executed
./gradlew jacocoTestReport