Download "android-4.1.1.4.jar" (as "android.jar") when needed
Previously Maven did this, but Gradle did not. So Gradle testing would only succeed if we'd already done a Maven build first. Now these tests pass in a fresh tree that's never seen a Maven build.
This commit is contained in:
parent
d745f4509f
commit
2e54ec4b0c
|
@ -17,6 +17,7 @@ dependencies {
|
||||||
project(':com.ibm.wala.util'),
|
project(':com.ibm.wala.util'),
|
||||||
project(configuration: 'testArchives', path: ':com.ibm.wala.core.tests'),
|
project(configuration: 'testArchives', path: ':com.ibm.wala.core.tests'),
|
||||||
)
|
)
|
||||||
|
testRuntime 'com.google.android:android:4.1.1.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
task cloneDroidBench(type: Exec) {
|
task cloneDroidBench(type: Exec) {
|
||||||
|
@ -29,9 +30,24 @@ task cloneDroidBench(type: Exec) {
|
||||||
// TODO: should check out a specific tag or hash
|
// TODO: should check out a specific tag or hash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: can Gradle's dependency system manage this download for us?
|
||||||
|
task downloadAndroidJar(type: de.undercouch.gradle.tasks.download.Download) {
|
||||||
|
src 'http://central.maven.org/maven2/com/google/android/android/4.1.1.4/android-4.1.1.4.jar'
|
||||||
|
dest new File(temporaryDir, 'android.jar')
|
||||||
|
overwrite false
|
||||||
|
}
|
||||||
|
|
||||||
|
task verifyAndroidJar(type: VerifyWithStamp, dependsOn: downloadAndroidJar) {
|
||||||
|
src files(downloadAndroidJar)[0]
|
||||||
|
checksum '88be04f4d84d58fadee2e780a322fdb9'
|
||||||
|
}
|
||||||
|
|
||||||
processTestResources {
|
processTestResources {
|
||||||
dependsOn cloneDroidBench
|
dependsOn cloneDroidBench
|
||||||
|
|
||||||
|
dependsOn verifyAndroidJar
|
||||||
|
from downloadAndroidJar
|
||||||
|
|
||||||
def testdata = project(':com.ibm.wala.core.testdata')
|
def testdata = project(':com.ibm.wala.core.testdata')
|
||||||
dependsOn testdata.verifyJavaCup
|
dependsOn testdata.verifyJavaCup
|
||||||
from testdata.collectJLex
|
from testdata.collectJLex
|
||||||
|
|
Loading…
Reference in New Issue