Created
July 6, 2024 06:11
-
-
Save twyatt/b04c277e87f8ee6bbbf1766e36d0bdfe to your computer and use it in GitHub Desktop.
Include sibling projects as composite builds via `local.properties`
This file contains hidden or 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
// Configure sibling composite projects (`../<project>`) by adding `composite.<project>=true` to `local.properties`. | |
java.util.Properties() | |
.apply { | |
rootProject.projectDir | |
.resolve("local.properties") | |
.normalize() | |
.takeIf(File::exists) | |
?.let { java.io.FileInputStream(it) } | |
?.use(::load) | |
} | |
.run { | |
stringPropertyNames() | |
.filter { it.startsWith("composite.") && getProperty(it).toBoolean() } | |
.map { it.substringAfter('.') } | |
.onEach { logger.lifecycle("Including '$it' as a composite build") } | |
.map { "../$it" } | |
.forEach(::includeBuild) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment