Skip to content

Instantly share code, notes, and snippets.

@malmstein
Created May 12, 2014 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malmstein/67607709f7e8d9b6fe1c to your computer and use it in GitHub Desktop.
Save malmstein/67607709f7e8d9b6fe1c to your computer and use it in GitHub Desktop.
android test module
apply plugin: 'java'
apply plugin: 'jacoco'
dependencies {
compile project(':android')
testCompile 'junit:junit:4.+'
testCompile 'com.squareup:fest-android:1.0.+'
testCompile 'org.mockito:mockito-all:1.9.5'
testCompile 'org.robolectric:robolectric:2.2'
testCompile 'com.squareup.dagger:dagger:1.2.1'
testCompile 'com.squareup.dagger:dagger-compiler:1.2.1'
testCompile project(':android').android.applicationVariants.toList().first().javaCompile.classpath
testCompile project(':android').android.applicationVariants.toList().first().javaCompile.outputs.files
testCompile files(project(':android').plugins.findPlugin("android").runtimeJarList)
}
sourceSets {
test {
java.srcDirs = ['src/shared/java', 'src/unit/java', 'src/integration/java']
}
}
tasks.withType(Test) {
scanForTestClasses = false
include "**/*Should.class"
include "**/*Test.class"
include "**/*Tests.class"
}
sonarRunner {
sonarProperties {
properties["sonar.sources"] = project(':android').android.sourceSets.main.java.srcDirs
properties["sonar.tests"] = sourceSets.test.java.srcDirs
properties["sonar.binaries"] = ['build/classes/test']
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment