blob: ca7b188fb4296c7c0df3e531dba4d61608b9266b [file] [log] [blame]
import org.robolectric.gradle.DeployedRoboJavaModulePlugin
import org.robolectric.gradle.RoboJavaModulePlugin
apply plugin: RoboJavaModulePlugin
apply plugin: DeployedRoboJavaModulePlugin
processResources {
filesMatching("**/robolectric-version.properties") {
filter { String line ->
return line.replaceAll(/\$\{project.version\}/, project.version)
}
}
}
configurations {
shadow
}
project.sourceSets.test.compileClasspath += configurations.shadow
dependencies {
annotationProcessor "com.google.auto.service:auto-service:1.0-rc6"
annotationProcessor "com.google.errorprone:error_prone_core:$errorproneVersion"
api project(":annotations")
api project(":junit")
api project(":pluginapi")
api project(":resources")
api project(":sandbox")
api project(":utils")
api project(":utils:reflector")
api project(":plugins:maven-dependency-resolver")
api "javax.inject:javax.inject:1"
compileOnly "com.google.auto.service:auto-service-annotations:1.0-rc6"
api "javax.annotation:javax.annotation-api:1.3.2"
// We need to have shadows-framework.jar on the runtime system classpath so ServiceLoader
// can find its META-INF/services/org.robolectric.shadows.ShadowAdapter.
api project(":shadows:framework")
api "org.bouncycastle:bcprov-jdk15on:1.65"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
compileOnly AndroidSdk.MAX_SDK.coordinates
compileOnly "junit:junit:${junitVersion}"
implementation "androidx.test:monitor:1.4.0-alpha04"
testImplementation "junit:junit:${junitVersion}"
testImplementation "com.google.truth:truth:${truthVersion}"
testImplementation "com.google.truth.extensions:truth-java8-extension:${truthVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.hamcrest:hamcrest-junit:2.0.0.0"
testImplementation "androidx.test:core:1.4.0-alpha04"
testImplementation "androidx.test.ext:junit:1.1.3-alpha04"
testImplementation "androidx.test.ext:truth:1.4.0-alpha04"
testImplementation "androidx.test:runner:1.4.0-alpha04"
testImplementation("com.google.guava:guava:27.0.1-jre")
testCompileOnly AndroidSdk.MAX_SDK.coordinates // compile against latest Android SDK
testRuntime AndroidSdk.MAX_SDK.coordinates // run against whatever this JDK supports
}
test {
if (project.hasProperty('maxParallelForks'))
maxParallelForks = project.maxParallelForks as int
if (project.hasProperty('forkEvery'))
forkEvery = project.forkEvery as int
}
project.apply plugin: CheckApiChangesPlugin
checkApiChanges {
from = [
"org.robolectric:robolectric:${apiCompatVersion}@jar",
"org.robolectric:annotations:${apiCompatVersion}@jar",
"org.robolectric:junit:${apiCompatVersion}@jar",
"org.robolectric:resources:${apiCompatVersion}@jar",
"org.robolectric:sandbox:${apiCompatVersion}@jar",
"org.robolectric:utils:${apiCompatVersion}@jar",
"org.robolectric:shadowapi:${apiCompatVersion}@jar",
"org.robolectric:shadows-framework:${apiCompatVersion}@jar",
]
to = [
project(":robolectric"),
project(":annotations"),
project(":junit"),
project(":resources"),
project(":sandbox"),
project(":shadows:framework"),
project(":utils"),
project(":shadowapi"),
]
entryPoints += "org.robolectric.RobolectricTestRunner"
expectedChanges = [
"^org.robolectric.util.ActivityController#",
"^org.robolectric.util.ComponentController#",
"^org.robolectric.util.ContentProviderController#",
"^org.robolectric.util.FragmentController#",
"^org.robolectric.util.IntentServiceController#",
"^org.robolectric.util.ServiceController#",
]
}