Extract init scripts into resource files

This commit is contained in:
Daz DeBoer
2022-06-02 11:53:33 -06:00
parent bdf9736c53
commit d95713bd5d
3 changed files with 71 additions and 63 deletions

View File

@@ -0,0 +1,12 @@
// Capture the build root directory for each executed Gradle build.
// Only run against root build. Do not run against included builds.
def isTopLevelBuild = gradle.getParent() == null
if (isTopLevelBuild) {
settingsEvaluated { settings ->
def projectRootEntry = settings.rootDir.absolutePath + '\n'
def projectRootList = new File(settings.gradle.gradleUserHomeDir, "project-roots.txt")
if (!projectRootList.exists() || !projectRootList.text.contains(projectRootEntry)) {
projectRootList << projectRootEntry
}
}
}