zyxist / chainsaw

Gradle plugin: adds support for building Java 9 modules.
Apache License 2.0
71 stars 4 forks source link

Support composite builds #40

Open rgoldberg opened 6 years ago

rgoldberg commented 6 years ago

Please support composite builds.

If they are currently supposed to work, then please let me know and I'll try again to get Chainsaw 0.3.1 working with my Gradle Wrapper 4.8.1 composite build (on Java 10.0.1+10).

rgoldberg commented 6 years ago

If I have an included build (the dependent build) that depends on another included build (the dependency) through dependency substitution in the composite build:

So, I can eventually get my whole composite build to work, but it takes multiple iterations.

It seems possible that Gradle is building included builds in parallel, and that Chainsaw is not setting up some Gradle included build dependencies properly to force dependencies to to build before dependents. Or, it's possible that Chainsaw is setting up dependency relationships in a reverse order, etc.

I tried to disable parallel builds, but it seems like that didn't work. I've read somewhere that composite builds are always parallel, but I'm not sure if that's correct. If you know how to disable parallelism in composite builds, please let me know.

rgoldberg commented 6 years ago

Chainsaw needs to use CommandLineArgumentProvider instead of adding Strings to compileJava.getOptions().getCompilerArgs().

See Stefan Oehme's (the Gradle core team lead) post at:

https://discuss.gradle.org/t/how-does-a-composite-build-ensure-that-one-included-build-is-built-before-another/27711/2