code_name
code_name

Reputation: 125

Gradle Composite Build: How to configure Tasks for all included builds

I am new to gradle composite builds. I have a multi-project build that uses precompiled script plugins in order to have tasks configured for all projects that include the plugin. Now I want to port that functionality to a composite build setup.

The screenshots below show how the current multi-project build works: java-precompiled-script-plugin This java precompiled script plugin (/buildSrc/.../java-conventions.gradle.kts) configures the "JavaCompile" tasks (i.e. sourceCompatability, targetCompatability...). enter image description here This kotlin precompiled script plugin imports the java conventions plugin and configures the "KotlinCompile" tasks. enter image description here Applying the the kotlin conventions plugin to project "test" automagically sets up my project with the proper "JavaCompile" and "KotlinCompile" configuration as shown above.

I have read the official docs and tutorials on gradle composite builds. Still, I dont know the proper way how to do this with composite builds. Do I have to write standalone plugins for this? If so, can you provide a POC code snippet? Any advice is greatly appreciated!

Upvotes: 4

Views: 755

Answers (0)

Related Questions