A project I am working on, has lots of individual repositories that are independant gradle projects(“modules”) with function, for example “Analytics”, “Storage”, “Networking”, etc.
They all work independently via their gradle scripts, but they all depend on a common composite build called kmp-scripts which is the same in all the projects.
The structure is like this for each ‘module’
- projectFolder/
– kmp-scripts
– shared - build.gradle.kts
- settings.gradle.kts
Where in the settings.gradle.kts we have
include(“:shared”)
includeBuild(“kmp-scripts”)
This all works fine individually, but because we have lots of individual modules, it would be nice to have a single project that couples everything together, so that when a change is made locally i can check easily by running a build on all the modules.
So i created a gradle project that has git submodules of all the modules.
The structure is like this
- MegaProjectFolder/
– Analytics/
– Networking/
– Storage/
build.gradle.kts
settings.gradle.kts
Where the settings.gradle.kts has the following
includeBuild(“Analytics”)
includeBuild(“Networking”)
includeBuild(“Storage”)
The problem is, because they all includeBuild kmp-scripts, i get the following error:
Included build
MegaProjectFolder/Analytics/kmp-scripts has build path :kmp-scripts which is the same as included build MegaProjectFolder/Storage/kmp-scripts
I tried a few alternative solutions, one which was to move the kmp-scripts folder into the root of the mega project but then my modules cannot find the plugin(kmp-scripts) are used as a plugin.
Sorry for essay, its a tricky one, and one i cannot easily make a public repo for. It has me stumped, as i thought when you add a project as a composite build, then it would be evaluated independantly.