From 7bbdced81511353d1ae085e7032d7048195361ae Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 2 Apr 2025 16:11:07 -0400 Subject: [PATCH 1/3] Include aws-crt-kotlin as a composite build --- settings.gradle.kts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 414df686a0..610f3f9371 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,6 +26,40 @@ dependencyResolutionManagement { } } +// Set up a sibling directory aws-crt-kotlin as a composite build, if it exists. +// Allows overrides via local.properties: +// compositeProjects=~/repos/aws-crt-kotlin,/tmp/some/other/thing,../../another/project +val compositeProjectList = try { + val localProperties = java.util.Properties().also { + it.load(File(rootProject.projectDir, "local.properties").inputStream()) + } + val compositeProjects = localProperties.getProperty("compositeProjects") ?: "../aws-crt-kotlin" + + val compositeProjectPaths = compositeProjects.split(",") + .map { it.replaceFirst("^~".toRegex(), System.getProperty("user.home")) } // expand ~ to user's home directory + .filter { it.isNotBlank() } + .map { file(it) } + + compositeProjectPaths.also { + if (it.isNotEmpty()) { + println("Adding composite build projects from local.properties: ${compositeProjectPaths.joinToString { it.name }}") + } + } +} catch (_: Throwable) { + logger.error("Could not load composite project paths from local.properties") + listOf(file("../aws-crt-kotlin")) +} + +compositeProjectList.forEach { + if (it.exists()) { + println("Including build '$it'") + includeBuild(it) + } else { + println("Ignoring invalid build directory '$it'") + } +} + + rootProject.name = "smithy-kotlin" include(":dokka-smithy") From 53b545cdbad8e84adb0f97bb2efaccd280a62cae Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 2 Apr 2025 16:12:03 -0400 Subject: [PATCH 2/3] ktlint --- settings.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 610f3f9371..55215906ed 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -59,7 +59,6 @@ compositeProjectList.forEach { } } - rootProject.name = "smithy-kotlin" include(":dokka-smithy") From 05acf1de9f76621587eabc1a3283ec176b948858 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 3 Apr 2025 09:16:15 -0400 Subject: [PATCH 3/3] Add a TODO --- settings.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 55215906ed..2c8d3df112 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,6 +26,7 @@ dependencyResolutionManagement { } } +// TODO This is largely shared with aws-sdk-kotlin, consider commonizing // Set up a sibling directory aws-crt-kotlin as a composite build, if it exists. // Allows overrides via local.properties: // compositeProjects=~/repos/aws-crt-kotlin,/tmp/some/other/thing,../../another/project