Yusu Gao
06/12/2024, 3:06 PMrootProject/
| - subproject1/
| - build.gradle
| - config.gradle
| - sub/project2/
| - build.gradle
| - config.gradle
| build.gradle
| config.gradle
| settings.gradle
| scripts/
| gradlew
| ...
In subproject build.gradle file, it starts with
buildscript {
apply from: 'config.gradle' // the ./config.gradle will point to root project config.gradle with relative paths
...
}
And there is a common helper script for setting the project that will be downloaded to scripts/ and refered in the root config.gradle file as
project.ext.helperscript = "$project.rootDir/scripts/helper.gradle"
// some logic here to throw error if file doesn't exist
apply from: "$project.ext.helperscript"