Use download task instead of "git clone" to get DroidBench

This gives us better progress reporting during the download, better
caching, better file-level dependency tracking, etc.
This commit is contained in:
Ben Liblit 2018-03-06 12:37:17 -06:00
parent 813c79caa0
commit e4f9fedf38
1 changed files with 16 additions and 9 deletions

View File

@ -6,14 +6,21 @@ sourceSets.test {
] ]
} }
task cloneDroidBench(type: Exec) { task downloadDroidBench(type: VerifiedDownload) {
// TODO: download to somewhere private to this build tree; update code that looks in "/tmp" accordingly src 'https://github.com/secure-software-engineering/DroidBench/archive/DroidBench_2.0.zip'
def destDir = file('/tmp/DroidBench') dest "$temporaryDir/DroidBench_2.0.zip"
inputs.property('repository', 'https://github.com/secure-software-engineering/DroidBench.git') checksum '16726a48329835140e14f18470a1b4a3'
inputs.property('branch', 'DroidBench_2.0') }
outputs.dirs destDir
doFirst { delete destDir } task unpackDroidBench(type: Sync, dependsOn: downloadDroidBench) {
commandLine 'git', 'clone', "--branch=$inputs.properties.branch", '--config=advice.detachedHead=false', '--depth=1', '--quiet', inputs.properties.repository, destDir from(zipTree(files(downloadDroidBench).singleFile)) {
eachFile {
relativePath new RelativePath(!directory, relativePath.segments[1..-1] as String[])
}
}
into '/tmp/DroidBench'
includeEmptyDirs false
} }
task downloadAndroidSdk(type: VerifiedDownload) { task downloadAndroidSdk(type: VerifiedDownload) {
@ -104,7 +111,7 @@ dependencies {
} }
processTestResources { processTestResources {
dependsOn cloneDroidBench dependsOn unpackDroidBench
from copyAndroidJar from copyAndroidJar
from downloadSampleCup from downloadSampleCup