We have broken down our build scripts into several smaller, purpose-specific scripts that can be applied if a project or module needs to use them. For example, if you are using Kotlin, we apply
a kotlin.gradle
script that sets the project up to use Kotlin; if we use Sonarqube, same story - just apply
a sonarqube.gradle
script.
Currently those scripts reside in a separate repository, and we use git submodule
to create a local “copy” of those scripts and share them across different projects. This works; however, I’m wondering if there is a way to package those scripts in a Jar file that we publish to a repository, and then bootstrap our main script by declaring a dependency on that Jar that would make those scripts visible, so we can apply
them.
Or am I smoking something pretty hard core?