Skip to content

Combines Android Studio, Gradle, Espresso, Robolectric, AndroidAnnotations, Dagger, JaCoCo, ...

Notifications You must be signed in to change notification settings

kmityakov/android-gradle-template

 
 

Repository files navigation

Rapid start development and test

with Android Studio, Gradle, Espresso, Robolectric, AndroidAnnotations, RoboCoP, JaCoCo

Build Status & UnitTest Coverage Status

Wishes, improvements and discussions about the stuff here are welcome

see also wiki for more help

Last tests done with

  • Android Studio 1.1.0
  • Gradle Build Tools 1.1.2
  • Gradle 2.2.1
  • Novoda gradle-android-test-plugin 0.10.4 (Not yet released)

Getting Started

Until next novoda plugin release use the Script/install-custom-gradle-test-plugin.sh to install the necessary plugin version

Check if the project and tests works on your machine

clone, attach phone (or start emulator), run Scripts/run-tests.sh from project root

Check if you get this project to work with andorid studio

import to android studio, start development, press play

Support for Android studio

Out of the box

Tests on command line

unit tests: ./gradlew :App:testDebug

  • append :App:jacocoTestReport for coverage report

component tests: ./gradlew :AppComponentTests:testDebug

  • append :AppComponentTests:jacocoTestReport for coverage report

acceptance tests: ./gradlew :App:connectedAndroidTest

  • replace by :App:connectedCheck for coverage report

rest example

Currently RestActivity example fails when no server is reachable.

  • start Script/start-wiremock.sh
  • kill Script/start-wiremock.sh kill

Test results

  • build/index.html (should collect all reports, current is miss the AndroidSample module reports)
  • App/build/test-report/debug/index.html (unit test)
  • App/build/reports/jacoco/jacoco.html (unit test coverage)
  • AppComponentTests/build/test-report/debug/index.html (component test)
  • AppComponentTests/build/reports/jacoco/test/html/index.html (component test coverage)
  • App/build/reports/androidTests/connected/index.html (acceptance tests)
  • App/build/reports/coverage/debug/index.html (acceptance tests coverage)

Features done

Scripts

  • run-tests.sh execute all test variants
  • run-tests-fast.sh execute just the robolectric tests
  • run-tests-travis.sh do all steps necessary for full automatic builds, like install custom dependencies

About

Combines Android Studio, Gradle, Espresso, Robolectric, AndroidAnnotations, Dagger, JaCoCo, ...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 94.1%
  • Shell 5.9%