https://github.com/jaredsburrows/android-gradle-groovy-app-template
Gradle + Android Studio + Robolectric + Espresso + RoboSpock + JaCoCo
https://github.com/jaredsburrows/android-gradle-groovy-app-template
Last synced: 11 months ago
JSON representation
Gradle + Android Studio + Robolectric + Espresso + RoboSpock + JaCoCo
- Host: GitHub
- URL: https://github.com/jaredsburrows/android-gradle-groovy-app-template
- Owner: jaredsburrows
- License: apache-2.0
- Created: 2015-12-31T06:42:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-06-16T03:11:52.000Z (about 7 years ago)
- Last Synced: 2025-04-03T20:11:18.445Z (over 1 year ago)
- Language: Groovy
- Homepage:
- Size: 183 KB
- Stars: 40
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Gradle Groovy App Template
[](http://www.apache.org/licenses/LICENSE-2.0)
[](https://travis-ci.org/jaredsburrows/android-gradle-groovy-app-template)
[](https://coveralls.io/github/jaredsburrows/android-gradle-groovy-app-template?branch=master)
[](https://twitter.com/jaredsburrows)
Gradle + Android Studio + Robolectric + Espresso + RoboSpock + JaCoCo
## Technologies used:
#### Build Tools:
|Name|Description|
|---|---|
| [Gradle](http://gradle.org/docs/current/release-notes) | Gradle build system |
| [Android Gradle Build Tools](http://tools.android.com/tech-docs/new-build-system) | Official Gradle Plugin |
| [Android SDK](http://developer.android.com/tools/revisions/platforms.html#5.1) | Official SDK |
| [Android SDK Build Tools](http://developer.android.com/tools/revisions/build-tools.html) | Official Build Tools |
| [Android Studio](http://tools.android.com/recent) or | Official IDE |
| [Intellij](https://www.jetbrains.com/idea/download/) | Intellij IDE |
#### Android Libraries:
|Name|Description|
|---|---|
| [Android Support-v4](http://developer.android.com/tools/support-library/features.html#v4) | Support Library API 4+ |
| [Android AppCompat-v7](http://developer.android.com/tools/support-library/features.html#v7-appcompat) | Support Library API 7+ |
#### Testing Frameworks:
|Name|Description|
|---|---|
| [Espresso](https://google.github.io/android-testing-support-library/) | Instrumentation Framework |
| [Robolectric](https://github.com/robolectric/robolectric) | Unit Testing Framework |
#### Reporting Plugins:
|Name|Description|
|---|---|
| [JaCoCo](http://www.eclemma.org/jacoco/) | JaCoCo Test Coverage |
| [Coveralls](https://coveralls.io/) | Hosts test reports published from TravisCI |
#### Continuous Integration:
|Name|Description|
|---|---|
| [TravisCI](http://docs.travis-ci.com/user/languages/android/) | Build Server(Builds, Tests, Publishes reports to Coveralls) |
#### Publishing to Google Play:
|Name|Description|
|---|---|
| [Gradle-play-publisher](https://github.com/Triple-T/gradle-play-publisher) | Publishes your app to Google Play |
# Getting Started:
## `Android Studio` or `Intellij` Support(Simple):
- **Import/Open this project with Android Studio/Intellij(click on `build.gradle`)**
- **Instrumentation Tests:**
- Change the Build Variant Test Artifact to `Instrumentation Tests`
- Right click an instrumentation test located in `src/main/androidTest` and click test
- **Unit Tests:**
- Change the Build Variant Test Artifact to `Unit Tests`
- Right click a unit test located in `src/main/test` and click test
## Building and Running
This project builds with [Gradle](www.gradle.org) and the Android Build [tools](http://tools.android.com/tech-docs/new-build-system).
**Build the APK:**
$ gradlew assembleDebug
**Install the APK:**
$ gradlew installDebug
**Run the App:**
$ gradlew runDebug
## Testing
**Running the Unit Tests:**
The [Junit](http://junit.org/junit4/) tests run on the JVM, no need for emulators or real devices.
$ gradlew testDebug
**Run a single unit test in the `debug flavor`:**
$ gradlew testDebug --tests="*MainActivityTest*"
**Running the Instrumentation Tests:**
The [Espresso](https://developer.android.com/training/testing/ui-testing/espresso-testing.html) instrumentation tests run on the device.
$ gradlew connectedDebugAndroidTest
## Reports
**Generate Lint Reports:**
The [Lint](http://developer.android.com/tools/help/lint.html) plugin generates reports based off the source code.
$ gradlew lintDebug
**Generate Jacoco Test Coverage:**
The [Jacoco](http://www.eclemma.org/jacoco/) plugin generates coverage reports based off the unit tests.
$ gradlew jacocoDebugReport