I have a multiproject build with the following layout.
TopLevelProject
/SubProjA/src
/SubProjB/src
/SubProjC/src
/tests -- all unit tests for SubProjects
/lib -- JAR files required for compile of SubProjects
build.gradle
settings.gradle
How can I specify the classpath for tests to include the compiled classes
(or generated JARS) from the subprojects?
The tests directory contains the src code for junit tests for all of the
subprojects.
I have the subprojects compiling OK, but compiling the unit test classes in
TopLevelProject/tests keeps failing as the compiled classes in the
subprojects aren't on the classpath.
My build.gradle file is shown below. Thanks.
apply plugin: 'java'
dependsOnChildren()
allprojects {
sourceCompatibility = 1.5
targetCompatibility = 1.5
}
sourceSets {
test {
java {
srcDir 'tests'
}
resources {
srcDir 'tests'
}
}
}
subprojects {
apply plugin: 'java'
sourceSets.main.java.srcDir 'src'
dependencies{
//TODO remove hard-coded references to D:/workspace
compile fileTree(dir: 'D:/workspace/uwm/lib', include: '*.jar'),
fileTree(dir: 'D:/workspace/uwm/build/lib', include: '*.jar')
}
}
project(':SubProjB') {
dependencies.compile project(':SubProjA')
}
project(':SubProjC') {
dependencies.compile project(':SubProjB')
}
--
View this message in context:
http://gradle.1045684.n5.nabble.com/testCompile-classpath-for-multiproject-build-tp2228146p2228146.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email