Teach Gradle how to download "/tmp/DroidBench" when needed

One less thing for developers to have to remember to do manually!
This commit is contained in:
Ben Liblit 2018-01-17 10:39:27 -06:00
parent e9eb934b82
commit 3ba04469ad
3 changed files with 22 additions and 4 deletions

View File

@ -9,10 +9,7 @@ addons:
packages:
- realpath
- xvfb
before_install:
- echo $ANDROID_HOME
- git clone --depth=1 https://github.com/secure-software-engineering/DroidBench.git /tmp/DroidBench
- source "travis/before-install-$BUILD_SYSTEM"
before_install: source "travis/before-install-$BUILD_SYSTEM"
install: source "travis/install-$BUILD_SYSTEM"
script: source "travis/script-$BUILD_SYSTEM"
before_cache: source "travis/before-cache-$BUILD_SYSTEM"

View File

@ -18,3 +18,22 @@ dependencies {
project(configuration: 'testArchives', path: ':com.ibm.wala.core.tests'),
)
}
task cloneDroidBench(type: Exec) {
// TODO: download to somewhere private to this build tree; update code that looks in "/tmp" accordingly
def destDir = '/tmp/DroidBench'
inputs.property('repository', 'https://github.com/secure-software-engineering/DroidBench.git')
outputs.dirs destDir
doFirst { delete destDir }
commandLine 'git', 'clone', '--depth=1', inputs.properties.repository, destDir
// TODO: should check out a specific tag or hash
}
processTestResources {
dependsOn cloneDroidBench
def testdata = project(':com.ibm.wala.core.testdata')
dependsOn testdata.verifyJavaCup
from testdata.collectJLex
from testdata.downloadJavaCup
}

View File

@ -1,5 +1,7 @@
# -*- mode: sh; sh-shell: sh -*-
git clone --depth=1 https://github.com/secure-software-engineering/DroidBench.git /tmp/DroidBench
export M2_HOME=$HOME/apache-maven-3.5.0
if [ ! -d $M2_HOME/bin ]; then