Hi All,
I stumbled upon an enigma I hope you guys can help solve.
Say you have a multi-project build with 3 projects (to keep it easy) such as
core
+ build.gradle
+ server
+-- build.gradle
+ client
+-- build.gradle
+ shared
+-- build.gradle
server|client/build.gradle defines the following only
dependencies {
compile project(':shared')
}
while shared/build.gradle has
jar.enabled = false
The reason for disabling jar generation for :shared is that this build will
combine :shared.sourceSets.main.output with :client and :server accordingly.
Now for the problem. If I leave the configuration as is then both :client and
:server will fail during compilation as long as they refer to classes found in
:shared. Running with -d shows that the classpath only contains the output path
for :server (build/classes/main for instance). Enabling jar generation on
:shared makes the build green as shared.jar is now found in the classpath.
So, here I am expecting the build to take into account the output from
:shared.sourceSets.main.output and not :shared.jar.outputs.files in order to
construct the classpath of a dependent project. My question is then, is this a
corner case not implemented? Am I working on the wrong assumptions?
TIA
Andres