Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example settings.gradle to dynamically derive projects from build.gradle files
// find all build.gradle files in the expected locations in the build tree
fileTree('.')
.matching {
exclude '**/src/**', '**/build/**', '**/.*'
include '**/build.gradle'
}
.each {
// then convert the file path to a project path
final relative = rootProject.projectDir.relativePath(it.parentFile)
final project = ":${relative.replace('/', ':')}"
// and include it in the build
include project
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.