Created
June 25, 2019 20:04
-
-
Save NathanHowell/ff90272cc2a62b6239394eee27cfde19 to your computer and use it in GitHub Desktop.
Example settings.gradle to dynamically derive projects from build.gradle files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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