Skip to content

Instantly share code, notes, and snippets.

@dalewking
Created July 15, 2014 23:50
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 dalewking/947fb57e0916d24a397d to your computer and use it in GitHub Desktop.
Save dalewking/947fb57e0916d24a397d to your computer and use it in GitHub Desktop.
Build.gradle setup for running Robolectric
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.robolectric.gradle:gradle-android-test-plugin:0.10.+'
}
}
apply plugin: 'android-test'
dependencies {
androidTestCompile('junit:junit:4.+') { exclude module: 'hamcrest-core' }
androidTestCompile 'org.hamcrest:hamcrest-integration:1.1'
androidTestCompile 'org.hamcrest:hamcrest-core:1.1'
androidTestCompile 'org.hamcrest:hamcrest-library:1.1'
androidTestCompile 'org.mockito:mockito-all:1.8.+'
androidTestCompile 'com.squareup:fest-android:1.0.+'
androidTestCompile('org.robolectric:robolectric:2.+') {
exclude module: 'classworlds'
exclude module: 'maven-artifact'
exclude module: 'maven-artifact-manager'
exclude module: 'maven-error-diagnostics'
exclude module: 'maven-model'
exclude module: 'maven-plugin-registry'
exclude module: 'maven-profile'
exclude module: 'maven-project'
exclude module: 'maven-settings'
exclude module: 'nekohtml'
exclude module: 'commons-logging'
exclude module: 'plexus-container-default'
exclude module: 'plexus-interpolation'
exclude module: 'plexus-utils'
exclude module: 'wagon-file'
exclude module: 'wagon-http-lightweight'
exclude module: 'wagon-http-shared'
exclude module: 'wagon-provider-api'
exclude module: 'httpclient'
}
}
tasks.withType(Test) {
testLogging.exceptionFormat = 'full'
systemProperties.put('android.package', 'com.loxabeauty.android')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment