@@ -26,6 +26,40 @@ dependencyResolutionManagement {
26
26
}
27
27
}
28
28
29
+ // TODO This is largely shared with aws-sdk-kotlin, consider commonizing
30
+ // Set up a sibling directory aws-crt-kotlin as a composite build, if it exists.
31
+ // Allows overrides via local.properties:
32
+ // compositeProjects=~/repos/aws-crt-kotlin,/tmp/some/other/thing,../../another/project
33
+ val compositeProjectList = try {
34
+ val localProperties = java.util.Properties ().also {
35
+ it.load(File (rootProject.projectDir, " local.properties" ).inputStream())
36
+ }
37
+ val compositeProjects = localProperties.getProperty(" compositeProjects" ) ? : " ../aws-crt-kotlin"
38
+
39
+ val compositeProjectPaths = compositeProjects.split(" ," )
40
+ .map { it.replaceFirst(" ^~" .toRegex(), System .getProperty(" user.home" )) } // expand ~ to user's home directory
41
+ .filter { it.isNotBlank() }
42
+ .map { file(it) }
43
+
44
+ compositeProjectPaths.also {
45
+ if (it.isNotEmpty()) {
46
+ println (" Adding composite build projects from local.properties: ${compositeProjectPaths.joinToString { it.name }} " )
47
+ }
48
+ }
49
+ } catch (_: Throwable ) {
50
+ logger.error(" Could not load composite project paths from local.properties" )
51
+ listOf (file(" ../aws-crt-kotlin" ))
52
+ }
53
+
54
+ compositeProjectList.forEach {
55
+ if (it.exists()) {
56
+ println (" Including build '$it '" )
57
+ includeBuild(it)
58
+ } else {
59
+ println (" Ignoring invalid build directory '$it '" )
60
+ }
61
+ }
62
+
29
63
rootProject.name = " smithy-kotlin"
30
64
31
65
include(" :dokka-smithy" )
0 commit comments