Demonstration of composite build used to develop plugins with cyclic dependencies. The ligradle-jvm
plugin project
has a buildscript dependency on an older version of itself.
To make testing of this repository easier, the ligradle-jvm-0.1
build is separate from the under-development ligradle-jvm
project. Note that the ligradle-jvm
plugin adds a dummy 'precompile' task to any Java project.
To build these projects without a composite:
- Execute
gradle publish
in theligradle-core-0.1
build. This publishesligradle-core
to a local file repository. - Execute
gradle publish
in theligradle-jvm-0.1
build. This publishesligradle-jvm
to a local file repository with a dependency onligradle-core-0.1
. - Execute
gradle publish
in theligradle-core
build. This consumesligradle-jvm-0.1
as a buildscript dependency (applying theLiGradleJvmPlugin
) and publishesligradle-core
. - Execute
gradle publish
in theligradle-jvm
build. This consumesligradle-jvm-0.1
as a buildscript dependency (applying theLiGradleJvmPlugin
), andligradle-core-0.2
as a compile dependency. A new version of the pluginligradle-jvm-0.2
is published.
You could then make changes to ligradle-core
, publish (step 3), and make corresponding changes to ligradle-jvm
before building (step 4).
The ligradle-composite
build is a test application that consumes the plugin produced by ligradle-jvm-0.2
. This can be used to
make and test changes in ligradle-jvm
and ligradle-core
.
To see this in action:
- Execute
gradle run
in theligradle-composite
build. You'll see the plugin projects being built as part of configuring the build. - Execute
gradle idea
in theligradle-composite
build. The generated IDEA project allows refactoring ofligradle-core
andligradle-jvm
together.