Add support for running arbitrary experiments with our classpath

This commit is contained in:
R. Tyler Croy 2015-09-04 09:15:20 -07:00
parent 7e2d1691ca
commit 65a6a19b6d
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 28 additions and 1 deletions

View File

@ -18,13 +18,21 @@ repositories {
jcenter() jcenter()
} }
configurations {
experimentsCompile.extendsFrom compile
}
dependencies { dependencies {
compile 'org.apache.curator:curator-framework:[2.7.1,2.8)' ['framework', 'recipes'].each {
compile "org.apache.curator:curator-${it}:[2.7.1,2.8)"
}
compile 'io.reactivex:rxjava:[1.0.14,2.0)' compile 'io.reactivex:rxjava:[1.0.14,2.0)'
compile 'org.apache.kafka:kafka_2.11:0.8.2.1' compile 'org.apache.kafka:kafka_2.11:0.8.2.1'
testCompile "org.spockframework:spock-core:1.0-groovy-2.4" testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
testCompile 'cglib:cglib-nodep:3.1' testCompile 'cglib:cglib-nodep:3.1'
experimentsCompile 'org.codehaus.groovy:groovy-all:[2.4.4,2.5)'
} }
idea { idea {
@ -43,3 +51,20 @@ test {
assemble.dependsOn check assemble.dependsOn check
install.dependsOn assemble install.dependsOn assemble
sourceSets {
experiments {
groovy {
srcDir "${projectDir}/src/experiments"
}
}
}
task runExperiment(type: JavaExec) {
description "Run an experiment, must have -PexperimentClass=foo set"
dependsOn classes, test
main experimentClass
classpath sourceSets.main.runtimeClasspath + sourceSets.experiments.runtimeClasspath
inputs.source sourceSets.experiments.allSource
}

View File

@ -2,3 +2,5 @@
sourceCompatibility=1.7 sourceCompatibility=1.7
targetCompatibility=1.7 targetCompatibility=1.7
experimentClass=