Recently I read the article about
composite builds and realized that it is what I need. But I haven’t had any success with it so I need your professional help.
I have a project which components are located in separated git repositories. These components depend on each other in some way so it is quite inconvenient to do any modification in the code. So when I’ve found out the
composite build feature I tried to apply it for my case.
I did a synthetic repository which contains only git submodules for all components. Then I added a folder which contains only Gradle files to define
composite build. So I got quite simple structure like this:
/all-components ├ /build │ ├ build.gradle │ ├ gradle.properties │ └ settings.gradle ├ /component1 │ ├ ... │ └ build.gradle ├ /component2 │ ├ ... │ └ build.gradle ├ /component3 │ ├ ... │ └ build.gradle └ .gitmodules
Then I defined all included builds in the
build/settings.gradle file like below:
rootProject.name = 'all-components' includeBuild '../component1' includeBuild '../component2' includeBuild '../component3'
So when I performed
gradle build command I’ve expected to see build-artifacts in each component’s subfolder as if I would performed manually
gradle build command within each component’s subfolder. But my expectations weren’t met.
Yes, I saw examples on GitHub. They have some root project which contains source code and defines dependencies for all subprojects. In my case I don’t have a root project which depends on all subprojects. Most likely I have several independent components some of them depend on each other. And I would like to combine them by making synthetic
composite build project.
Could you give me advice how to solve this problem?