Skip to content

Instantly share code, notes, and snippets.

@lalbuquerque
Last active March 8, 2016 14:15
Show Gist options
  • Save lalbuquerque/a5fce397ed5f65a7b076 to your computer and use it in GitHub Desktop.
Save lalbuquerque/a5fce397ed5f65a7b076 to your computer and use it in GitHub Desktop.
Add Espresso dependencies to your project with separated dependencies file :)
testCompile testDependencies.junit
testCompile testDependencies.hamcrest
//Provides AndroidJUnitRunner
androidTestCompile (testDependencies.runner) {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude module: 'support-annotations'
}
// Provides JUnit 4 rules
androidTestCompile (testDependencies.rules) {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude module: 'support-annotations'
}
// Builds and runs Espresso tests
androidTestCompile (testDependencies.espresso_core) {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude module: 'support-annotations'
}
androidTestCompile (testDependencies.espresso_intent) {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude module: 'support-annotations'
}
androidTestCompile (testDependencies.espresso_contrib) {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude module: 'support-annotations'
}
ext {
testDependencies = [
junit: "junit:junit:4.12",
hamcrest: "org.hamcrest:hamcrest-all:1.3",
runner: "com.android.support.test:runner:0.4.1",
rules: "com.android.support.test:rules:0.4.1",
espresso_core: "com.android.support.test.espresso:espresso-core:2.2.1",
espresso_intent: "com.android.support.test.espresso:espresso-intents:2.2.1",
espresso_contrib: "com.android.support.test.espresso:espresso-contrib:2.2.1"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment