File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,40 @@ dependencyResolutionManagement {
2626 }
2727}
2828
29+ // Set up a sibling directory aws-crt-kotlin as a composite build, if it exists.
30+ // Allows overrides via local.properties:
31+ // compositeProjects=~/repos/aws-crt-kotlin,/tmp/some/other/thing,../../another/project
32+ val compositeProjectList = try {
33+ val localProperties = java.util.Properties ().also {
34+ it.load(File (rootProject.projectDir, " local.properties" ).inputStream())
35+ }
36+ val compositeProjects = localProperties.getProperty(" compositeProjects" ) ? : " ../aws-crt-kotlin"
37+
38+ val compositeProjectPaths = compositeProjects.split(" ," )
39+ .map { it.replaceFirst(" ^~" .toRegex(), System .getProperty(" user.home" )) } // expand ~ to user's home directory
40+ .filter { it.isNotBlank() }
41+ .map { file(it) }
42+
43+ compositeProjectPaths.also {
44+ if (it.isNotEmpty()) {
45+ println (" Adding composite build projects from local.properties: ${compositeProjectPaths.joinToString { it.name }} " )
46+ }
47+ }
48+ } catch (_: Throwable ) {
49+ logger.error(" Could not load composite project paths from local.properties" )
50+ listOf (file(" ../aws-crt-kotlin" ))
51+ }
52+
53+ compositeProjectList.forEach {
54+ if (it.exists()) {
55+ println (" Including build '$it '" )
56+ includeBuild(it)
57+ } else {
58+ println (" Ignoring invalid build directory '$it '" )
59+ }
60+ }
61+
62+
2963rootProject.name = " smithy-kotlin"
3064
3165include(" :dokka-smithy" )
You can’t perform that action at this time.
0 commit comments