Issue
I have a multi-project configuration and I want to use gradle.
My projects are like this:
Project A
- ->
src/main/java - ->
src/test/java
- ->
Project B
- ->
src/main/java(depends onsrc/main/javaon Project A) - ->
src/test/java(depends onsrc/test/javaon Project A)
- ->
My Project B build.gradle file is like this:
apply plugin: 'java'
dependencies {
compile project(':ProjectA')
}
The task compileJava work great but the compileTestJava does not compile the test file from Project A.
Solution
Deprecated - For Gradle 5.6 and above use this answer.
In Project B, you just need to add a testCompile dependency:
dependencies {
...
testCompile project(':A').sourceSets.test.output
}
Tested with Gradle 1.7.
Answered By - Fesler
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.