Created
March 30, 2022 15:27
-
-
Save bric3/61145974988ddb9ec87aa9b9cee36a89 to your computer and use it in GitHub Desktop.
Adding composite build programmatically as an alternative to https://www.jetbrains.com/help/idea/work-with-gradle-projects.html#gradle_composite_build
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
val fireplaceLocation = extra.has("fireplaceLocation").let { | |
if (it) extra.get("fireplaceLocation") as String | |
else null | |
} | |
if (!fireplaceLocation.isNullOrEmpty()) { | |
val location = when { | |
fireplaceLocation.startsWith("\$HOME") || fireplaceLocation.startsWith("~") -> { | |
fireplaceLocation.replaceFirst("~|\$HOME".toRegex(), System.getProperty("user.home")) | |
} | |
else -> fireplaceLocation | |
} | |
if (file(location).exists()) { | |
logger.lifecycle("Using composite build with fireplace at: $location") | |
includeBuild(location) { | |
dependencySubstitution { | |
substitute(module("io.github.bric3.fireplace:fireplace-swing")).using(project(":fireplace-swing")) | |
substitute(module("io.github.bric3.fireplace:fireplace-swing-animation")).using(project(":fireplace-swing-animation")) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment