Skip to content

Instantly share code, notes, and snippets.

@quentin7b
Last active May 23, 2018 07:24
Show Gist options
  • Save quentin7b/cfc1b2053f8496584ac38fd2ce1b4ba8 to your computer and use it in GitHub Desktop.
Save quentin7b/cfc1b2053f8496584ac38fd2ce1b4ba8 to your computer and use it in GitHub Desktop.
Android build.gradle adds
// Root build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
// Module build.gradle
android {
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
dependencies {
// Libs
def hamkrest = 'com.natpryce:hamkrest:1.4.2.2'
def junit = 'junit:junit:4.12'
def mockito = 'org.mockito:mockito-core:2.13.0'
def mockito_kotlin = 'com.github.nhaarman:mockito-kotlin:2.0.0-alpha04'
// Unit Testing (test)
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "$junit"
testImplementation "$hamkrest"
testImplementation "$mockito"
testImplementation "$mockito_kotlin"
testImplementation 'android.arch.core:core-testing:1.1.1' // Important to test lifecycle
// Framework Testing (androidTest)
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation "org.robolectric:robolectric:3.8"
androidTestImplementation "org.robolectric:shadows-support-v4:3.3.2"
androidTestImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
androidTestImplementation "$junit"
androidTestImplementation "$hamkrest"
androidTestImplementation "$mockito"
androidTestImplementation "$mockito_kotlin"
androidTestImplementation "org.koin:koin-test:$koin_version"
}
dependencies {
def coroutines_version = '0.22.5'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment