普通文本  |  51行  |  1.74 KB

plugins {
    id "net.ltgt.errorprone" version "0.0.13"
}

new RoboJavaModulePlugin(
        deploy: true
).apply(project)

apply plugin: ShadowsPlugin

shadows {
    packageName "org.robolectric.shadows.support.v4"
}

configurations {
    earlyTestRuntime
}

dependencies {
    // Project dependencies
    compileOnly project(":robolectric")
    compileOnly project(":shadows:framework")

    // Compile dependencies
    compileOnly AndroidSdk.MAX_SDK.coordinates
    compileOnly "com.android.support:support-v4:26.0.1"
    compileOnly "com.android.support:support-compat:26.0.1"
    compileOnly "com.android.support:support-core-ui:26.0.1"
    compileOnly "com.android.support:support-core-utils:26.0.1"
    compileOnly "com.android.support:support-fragment:26.0.1"

    // Testing dependencies
    testCompile project(":robolectric")
    testCompile "junit:junit:4.12"
    testCompile "org.hamcrest:hamcrest-junit:2.0.0.0"
    testCompile "org.assertj:assertj-core:3.8.0"
    testCompile "org.mockito:mockito-core:2.5.4"

    earlyTestRuntime "org.hamcrest:hamcrest-junit:2.0.0.0"
    testRuntime AndroidSdk.MAX_SDK.coordinates
    testRuntime "com.android.support:support-v4:26.0.1"
    testRuntime "com.android.support:support-compat:26.0.1"
    testRuntime "com.android.support:support-core-ui:26.0.1"
    testRuntime "com.android.support:support-core-utils:26.0.1"
    testRuntime "com.android.support:support-fragment:26.0.1"
}

// hamcrest needs to come before junit on runtime classpath; the gradle IntelliJ plugin
//   needs the compileClasspath order patched too (bug?)
sourceSets.test.compileClasspath = configurations.earlyTestRuntime + sourceSets.test.compileClasspath
sourceSets.test.runtimeClasspath = configurations.earlyTestRuntime + sourceSets.test.runtimeClasspath