Also, It is not possible for us to club the two compilation steps into one. With that assumption, Is it possible to share both output directories (main and codeGen) for the modules dependent on this module? By default, only $buildDir/classes/java/main will be used for the dependency substitution.
I have much simplified our use case here, but if we can get the possible options for above mentioned scenario, we will be more than happy. We tried giving the same destinationDir for both the JavaCompile tasks but it leads us to unexpected problems during rebuild (as in build on already built code with some minor code changes). Also, by doing so, we are not able to leverage from the build cache and incremental build like features.
We have composite build with 180+ included builds with each build producing only one jar artifact. What is the recommendation for the above use case?
We tried sharing the output directories for both JavaCompile tasks viz. compileJava and
compileCodeGenJava and had issues wrt to build failures and also where not able to leverage UP-TO-DATE and FROM-CACHE like features .