From 5dc2a7c378713f336457a5a2bc631f3760d2cd3d Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 24 Oct 2024 10:10:10 -0400 Subject: [PATCH 01/51] Latest --- gradle/libs.versions.toml | 2 +- runtime/build.gradle.kts | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dfc7be76bf..35e30e843c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin-version = "2.0.21" dokka-version = "1.9.10" -aws-kotlin-repo-tools-version = "0.4.13" +aws-kotlin-repo-tools-version = "0.4.14-SNAPSHOT" # libs coroutines-version = "1.9.0" diff --git a/runtime/build.gradle.kts b/runtime/build.gradle.kts index d02316058c..603b4c5c75 100644 --- a/runtime/build.gradle.kts +++ b/runtime/build.gradle.kts @@ -14,6 +14,9 @@ plugins { val sdkVersion: String by project +// Apply KMP configuration from build plugin +configureKmpTargets() + // capture locally - scope issue with custom KMP plugin val libraries = libs @@ -33,6 +36,17 @@ subprojects { kotlin { explicitApi() + // FIXME -- Move to build plugin + macosX64() + macosArm64() + iosSimulatorArm64() + iosArm64() + iosX64() + linuxX64() + linuxArm64() + // FIXME - Setup docker files and cmake tasks + // mingwX64() + sourceSets { // dependencies available for all subprojects named("commonMain") { @@ -60,7 +74,7 @@ subprojects { kotlin.sourceSets.all { // Allow subprojects to use internal APIs // See https://kotlinlang.org/docs/reference/opt-in-requirements.html#opting-in-to-using-api - listOf("kotlin.RequiresOptIn").forEach { languageSettings.optIn(it) } + listOf("kotlin.RequiresOptIn", "kotlinx.cinterop.ExperimentalForeignApi").forEach { languageSettings.optIn(it) } } dependencies { From 6115504a7a2f78d0084c581681b85efee987506a Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 6 Nov 2024 09:28:16 -0500 Subject: [PATCH 02/51] Depend on -kn plugin --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 35e30e843c..cfb4b09069 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin-version = "2.0.21" dokka-version = "1.9.10" -aws-kotlin-repo-tools-version = "0.4.14-SNAPSHOT" +aws-kotlin-repo-tools-version = "0.4.14-kn" # libs coroutines-version = "1.9.0" From 4e6cc64ff46cd9c3f67b3fb2593cc94091e463a0 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 6 Nov 2024 14:33:14 -0500 Subject: [PATCH 03/51] Move `jvm` files to `jvmAndNative` where appropriate --- gradle/libs.versions.toml | 2 +- .../auth/awssigning/crt/CrtAwsSigner.kt | 0 .../crt/CrtAwsChunkedByteReadChannelTest.kt | 0 .../awssigning/crt/CrtAwsChunkedSourceTest.kt | 0 .../awssigning/crt/CrtBasicSigningTest.kt | 0 .../awssigning/crt/CrtSigningSuiteTest.kt | 0 .../awssigning/DefaultAwsChunkedSourceTest.kt | 0 .../tests/AwsChunkedSourceTestBase.kt | 0 .../test/AwsHttpSignerTestBaseJvm.kt | 0 runtime/crt-util/build.gradle.kts | 19 +++++++++++++++++-- .../runtime/crt/ReadChannelBodyStream.kt | 14 ++++++++++++++ .../runtime/crt/ReadChannelBodyStreamJvm.kt | 11 +++++++++++ .../src/aws/smithy/kotlin/runtime/crt/Http.kt | 0 .../runtime/crt/ReadChannelBodyStream.kt | 5 ----- .../smithy/kotlin/runtime/crt/SdkDefaultIO.kt | 0 .../kotlin/runtime/crt/SdkSourceBodyStream.kt | 0 .../aws/smithy/kotlin/runtime/crt/HttpTest.kt | 0 .../runtime/crt/ReadChannelBodyStreamTest.kt | 0 .../runtime/crt/SdkSourceBodyStreamTest.kt | 0 .../crt/ReadChannelBodyStreamNative.kt | 10 ++++++++++ .../context/TelemetryContextElementJVM.kt | 1 + .../http/engine/crt/ConnectionManager.kt | 0 .../runtime/http/engine/crt/CrtHttpEngine.kt | 0 .../http/engine/crt/CrtHttpEngineConfig.kt | 0 .../runtime/http/engine/crt/RequestUtil.kt | 0 .../engine/crt/SdkStreamResponseHandler.kt | 0 .../http/engine/crt/AsyncStressTest.kt | 1 + .../http/engine/crt/RequestConversionTest.kt | 0 .../http/engine/crt/RequestUtilTest.kt | 0 .../crt/SdkStreamResponseHandlerTest.kt | 0 .../http/engine/crt/SendChunkedBodyTest.kt | 0 .../build.gradle.kts | 2 +- .../build.gradle.kts | 2 +- .../runtime/http/test/suite/Downloads.kt | 1 + .../http/test/util/AbstractEngineTestJVM.kt | 1 + .../test/util/AbstractEngineTestNative.kt | 2 +- ...RequestCompressionInterceptorTestNative.kt | 2 +- .../runtime/io/SdkByteReadChannelJVM.kt | 1 - .../smithy/kotlin/runtime/time/InstantJVM.kt | 1 + .../kotlin/runtime/time/InstantNative.kt | 1 + settings.gradle.kts | 7 +++++++ 41 files changed, 70 insertions(+), 13 deletions(-) rename runtime/auth/aws-signing-crt/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsSigner.kt (100%) rename runtime/auth/aws-signing-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedByteReadChannelTest.kt (100%) rename runtime/auth/aws-signing-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedSourceTest.kt (100%) rename runtime/auth/aws-signing-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtBasicSigningTest.kt (100%) rename runtime/auth/aws-signing-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtSigningSuiteTest.kt (100%) rename runtime/auth/aws-signing-default/{jvm => common}/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultAwsChunkedSourceTest.kt (100%) rename runtime/auth/aws-signing-tests/{jvm => common}/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/AwsChunkedSourceTestBase.kt (100%) rename runtime/auth/http-auth-aws/{jvm => jvmAndNative}/test/AwsHttpSignerTestBaseJvm.kt (100%) create mode 100644 runtime/crt-util/common/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt create mode 100644 runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt rename runtime/crt-util/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/crt/Http.kt (100%) rename runtime/crt-util/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt (96%) rename runtime/crt-util/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/crt/SdkDefaultIO.kt (100%) rename runtime/crt-util/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStream.kt (100%) rename runtime/crt-util/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/crt/HttpTest.kt (100%) rename runtime/crt-util/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamTest.kt (100%) rename runtime/crt-util/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt (100%) create mode 100644 runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/engine/crt/ConnectionManager.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngine.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngineConfig.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtil.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt (97%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtilTest.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt (100%) rename runtime/protocol/http-client-engines/http-client-engine-crt/{jvm => jvmAndNative}/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt (100%) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cfb4b09069..d892c28487 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin-version = "2.0.21" dokka-version = "1.9.10" -aws-kotlin-repo-tools-version = "0.4.14-kn" +aws-kotlin-repo-tools-version = "0.4.15-kn-SNAPSHOT" # libs coroutines-version = "1.9.0" diff --git a/runtime/auth/aws-signing-crt/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsSigner.kt b/runtime/auth/aws-signing-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsSigner.kt similarity index 100% rename from runtime/auth/aws-signing-crt/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsSigner.kt rename to runtime/auth/aws-signing-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsSigner.kt diff --git a/runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedByteReadChannelTest.kt b/runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedByteReadChannelTest.kt similarity index 100% rename from runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedByteReadChannelTest.kt rename to runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedByteReadChannelTest.kt diff --git a/runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedSourceTest.kt b/runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedSourceTest.kt similarity index 100% rename from runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedSourceTest.kt rename to runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtAwsChunkedSourceTest.kt diff --git a/runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtBasicSigningTest.kt b/runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtBasicSigningTest.kt similarity index 100% rename from runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtBasicSigningTest.kt rename to runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtBasicSigningTest.kt diff --git a/runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtSigningSuiteTest.kt b/runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtSigningSuiteTest.kt similarity index 100% rename from runtime/auth/aws-signing-crt/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtSigningSuiteTest.kt rename to runtime/auth/aws-signing-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/auth/awssigning/crt/CrtSigningSuiteTest.kt diff --git a/runtime/auth/aws-signing-default/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultAwsChunkedSourceTest.kt b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultAwsChunkedSourceTest.kt similarity index 100% rename from runtime/auth/aws-signing-default/jvm/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultAwsChunkedSourceTest.kt rename to runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultAwsChunkedSourceTest.kt diff --git a/runtime/auth/aws-signing-tests/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/AwsChunkedSourceTestBase.kt b/runtime/auth/aws-signing-tests/common/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/AwsChunkedSourceTestBase.kt similarity index 100% rename from runtime/auth/aws-signing-tests/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/AwsChunkedSourceTestBase.kt rename to runtime/auth/aws-signing-tests/common/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/AwsChunkedSourceTestBase.kt diff --git a/runtime/auth/http-auth-aws/jvm/test/AwsHttpSignerTestBaseJvm.kt b/runtime/auth/http-auth-aws/jvmAndNative/test/AwsHttpSignerTestBaseJvm.kt similarity index 100% rename from runtime/auth/http-auth-aws/jvm/test/AwsHttpSignerTestBaseJvm.kt rename to runtime/auth/http-auth-aws/jvmAndNative/test/AwsHttpSignerTestBaseJvm.kt diff --git a/runtime/crt-util/build.gradle.kts b/runtime/crt-util/build.gradle.kts index ddc57d11a9..3d4f6ea1fa 100644 --- a/runtime/crt-util/build.gradle.kts +++ b/runtime/crt-util/build.gradle.kts @@ -11,14 +11,29 @@ extra["moduleName"] = "aws.smithy.kotlin.runtime.crt" kotlin { sourceSets { - jvmMain { + commonMain { + dependencies { + api(project(":runtime:runtime-core")) + api(libs.crt.kotlin) + } + } + + jvmAndNativeMain { dependencies { api(project(":runtime:runtime-core")) api(libs.crt.kotlin) api(project(":runtime:protocol:http")) } } - jvmTest { + +// nativeMain { +// dependencies { +// api(project(":runtime:runtime-core")) +// api(libs.crt.kotlin) +// } +// } + + jvmAndNativeTest { dependencies { implementation(libs.kotlinx.coroutines.test) } diff --git a/runtime/crt-util/common/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt b/runtime/crt-util/common/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt new file mode 100644 index 0000000000..e08f9f0d1f --- /dev/null +++ b/runtime/crt-util/common/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt @@ -0,0 +1,14 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.smithy.kotlin.runtime.crt + +import aws.sdk.kotlin.crt.io.MutableBuffer +import aws.smithy.kotlin.runtime.io.SdkBuffer + +/** + * write as much of [outgoing] to [dest] as possible + */ +internal expect fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer): Int diff --git a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt b/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt new file mode 100644 index 0000000000..ddc4cd279b --- /dev/null +++ b/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt @@ -0,0 +1,11 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package aws.smithy.kotlin.runtime.crt + +import aws.sdk.kotlin.crt.io.MutableBuffer +import aws.smithy.kotlin.runtime.io.SdkBuffer + +internal actual fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer) = outgoing.read(dest.buffer) \ No newline at end of file diff --git a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/Http.kt b/runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/Http.kt similarity index 100% rename from runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/Http.kt rename to runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/Http.kt diff --git a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt b/runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt similarity index 96% rename from runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt rename to runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt index 4a3e609808..040ba85459 100644 --- a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt +++ b/runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStream.kt @@ -18,11 +18,6 @@ import kotlin.time.Duration.Companion.milliseconds private val POLLING_DELAY = 100.milliseconds -/** - * write as much of [outgoing] to [dest] as possible - */ -internal fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer) = outgoing.read(dest.buffer) - /** * Implement's [HttpRequestBodyStream] which proxies an SDK request body channel [SdkByteReadChannel] */ diff --git a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/SdkDefaultIO.kt b/runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/SdkDefaultIO.kt similarity index 100% rename from runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/SdkDefaultIO.kt rename to runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/SdkDefaultIO.kt diff --git a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStream.kt b/runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStream.kt similarity index 100% rename from runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStream.kt rename to runtime/crt-util/jvmAndNative/src/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStream.kt diff --git a/runtime/crt-util/jvm/test/aws/smithy/kotlin/runtime/crt/HttpTest.kt b/runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/HttpTest.kt similarity index 100% rename from runtime/crt-util/jvm/test/aws/smithy/kotlin/runtime/crt/HttpTest.kt rename to runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/HttpTest.kt diff --git a/runtime/crt-util/jvm/test/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamTest.kt b/runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamTest.kt similarity index 100% rename from runtime/crt-util/jvm/test/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamTest.kt rename to runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamTest.kt diff --git a/runtime/crt-util/jvm/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt b/runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt similarity index 100% rename from runtime/crt-util/jvm/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt rename to runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt diff --git a/runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt b/runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt new file mode 100644 index 0000000000..7a590a474a --- /dev/null +++ b/runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt @@ -0,0 +1,10 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package aws.smithy.kotlin.runtime.crt + +import aws.sdk.kotlin.crt.io.MutableBuffer +import aws.smithy.kotlin.runtime.io.SdkBuffer + +internal actual fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer): Int = TODO("Not yet implemented") \ No newline at end of file diff --git a/runtime/observability/telemetry-api/jvm/src/aws/smithy/kotlin/runtime/telemetry/context/TelemetryContextElementJVM.kt b/runtime/observability/telemetry-api/jvm/src/aws/smithy/kotlin/runtime/telemetry/context/TelemetryContextElementJVM.kt index d6680f0d69..e8548ad31c 100644 --- a/runtime/observability/telemetry-api/jvm/src/aws/smithy/kotlin/runtime/telemetry/context/TelemetryContextElementJVM.kt +++ b/runtime/observability/telemetry-api/jvm/src/aws/smithy/kotlin/runtime/telemetry/context/TelemetryContextElementJVM.kt @@ -10,6 +10,7 @@ import kotlinx.coroutines.ThreadContextElement import kotlin.coroutines.AbstractCoroutineContextElement import kotlin.coroutines.CoroutineContext +// FIXME Move to jvmAndNative when https://github.com/Kotlin/kotlinx.coroutines/issues/3326 is implemented @InternalApi public actual class TelemetryContextElement public actual constructor( public actual val context: Context, diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/ConnectionManager.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/ConnectionManager.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/ConnectionManager.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/ConnectionManager.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngine.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngine.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngine.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngine.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngineConfig.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngineConfig.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngineConfig.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/CrtHttpEngineConfig.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtil.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtil.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtil.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtil.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt similarity index 97% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt index 7ad57fa1a0..96efc44f7a 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt @@ -25,6 +25,7 @@ import kotlinx.coroutines.yield import kotlin.test.Test import kotlin.time.Duration.Companion.seconds +// FIXME This test implements [TestWithLocalServer] which is JVM-only. class AsyncStressTest : TestWithLocalServer() { override val server = embeddedServer(CIO, serverPort) { diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtilTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtilTest.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtilTest.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestUtilTest.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt similarity index 100% rename from runtime/protocol/http-client-engines/http-client-engine-crt/jvm/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt rename to runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp/build.gradle.kts b/runtime/protocol/http-client-engines/http-client-engine-okhttp/build.gradle.kts index 3e5d139381..0e12749c09 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-okhttp/build.gradle.kts +++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp/build.gradle.kts @@ -9,7 +9,7 @@ extra["moduleName"] = "aws.smithy.kotlin.runtime.http.engine.okhttp" kotlin { sourceSets { - commonMain { + jvmMain { dependencies { implementation(project(":runtime:runtime-core")) api(project(":runtime:protocol:http-client")) diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp4/build.gradle.kts b/runtime/protocol/http-client-engines/http-client-engine-okhttp4/build.gradle.kts index 26145b4065..f6b3f12668 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-okhttp4/build.gradle.kts +++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp4/build.gradle.kts @@ -9,7 +9,7 @@ extra["moduleName"] = "aws.smithy.kotlin.runtime.http.engine.okhttp4" kotlin { sourceSets { - commonMain { + jvmMain { dependencies { api(project(":runtime:protocol:http-client")) implementation(project(":runtime:protocol:http-client-engines:http-client-engine-okhttp")) diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt b/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt index dd495edf24..d524f647a3 100644 --- a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt +++ b/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt @@ -53,6 +53,7 @@ internal fun Application.downloadTests() { call.response.header("x-bar", "bar") } + // FIXME This is the only thing keeping this directory in `jvm`, could be `jvmAndNative` get("/gzipped") { val uncompressed = ByteArray(1024) { it.toByte() } val compressed = ByteArrayOutputStream().use { baStream -> diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestJVM.kt b/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestJVM.kt index fa091c1f03..6f0d9182d1 100644 --- a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestJVM.kt +++ b/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestJVM.kt @@ -11,6 +11,7 @@ import aws.smithy.kotlin.runtime.http.engine.okhttp4.OkHttp4Engine import aws.smithy.kotlin.runtime.net.url.Url internal actual fun engineFactories(): List = + // FIXME Move DefaultHttpEngine and CrtHttpEngine to `jvmAndNative` listOf( TestEngineFactory("DefaultHttpEngine", ::DefaultHttpEngine), TestEngineFactory("CrtHttpEngine") { CrtHttpEngine(it) }, diff --git a/runtime/protocol/http-client-engines/test-suite/native/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestNative.kt b/runtime/protocol/http-client-engines/test-suite/native/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestNative.kt index bfb3ff18f4..05f82f63d0 100644 --- a/runtime/protocol/http-client-engines/test-suite/native/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestNative.kt +++ b/runtime/protocol/http-client-engines/test-suite/native/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestNative.kt @@ -7,7 +7,7 @@ package aws.smithy.kotlin.runtime.http.test.util import aws.smithy.kotlin.runtime.net.url.Url -// FIXME add engines to test +// FIXME Move CRT and Default engine tests to `jvmAndNative` internal actual fun engineFactories(): List = listOf() diff --git a/runtime/protocol/http-client/native/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTestNative.kt b/runtime/protocol/http-client/native/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTestNative.kt index 74cbd525c2..7d55f18341 100644 --- a/runtime/protocol/http-client/native/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTestNative.kt +++ b/runtime/protocol/http-client/native/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTestNative.kt @@ -5,5 +5,5 @@ package aws.smithy.kotlin.runtime.http.interceptors internal actual fun decompressGzipBytes(bytes: ByteArray): ByteArray { - TODO("Not yet implemented") + TODO("Not yet implemented. Can we write a pure Kotlin implementation?") } diff --git a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/io/SdkByteReadChannelJVM.kt b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/io/SdkByteReadChannelJVM.kt index 5afef01745..2986b998a3 100644 --- a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/io/SdkByteReadChannelJVM.kt +++ b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/io/SdkByteReadChannelJVM.kt @@ -6,7 +6,6 @@ package aws.smithy.kotlin.runtime.io import kotlinx.coroutines.runBlocking import java.io.InputStream -import java.util.* /** * Create a blocking [InputStream] that blocks everytime the channel suspends at [SdkByteReadChannel.read] diff --git a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt index b90a57de82..e1a17cd8c0 100644 --- a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt +++ b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt @@ -26,6 +26,7 @@ import kotlin.time.toKotlinDuration import java.time.Duration as jtDuration import java.time.Instant as jtInstant +// FIXME Consider making this multiplatform (`common`) using kotlinx.datetime public actual class Instant(internal val value: jtInstant) : Comparable { public actual val epochSeconds: Long get() = value.epochSecond diff --git a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt index 00bc92f2fa..56e4b8d3ba 100644 --- a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt +++ b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt @@ -7,6 +7,7 @@ package aws.smithy.kotlin.runtime.time import kotlin.time.Duration +// FIXME Consider making this multiplatform (`common`) using kotlinx.datetime public actual class Instant : Comparable { actual override fun compareTo(other: Instant): Int { TODO("Not yet implemented") diff --git a/settings.gradle.kts b/settings.gradle.kts index 414df686a0..2bcd8f0d5e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,6 +26,13 @@ dependencyResolutionManagement { } } +// Set up aws-crt-kotlin as a composite build +val localAwsCrtKotlin = file("../aws-crt-kotlin") +if(localAwsCrtKotlin.exists()) { + println("Including aws-crt-kotlin as a composite build") + includeBuild(localAwsCrtKotlin) +} + rootProject.name = "smithy-kotlin" include(":dokka-smithy") From 83087c5ff4898bd2b479e7871a26a215bdf116ac Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 6 Nov 2024 14:33:38 -0500 Subject: [PATCH 04/51] Remove commented block --- runtime/crt-util/build.gradle.kts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/runtime/crt-util/build.gradle.kts b/runtime/crt-util/build.gradle.kts index 3d4f6ea1fa..f14fb5c439 100644 --- a/runtime/crt-util/build.gradle.kts +++ b/runtime/crt-util/build.gradle.kts @@ -26,13 +26,6 @@ kotlin { } } -// nativeMain { -// dependencies { -// api(project(":runtime:runtime-core")) -// api(libs.crt.kotlin) -// } -// } - jvmAndNativeTest { dependencies { implementation(libs.kotlinx.coroutines.test) From a5b1be080f81c1e65439eb5eab3976d64e641fba Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 6 Nov 2024 14:33:43 -0500 Subject: [PATCH 05/51] ktlint --- .../aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt | 2 +- .../smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt b/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt index ddc4cd279b..7703ef5895 100644 --- a/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt +++ b/runtime/crt-util/jvm/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamJvm.kt @@ -8,4 +8,4 @@ package aws.smithy.kotlin.runtime.crt import aws.sdk.kotlin.crt.io.MutableBuffer import aws.smithy.kotlin.runtime.io.SdkBuffer -internal actual fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer) = outgoing.read(dest.buffer) \ No newline at end of file +internal actual fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer) = outgoing.read(dest.buffer) diff --git a/runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt b/runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt index 7a590a474a..09eb88dfd8 100644 --- a/runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt +++ b/runtime/crt-util/native/src/aws/smithy/kotlin/runtime/crt/ReadChannelBodyStreamNative.kt @@ -7,4 +7,4 @@ package aws.smithy.kotlin.runtime.crt import aws.sdk.kotlin.crt.io.MutableBuffer import aws.smithy.kotlin.runtime.io.SdkBuffer -internal actual fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer): Int = TODO("Not yet implemented") \ No newline at end of file +internal actual fun transferRequestBody(outgoing: SdkBuffer, dest: MutableBuffer): Int = TODO("Not yet implemented") From cbdfb3fa706f60eb6344e15afc0966833d06b5c7 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 6 Nov 2024 14:42:26 -0500 Subject: [PATCH 06/51] ktlint --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 2bcd8f0d5e..956a64ad1c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,7 @@ dependencyResolutionManagement { // Set up aws-crt-kotlin as a composite build val localAwsCrtKotlin = file("../aws-crt-kotlin") -if(localAwsCrtKotlin.exists()) { +if (localAwsCrtKotlin.exists()) { println("Including aws-crt-kotlin as a composite build") includeBuild(localAwsCrtKotlin) } From f3a1ec61e359752e5d84e842ce39613d874ebe35 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 6 Nov 2024 14:58:52 -0500 Subject: [PATCH 07/51] Revert to non-SNAPSHOT version --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f52e99a5cf..e25cb74c35 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin-version = "2.0.21" dokka-version = "1.9.10" -aws-kotlin-repo-tools-version = "0.4.15-kn-SNAPSHOT" +aws-kotlin-repo-tools-version = "0.4.14-kn" # libs coroutines-version = "1.9.0" From 29e00d09f2f3ada639ae05d1beb0166282a39de9 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 12:14:56 -0500 Subject: [PATCH 08/51] Re-enable warnings as errors --- .github/workflows/continuous-integration.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9b0dc1c880..f66d0b8d1b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -60,8 +60,7 @@ jobs: - name: Test shell: bash run: | - # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 - # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck ./gradlew test jvmTest - name: Save Test Reports From 8c3d77a11125402a65cca9eae26876fb59aba0de Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 12:15:19 -0500 Subject: [PATCH 09/51] Remove K/N targets setup from build script --- runtime/build.gradle.kts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/runtime/build.gradle.kts b/runtime/build.gradle.kts index 603b4c5c75..0d1f151e38 100644 --- a/runtime/build.gradle.kts +++ b/runtime/build.gradle.kts @@ -36,17 +36,6 @@ subprojects { kotlin { explicitApi() - // FIXME -- Move to build plugin - macosX64() - macosArm64() - iosSimulatorArm64() - iosArm64() - iosX64() - linuxX64() - linuxArm64() - // FIXME - Setup docker files and cmake tasks - // mingwX64() - sourceSets { // dependencies available for all subprojects named("commonMain") { From 81e8f3b24fab7f45b78804cfb3aeafdf00abd9a6 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 12:23:14 -0500 Subject: [PATCH 10/51] Replace `all-platforms` `test jvmTest` with `allTests` --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f66d0b8d1b..c187955ea7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -62,7 +62,7 @@ jobs: run: | echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck - ./gradlew test jvmTest + ./gradlew allTests - name: Save Test Reports if: failure() uses: actions/upload-artifact@v3 From 5e035082674a278bb4334d1e907ae36f58f52806 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 12:24:12 -0500 Subject: [PATCH 11/51] Ignore *.cinteropLibraries.json --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 225fe6070b..a776ae3ff1 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,5 @@ gradle-app.setting # MacOS .DS_Store + +*.cinteropLibraries.json From 256fef506476e6f81959edaba27ba63f596d8b34 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 12:28:08 -0500 Subject: [PATCH 12/51] WarningsAsErrors --- .github/workflows/continuous-integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index c187955ea7..f8228f9c7d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -60,7 +60,8 @@ jobs: - name: Test shell: bash run: | - echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 + # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck ./gradlew allTests - name: Save Test Reports From a2ad3efa3195fb74e4328a907f446010e7437854 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 12:29:21 -0500 Subject: [PATCH 13/51] WarningsAsErrors --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f8228f9c7d..4745be6a69 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -61,7 +61,7 @@ jobs: shell: bash run: | # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 - # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck ./gradlew allTests - name: Save Test Reports From bc6b343ff839e1a5bb898c152f2ca6e6b70afbdd Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 12:29:34 -0500 Subject: [PATCH 14/51] WarningsAsErrors --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4745be6a69..00bcf28fcf 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -61,7 +61,7 @@ jobs: shell: bash run: | # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 - # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck ./gradlew allTests - name: Save Test Reports From a5fa0daf547af63a86c5506f1640c77201c5cada Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 14:16:44 -0500 Subject: [PATCH 15/51] Create a setup-build script to checkout aws-crt-kotlin as a sibling directory --- .github/actions/setup-build/action.yml | 26 +++++++++++++ .github/workflows/continuous-integration.yml | 40 ++++---------------- 2 files changed, 34 insertions(+), 32 deletions(-) create mode 100644 .github/actions/setup-build/action.yml diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml new file mode 100644 index 0000000000..b2a233cfae --- /dev/null +++ b/.github/actions/setup-build/action.yml @@ -0,0 +1,26 @@ +name: Setup Build +description: > + Checkout repositories and build dependencies + +runs: + using: composite + steps: + - name: Checkout tools + uses: actions/checkout@v4 + with: + path: 'aws-kotlin-repo-tools' + repository: 'awslabs/aws-kotlin-repo-tools' + sparse-checkout: | + .github + - name: Checkout aws-crt-kotlin + uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head + with: + # checkout aws-crt-kotlin as a sibling which will automatically make it an included build + path: 'aws-crt-kotlin' + repository: 'awslabs/aws-crt-kotlin' + - name: Configure JDK + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: 17 + cache: 'gradle' \ No newline at end of file diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 00bcf28fcf..3ec9a63def 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -31,12 +31,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 - - name: Configure JDK - uses: actions/setup-java@v3 - with: - distribution: 'corretto' - java-version: 17 - cache: 'gradle' + - name: Setup build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Test shell: bash run: | @@ -51,12 +47,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 - - name: Configure JDK - uses: actions/setup-java@v3 - with: - distribution: 'corretto' - java-version: 17 - cache: 'gradle' + - name: Setup build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Test shell: bash run: | @@ -76,12 +68,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 - - name: Configure JDK - uses: actions/setup-java@v3 - with: - distribution: 'corretto' - java-version: 17 - cache: 'gradle' + - name: Setup build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Test shell: bash run: | @@ -95,26 +83,14 @@ jobs: uses: actions/checkout@v4 with: path: 'smithy-kotlin' - - name: Checkout tools - uses: actions/checkout@v4 - with: - path: 'aws-kotlin-repo-tools' - repository: 'awslabs/aws-kotlin-repo-tools' - ref: '0.2.3' - sparse-checkout: | - .github + - name: Setup build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Checkout aws-sdk-kotlin uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: # smithy-kotlin is checked out as a sibling dir which will automatically make it an included build path: 'aws-sdk-kotlin' repository: 'awslabs/aws-sdk-kotlin' - - name: Configure JDK - uses: actions/setup-java@v3 - with: - distribution: 'corretto' - java-version: 17 - cache: 'gradle' - name: Build and Test aws-sdk-kotlin downstream run: | # TODO - JVM only From f71be448c14547e01a33c76d077a60d77b90eff5 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 14:23:03 -0500 Subject: [PATCH 16/51] Fix path --- .github/workflows/continuous-integration.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3ec9a63def..4eb116d905 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -32,7 +32,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - name: Setup build - uses: ./smithy-kotlin/.github/actions/setup-build + uses: ./.github/actions/setup-build - name: Test shell: bash run: | @@ -48,7 +48,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - name: Setup build - uses: ./smithy-kotlin/.github/actions/setup-build + uses: ./.github/actions/setup-build - name: Test shell: bash run: | @@ -69,7 +69,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - name: Setup build - uses: ./smithy-kotlin/.github/actions/setup-build + uses: ./.github/actions/setup-build - name: Test shell: bash run: | @@ -84,7 +84,7 @@ jobs: with: path: 'smithy-kotlin' - name: Setup build - uses: ./smithy-kotlin/.github/actions/setup-build + uses: ./.github/actions/setup-build - name: Checkout aws-sdk-kotlin uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: From 0e17527526f8493b4761e3c65d7f681b4872f9ed Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 14:49:07 -0500 Subject: [PATCH 17/51] Depend on 0.4.15-kn --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e25cb74c35..f7ecd97534 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin-version = "2.0.21" dokka-version = "1.9.10" -aws-kotlin-repo-tools-version = "0.4.14-kn" +aws-kotlin-repo-tools-version = "0.4.15-kn" # libs coroutines-version = "1.9.0" From fb048b375e2fa6fcdad1deafbfe4346b34cddfcb Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:03:16 -0500 Subject: [PATCH 18/51] CI From 1c10cc7ce76633eed8ded935a37db026c0b9fb7a Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:04:53 -0500 Subject: [PATCH 19/51] downstream .. --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4eb116d905..a9852085e6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -84,7 +84,7 @@ jobs: with: path: 'smithy-kotlin' - name: Setup build - uses: ./.github/actions/setup-build + uses: ../.github/actions/setup-build - name: Checkout aws-sdk-kotlin uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: From f6eb3c0aa054d27dd62517308c03116edccbfa4e Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:08:40 -0500 Subject: [PATCH 20/51] CI From cd4b31daf25d3a72bd4c3d819d01031e842885dc Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:12:09 -0500 Subject: [PATCH 21/51] Make it a path --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a9852085e6..68762bd06f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -84,7 +84,7 @@ jobs: with: path: 'smithy-kotlin' - name: Setup build - uses: ../.github/actions/setup-build + uses: ./../.github/actions/setup-build - name: Checkout aws-sdk-kotlin uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: From 3512d81e43229bdfb6b530ba206dd249bd69f3ae Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:13:59 -0500 Subject: [PATCH 22/51] Add debugging steps --- .github/workflows/continuous-integration.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 68762bd06f..bb23a352ce 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -83,6 +83,12 @@ jobs: uses: actions/checkout@v4 with: path: 'smithy-kotlin' + - name: Debug + run: | + echo "Debugging local situation" + pwd + ls . + ls ./../.github/ - name: Setup build uses: ./../.github/actions/setup-build - name: Checkout aws-sdk-kotlin From eae7a9cb2ddaf1abedd731d68ea17f8943f7af2c Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:15:18 -0500 Subject: [PATCH 23/51] More debug --- .github/workflows/continuous-integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bb23a352ce..df9b52de05 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -88,7 +88,8 @@ jobs: echo "Debugging local situation" pwd ls . - ls ./../.github/ + ls ./smithy-kotlin + ls ./smithy-kotlin/.github - name: Setup build uses: ./../.github/actions/setup-build - name: Checkout aws-sdk-kotlin From 8efb8e8f148bd2b6e12170bf1be1d9826fcca8fb Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:51:34 -0500 Subject: [PATCH 24/51] More debug --- .github/workflows/continuous-integration.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index df9b52de05..65daa0332e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -86,10 +86,14 @@ jobs: - name: Debug run: | echo "Debugging local situation" + echo "pwd" pwd - ls . - ls ./smithy-kotlin - ls ./smithy-kotlin/.github + echo "ls -a ." + ls -a . + echo "ls -a ./smithy-kotlin" + ls -a ./smithy-kotlin + echo "ls -a ./smithy-kotlin/.github" + ls -a ./smithy-kotlin/.github - name: Setup build uses: ./../.github/actions/setup-build - name: Checkout aws-sdk-kotlin From bccbbacea4aab89203169335eb741369f31b0dfa Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:54:48 -0500 Subject: [PATCH 25/51] More debug --- .github/workflows/continuous-integration.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 65daa0332e..a00b73ef4e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -94,8 +94,10 @@ jobs: ls -a ./smithy-kotlin echo "ls -a ./smithy-kotlin/.github" ls -a ./smithy-kotlin/.github + echo "ls -a ./smithy-kotlin/.github/actions" + ls -a ./smithy-kotlin/.github/actions - name: Setup build - uses: ./../.github/actions/setup-build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Checkout aws-sdk-kotlin uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: From bab02b186be2c6e89bd460ef345e7768be0f9554 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 15:57:14 -0500 Subject: [PATCH 26/51] Fixed, remove debug --- .github/workflows/continuous-integration.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a00b73ef4e..70c226b262 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -83,19 +83,6 @@ jobs: uses: actions/checkout@v4 with: path: 'smithy-kotlin' - - name: Debug - run: | - echo "Debugging local situation" - echo "pwd" - pwd - echo "ls -a ." - ls -a . - echo "ls -a ./smithy-kotlin" - ls -a ./smithy-kotlin - echo "ls -a ./smithy-kotlin/.github" - ls -a ./smithy-kotlin/.github - echo "ls -a ./smithy-kotlin/.github/actions" - ls -a ./smithy-kotlin/.github/actions - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - name: Checkout aws-sdk-kotlin From 15488ac5eb0ad4601c04adc6949516b2ffa909b8 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 16:20:02 -0500 Subject: [PATCH 27/51] Add an `else` println --- settings.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 956a64ad1c..6e19c14d02 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -31,6 +31,8 @@ val localAwsCrtKotlin = file("../aws-crt-kotlin") if (localAwsCrtKotlin.exists()) { println("Including aws-crt-kotlin as a composite build") includeBuild(localAwsCrtKotlin) +} else { + println("Could not find aws-crt-kotlin in a sibling directory, not including it") } rootProject.name = "smithy-kotlin" From 96cfd7de2bb9874fd0a1abb74dbd9542d78f47cd Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 16:29:16 -0500 Subject: [PATCH 28/51] add with path `smithy-kotlin` to all checkouts --- .github/workflows/continuous-integration.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 70c226b262..4a80424465 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -31,6 +31,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + with: + path: 'smithy-kotlin' - name: Setup build uses: ./.github/actions/setup-build - name: Test @@ -47,6 +49,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + with: + path: 'smithy-kotlin' - name: Setup build uses: ./.github/actions/setup-build - name: Test @@ -68,6 +72,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + with: + path: 'smithy-kotlin' - name: Setup build uses: ./.github/actions/setup-build - name: Test From 713222d2767b83420e3e38e2170777de0e88325a Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 16:37:46 -0500 Subject: [PATCH 29/51] Also update setup-build location --- .github/workflows/continuous-integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4a80424465..f72f31f5ea 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -34,7 +34,7 @@ jobs: with: path: 'smithy-kotlin' - name: Setup build - uses: ./.github/actions/setup-build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Test shell: bash run: | @@ -52,7 +52,7 @@ jobs: with: path: 'smithy-kotlin' - name: Setup build - uses: ./.github/actions/setup-build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Test shell: bash run: | @@ -75,7 +75,7 @@ jobs: with: path: 'smithy-kotlin' - name: Setup build - uses: ./.github/actions/setup-build + uses: ./smithy-kotlin/.github/actions/setup-build - name: Test shell: bash run: | From fae778c5439a45227114808b317c72b97c9d8591 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 16:41:53 -0500 Subject: [PATCH 30/51] `working-directory: ./smithy-kotlin` --- .github/workflows/continuous-integration.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f72f31f5ea..d52a305935 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -36,6 +36,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - name: Test + working-directory: ./smithy-kotlin shell: bash run: | ./gradlew -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace @@ -54,6 +55,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - name: Test + working-directory: ./smithy-kotlin shell: bash run: | # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 @@ -77,6 +79,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - name: Test + working-directory: ./smithy-kotlin shell: bash run: | ./gradlew publishToMavenLocal @@ -98,6 +101,7 @@ jobs: path: 'aws-sdk-kotlin' repository: 'awslabs/aws-sdk-kotlin' - name: Build and Test aws-sdk-kotlin downstream + working-directory: ./smithy-kotlin run: | # TODO - JVM only cd $GITHUB_WORKSPACE/smithy-kotlin From cc273a29ecc86367510befd38918d79091285956 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 17:01:18 -0500 Subject: [PATCH 31/51] Disable KMP builds on JVM suite --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d52a305935..bbc345a3db 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -39,7 +39,7 @@ jobs: working-directory: ./smithy-kotlin shell: bash run: | - ./gradlew -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace + ./gradlew -Paws.kotlin.native=false -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace all-platforms: runs-on: ${{ matrix.os }} From 161b57a639b097ba7c63c449d6b2ee54ecda8fb6 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 17:26:35 -0500 Subject: [PATCH 32/51] Fix JVM build --- .../http-client-engine-crt/build.gradle.kts | 6 +++--- .../runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt | 6 ++++-- .../kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/build.gradle.kts b/runtime/protocol/http-client-engines/http-client-engine-crt/build.gradle.kts index d2f411578f..b3a3f5507a 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/build.gradle.kts +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/build.gradle.kts @@ -11,18 +11,18 @@ apply(plugin = "org.jetbrains.kotlinx.atomicfu") kotlin { sourceSets { - jvmMain { + jvmAndNativeMain { dependencies { api(project(":runtime:runtime-core")) api(project(":runtime:protocol:http-client")) implementation(project(":runtime:crt-util")) implementation(project(":runtime:observability:telemetry-api")) - implementation(libs.kotlinx.coroutines.core) + api(libs.crt.kotlin) } } - jvmTest { + jvmAndNativeTest { dependencies { implementation(project(":runtime:testing")) implementation(project(":runtime:protocol:http-test")) diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt index 9bbc35c4cd..005d577f74 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt @@ -21,15 +21,17 @@ import kotlinx.coroutines.yield import kotlin.test.* class SdkStreamResponseHandlerTest { - private class MockHttpStream(override val responseStatusCode: Int) : HttpStream { var closed: Boolean = false override fun activate() {} + override suspend fun writeChunk(chunkData: ByteArray, isFinalChunk: Boolean) { + TODO("Not yet implemented") + } + override fun close() { closed = true } override fun incrementWindow(size: Int) {} - override fun writeChunk(chunkData: ByteArray, isFinalChunk: Boolean) {} } private class MockHttpClientConnection : HttpClientConnection { diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt index a7637b6753..d0e2e2cf94 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt @@ -22,7 +22,7 @@ class SendChunkedBodyTest { closed = true } override fun incrementWindow(size: Int) {} - override fun writeChunk(chunkData: ByteArray, isFinalChunk: Boolean) { + override suspend fun writeChunk(chunkData: ByteArray, isFinalChunk: Boolean) { numChunksWritten += 1 } } From 5d8a1f5b4c450f475749d4835fa2bad8b8210404 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 7 Nov 2024 17:35:56 -0500 Subject: [PATCH 33/51] Fix aws-signing-crt --- runtime/auth/aws-signing-crt/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/auth/aws-signing-crt/build.gradle.kts b/runtime/auth/aws-signing-crt/build.gradle.kts index 4c67282762..5dddb3f45f 100644 --- a/runtime/auth/aws-signing-crt/build.gradle.kts +++ b/runtime/auth/aws-signing-crt/build.gradle.kts @@ -8,14 +8,14 @@ extra["moduleName"] = "aws.smithy.kotlin.runtime.auth.awssigning.crt" kotlin { sourceSets { - jvmMain { + jvmAndNativeMain { dependencies { api(project(":runtime:auth:aws-signing-common")) implementation(project(":runtime:crt-util")) } } - jvmTest { + jvmAndNativeTest { dependencies { implementation(project(":runtime:auth:aws-signing-tests")) } From 42b0453f21e9b428a1444be43eaf2d1608aa5d1b Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 13:51:15 -0500 Subject: [PATCH 34/51] Test macos suite --- .github/actions/setup-build/action.yml | 2 + .../{continuous-integration.yml => ci.yml} | 78 ++++++++++++++++++- 2 files changed, 76 insertions(+), 4 deletions(-) rename .github/workflows/{continuous-integration.yml => ci.yml} (61%) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index b2a233cfae..478e2da958 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -12,12 +12,14 @@ runs: repository: 'awslabs/aws-kotlin-repo-tools' sparse-checkout: | .github + - name: Checkout aws-crt-kotlin uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: # checkout aws-crt-kotlin as a sibling which will automatically make it an included build path: 'aws-crt-kotlin' repository: 'awslabs/aws-crt-kotlin' + - name: Configure JDK uses: actions/setup-java@v3 with: diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/ci.yml similarity index 61% rename from .github/workflows/continuous-integration.yml rename to .github/workflows/ci.yml index bbc345a3db..1356d1e7d9 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ concurrency: env: RUN: ${{ github.run_id }}-${{ github.run_number }} GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false" + # generated dockcross scripts default to `podman` when installed which + # has issues when building with docker then executing via dockcross script which + # picks up `podman` instead. + OCI_EXE: docker jobs: jvm: @@ -41,12 +45,14 @@ jobs: run: | ./gradlew -Paws.kotlin.native=false -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace - all-platforms: - runs-on: ${{ matrix.os }} + # macos-14 build and test for targets: jvm, macoArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64 + # macos-13 build and test for targets: jvm, macoX64, iosX64, tvosX64, watchosX64 + macos: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: [macos-14, macos-13] + runs-on: ${{ matrix.os }} steps: - name: Checkout sources uses: actions/checkout@v4 @@ -61,7 +67,8 @@ jobs: # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck - ./gradlew allTests + ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true build + ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true allTests - name: Save Test Reports if: failure() uses: actions/upload-artifact@v3 @@ -69,6 +76,69 @@ jobs: name: test-reports-${{ matrix.os }} path: '**/build/reports' +# # build and test for targets: jvm, linuxX64 +# # cross compile for: linuxX64, linuxArm64 +# # TODO - add mingw as cross compile target +# linux: +# runs-on: ubuntu-22.04 +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 +# with: +# path: 'smithy-kotlin' +# +# - name: Setup build +# uses: ./smithy-kotlin/.github/actions/setup-build +# +# - name: Configure CRT Docker Images +# run: | +# ./aws-crt-kotlin/docker-images/build-all.sh +# +# - name: Test +# working-directory: ./smithy-kotlin +# shell: bash +# run: | +# # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 +# # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties +# ./gradlew apiCheck +# ./gradlew build +# ./gradlew allTests +# +# - name: Save Test Reports +# if: failure() +# uses: actions/upload-artifact@v3 +# with: +# name: test-reports-${{ matrix.os }} +# path: '**/build/reports' + +# all-platforms: +# runs-on: ${{ matrix.os }} +# strategy: +# fail-fast: false +# matrix: +# os: [ ubuntu-latest, macos-latest, windows-latest ] +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 +# with: +# path: 'smithy-kotlin' +# - name: Setup build +# uses: ./smithy-kotlin/.github/actions/setup-build +# - name: Test +# working-directory: ./smithy-kotlin +# shell: bash +# run: | +# # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 +# # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties +# ./gradlew apiCheck +# ./gradlew allTests +# - name: Save Test Reports +# if: failure() +# uses: actions/upload-artifact@v3 +# with: +# name: test-reports-${{ matrix.os }} +# path: '**/build/reports' + protocol-tests: runs-on: ubuntu-latest steps: From 2e9fe7142fe109ff0fd31d1f1732ceef246e84db Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 15:13:37 -0500 Subject: [PATCH 35/51] Disable KMP for `protocol-tests` and `downstream` --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1356d1e7d9..5922758a81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,8 +152,8 @@ jobs: working-directory: ./smithy-kotlin shell: bash run: | - ./gradlew publishToMavenLocal - ./gradlew testAllProtocols + ./gradlew -Paws.kotlin.native=false publishToMavenLocal + ./gradlew -Paws.kotlin.native=false testAllProtocols downstream: runs-on: ubuntu-latest @@ -175,7 +175,7 @@ jobs: run: | # TODO - JVM only cd $GITHUB_WORKSPACE/smithy-kotlin - ./gradlew --parallel publishToMavenLocal + ./gradlew --parallel -Paws.kotlin.native=false publishToMavenLocal SMITHY_KOTLIN_RUNTIME_VERSION=$(grep sdkVersion= gradle.properties | cut -d = -f 2) SMITHY_KOTLIN_CODEGEN_VERSION=$(grep codegenVersion= gradle.properties | cut -d = -f 2) cd $GITHUB_WORKSPACE/aws-sdk-kotlin @@ -186,6 +186,6 @@ jobs: # smithy-kotlin should be sed -i "s/smithy-kotlin-runtime-version = .*$/smithy-kotlin-runtime-version = \"$SMITHY_KOTLIN_RUNTIME_VERSION\"/" gradle/libs.versions.toml sed -i "s/smithy-kotlin-codegen-version = .*$/smithy-kotlin-codegen-version = \"$SMITHY_KOTLIN_CODEGEN_VERSION\"/" gradle/libs.versions.toml - ./gradlew --parallel publishToMavenLocal - ./gradlew test jvmTest - ./gradlew testAllProtocols \ No newline at end of file + ./gradlew --parallel -Paws.kotlin.native=false publishToMavenLocal + ./gradlew -Paws.kotlin.native=false test jvmTest + ./gradlew -Paws.kotlin.native=false testAllProtocols \ No newline at end of file From 7cd3ed9f090cc870b56b31eb0f518e5adbddf1a7 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 16:48:57 -0500 Subject: [PATCH 36/51] Add linux platform --- .github/workflows/ci.yml | 78 ++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5922758a81..ceb2cc077b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,10 @@ jobs: uses: actions/checkout@v4 with: path: 'smithy-kotlin' + - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build + - name: Test working-directory: ./smithy-kotlin shell: bash @@ -58,8 +60,10 @@ jobs: uses: actions/checkout@v4 with: path: 'smithy-kotlin' + - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build + - name: Test working-directory: ./smithy-kotlin shell: bash @@ -69,6 +73,7 @@ jobs: ./gradlew apiCheck ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true build ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true allTests + - name: Save Test Reports if: failure() uses: actions/upload-artifact@v3 @@ -76,40 +81,40 @@ jobs: name: test-reports-${{ matrix.os }} path: '**/build/reports' -# # build and test for targets: jvm, linuxX64 -# # cross compile for: linuxX64, linuxArm64 -# # TODO - add mingw as cross compile target -# linux: -# runs-on: ubuntu-22.04 -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 -# with: -# path: 'smithy-kotlin' -# -# - name: Setup build -# uses: ./smithy-kotlin/.github/actions/setup-build -# -# - name: Configure CRT Docker Images -# run: | -# ./aws-crt-kotlin/docker-images/build-all.sh -# -# - name: Test -# working-directory: ./smithy-kotlin -# shell: bash -# run: | -# # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 -# # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties -# ./gradlew apiCheck -# ./gradlew build -# ./gradlew allTests -# -# - name: Save Test Reports -# if: failure() -# uses: actions/upload-artifact@v3 -# with: -# name: test-reports-${{ matrix.os }} -# path: '**/build/reports' + # build and test for targets: jvm, linuxX64 + # cross compile for: linuxX64, linuxArm64 + # TODO - add mingw as cross compile target + linux: + runs-on: ubuntu-22.04 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + path: 'smithy-kotlin' + + - name: Setup build + uses: ./smithy-kotlin/.github/actions/setup-build + + - name: Configure CRT Docker Images + run: | + ./aws-crt-kotlin/docker-images/build-all.sh + + - name: Test + working-directory: ./smithy-kotlin + shell: bash + run: | + # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 + # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + ./gradlew apiCheck + ./gradlew build + ./gradlew allTests + + - name: Save Test Reports + if: failure() + uses: actions/upload-artifact@v3 + with: + name: test-reports-${{ matrix.os }} + path: '**/build/reports' # all-platforms: # runs-on: ${{ matrix.os }} @@ -146,8 +151,10 @@ jobs: uses: actions/checkout@v4 with: path: 'smithy-kotlin' + - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build + - name: Test working-directory: ./smithy-kotlin shell: bash @@ -162,14 +169,17 @@ jobs: uses: actions/checkout@v4 with: path: 'smithy-kotlin' + - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build + - name: Checkout aws-sdk-kotlin uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: # smithy-kotlin is checked out as a sibling dir which will automatically make it an included build path: 'aws-sdk-kotlin' repository: 'awslabs/aws-sdk-kotlin' + - name: Build and Test aws-sdk-kotlin downstream working-directory: ./smithy-kotlin run: | From 0fbb759b06c2ec80551565a91641be495129a2d5 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 17:02:54 -0500 Subject: [PATCH 37/51] Add windows platform --- .github/workflows/ci.yml | 59 +++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ceb2cc077b..59109f9e3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - - name: Test + - name: Build and Test ${{ env.PACKAGE_NAME }} on JVM working-directory: ./smithy-kotlin shell: bash run: | @@ -64,7 +64,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - - name: Test + - name: Build and Test ${{ env.PACKAGE_NAME }} on Apple platforms working-directory: ./smithy-kotlin shell: bash run: | @@ -85,7 +85,7 @@ jobs: # cross compile for: linuxX64, linuxArm64 # TODO - add mingw as cross compile target linux: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout sources uses: actions/checkout@v4 @@ -99,7 +99,7 @@ jobs: run: | ./aws-crt-kotlin/docker-images/build-all.sh - - name: Test + - name: Build and Test ${{ env.PACKAGE_NAME }} on Linux with Cross-Compile working-directory: ./smithy-kotlin shell: bash run: | @@ -116,33 +116,30 @@ jobs: name: test-reports-${{ matrix.os }} path: '**/build/reports' -# all-platforms: -# runs-on: ${{ matrix.os }} -# strategy: -# fail-fast: false -# matrix: -# os: [ ubuntu-latest, macos-latest, windows-latest ] -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 -# with: -# path: 'smithy-kotlin' -# - name: Setup build -# uses: ./smithy-kotlin/.github/actions/setup-build -# - name: Test -# working-directory: ./smithy-kotlin -# shell: bash -# run: | -# # FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 -# # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties -# ./gradlew apiCheck -# ./gradlew allTests -# - name: Save Test Reports -# if: failure() -# uses: actions/upload-artifact@v3 -# with: -# name: test-reports-${{ matrix.os }} -# path: '**/build/reports' + # windows JVM + windows: + runs-on: windows-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + path: 'smithy-kotlin' + + - name: Setup build + uses: ./smithy-kotlin/.github/actions/setup-build + + - name: Build and Test ${{ env.PACKAGE_NAME }} on Windows JVM + run: | + ./gradlew apiCheck + ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true build + ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true allTests + + - name: Save Test Reports + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-reports-windows + path: '**/build/reports' protocol-tests: runs-on: ubuntu-latest From 72cf8ad127d400b3bc26a0daeff7bd26972c25cb Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 17:07:57 -0500 Subject: [PATCH 38/51] Remove apiCheck --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59109f9e3c..6a4235ee31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,7 +130,6 @@ jobs: - name: Build and Test ${{ env.PACKAGE_NAME }} on Windows JVM run: | - ./gradlew apiCheck ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true build ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true allTests From f67dda7969aa22ec1680961b03de69a9ca9a2d9e Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 17:11:24 -0500 Subject: [PATCH 39/51] Revert to windows-2022 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a4235ee31..611f6eb44c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,7 +118,7 @@ jobs: # windows JVM windows: - runs-on: windows-latest + runs-on: windows-2022 steps: - name: Checkout sources uses: actions/checkout@v4 @@ -130,6 +130,7 @@ jobs: - name: Build and Test ${{ env.PACKAGE_NAME }} on Windows JVM run: | + ./gradlew apiCheck ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true build ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true allTests From 69d57ee8ec7d189ffa31f135bf825a91a5d151bc Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 17:14:25 -0500 Subject: [PATCH 40/51] working-directory --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 611f6eb44c..c9637d5f85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,6 +129,7 @@ jobs: uses: ./smithy-kotlin/.github/actions/setup-build - name: Build and Test ${{ env.PACKAGE_NAME }} on Windows JVM + working-directory: ./smithy-kotlin run: | ./gradlew apiCheck ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true build From dea452e6191e6f98c085ec8bf8c660b28364728b Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 12 Nov 2024 17:18:23 -0500 Subject: [PATCH 41/51] CI From 628ff9e4c1fb137de0fc2780c8db7eb48a9f9aa1 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 09:19:36 -0500 Subject: [PATCH 42/51] jvmTest -> jvmAndNativeTest --- runtime/auth/http-auth-aws/build.gradle.kts | 2 +- ...ignerTestBaseJvm.kt => AwsHttpSignerTestBaseJvmAndNative.kt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename runtime/auth/http-auth-aws/jvmAndNative/test/{AwsHttpSignerTestBaseJvm.kt => AwsHttpSignerTestBaseJvmAndNative.kt} (100%) diff --git a/runtime/auth/http-auth-aws/build.gradle.kts b/runtime/auth/http-auth-aws/build.gradle.kts index dfcc0c7da3..e6c8236526 100644 --- a/runtime/auth/http-auth-aws/build.gradle.kts +++ b/runtime/auth/http-auth-aws/build.gradle.kts @@ -26,7 +26,7 @@ kotlin { } } - jvmTest { + jvmAndNativeTest { dependencies { implementation(project(":runtime:auth:aws-signing-crt")) } diff --git a/runtime/auth/http-auth-aws/jvmAndNative/test/AwsHttpSignerTestBaseJvm.kt b/runtime/auth/http-auth-aws/jvmAndNative/test/AwsHttpSignerTestBaseJvmAndNative.kt similarity index 100% rename from runtime/auth/http-auth-aws/jvmAndNative/test/AwsHttpSignerTestBaseJvm.kt rename to runtime/auth/http-auth-aws/jvmAndNative/test/AwsHttpSignerTestBaseJvmAndNative.kt From 734c83032275a20e73deb80edd3ff67ddd2404dc Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 10:16:33 -0500 Subject: [PATCH 43/51] Remove OCI_EXE --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9637d5f85..b3c47dfeaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,6 @@ concurrency: env: RUN: ${{ github.run_id }}-${{ github.run_number }} GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false" - # generated dockcross scripts default to `podman` when installed which - # has issues when building with docker then executing via dockcross script which - # picks up `podman` instead. - OCI_EXE: docker jobs: jvm: From 57d0b703d71942ed97c5404d38dc2f6764a8c310 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 10:19:32 -0500 Subject: [PATCH 44/51] Change CI names --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3c47dfeaa..1e70833a84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - - name: Build and Test ${{ env.PACKAGE_NAME }} on JVM + - name: Build and Test on JVM working-directory: ./smithy-kotlin shell: bash run: | @@ -60,7 +60,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - - name: Build and Test ${{ env.PACKAGE_NAME }} on Apple platforms + - name: Build and Test on Apple platforms working-directory: ./smithy-kotlin shell: bash run: | @@ -95,7 +95,7 @@ jobs: run: | ./aws-crt-kotlin/docker-images/build-all.sh - - name: Build and Test ${{ env.PACKAGE_NAME }} on Linux with Cross-Compile + - name: Build and Test on Linux with Cross-Compile working-directory: ./smithy-kotlin shell: bash run: | @@ -124,7 +124,7 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - - name: Build and Test ${{ env.PACKAGE_NAME }} on Windows JVM + - name: Build and Test on Windows JVM working-directory: ./smithy-kotlin run: | ./gradlew apiCheck From dacca681bc70743f70ee5fa02594eaec5b05f99e Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 14:17:17 -0500 Subject: [PATCH 45/51] Remove `allTests` --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e70833a84..45b7b9cacc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,6 @@ jobs: # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true build - ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true allTests - name: Save Test Reports if: failure() @@ -103,7 +102,6 @@ jobs: # echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties ./gradlew apiCheck ./gradlew build - ./gradlew allTests - name: Save Test Reports if: failure() @@ -129,7 +127,6 @@ jobs: run: | ./gradlew apiCheck ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true build - ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true allTests - name: Save Test Reports if: failure() From f8135f65581e9f62b06794e9d010914ed2267fb0 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 14:17:30 -0500 Subject: [PATCH 46/51] Remove quotes on Windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45b7b9cacc..eec8725741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,7 +126,7 @@ jobs: working-directory: ./smithy-kotlin run: | ./gradlew apiCheck - ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true build + ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true build - name: Save Test Reports if: failure() From 9795627b9787c455aec176355517f2457c3d7807 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 15:56:39 -0500 Subject: [PATCH 47/51] Move ktor test suite to `jvmAndNative` --- gradle/libs.versions.toml | 1 + .../test-suite/build.gradle.kts | 1 + .../kotlin/runtime/http/test/util/TestServers.kt | 1 - .../runtime/http/test/suite/Concurrency.kt | 11 ++++++----- .../runtime/http/test/suite/Connections.kt | 0 .../kotlin/runtime/http/test/suite/Downloads.kt | 16 ++++------------ .../kotlin/runtime/http/test/suite/Header.kt | 0 .../kotlin/runtime/http/test/suite/Redirects.kt | 0 .../smithy/kotlin/runtime/http/test/suite/Tls.kt | 0 .../kotlin/runtime/http/test/suite/Uploads.kt | 0 .../smithy/kotlin/runtime/io/GzipTestUtils.kt | 2 +- .../smithy/kotlin/runtime/io/GzipTestUtilsJVM.kt | 2 +- 12 files changed, 14 insertions(+), 20 deletions(-) rename runtime/protocol/http-client-engines/test-suite/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt (77%) rename runtime/protocol/http-client-engines/test-suite/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/test/suite/Connections.kt (100%) rename runtime/protocol/http-client-engines/test-suite/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt (81%) rename runtime/protocol/http-client-engines/test-suite/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/test/suite/Header.kt (100%) rename runtime/protocol/http-client-engines/test-suite/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/test/suite/Redirects.kt (100%) rename runtime/protocol/http-client-engines/test-suite/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/test/suite/Tls.kt (100%) rename runtime/protocol/http-client-engines/test-suite/{jvm => jvmAndNative}/src/aws/smithy/kotlin/runtime/http/test/suite/Uploads.kt (100%) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f7ecd97534..f52b1a56cb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -91,6 +91,7 @@ docker-transport-zerodep = { module = "com.github.docker-java:docker-java-transp ktor-http-cio = { module = "io.ktor:ktor-http-cio", version.ref = "ktor-version" } ktor-utils = { module = "io.ktor:ktor-utils", version.ref = "ktor-version" } ktor-io = { module = "io.ktor:ktor-io", version.ref = "ktor-version" } +ktor-server-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor-version" } ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor-version" } ktor-server-jetty-jakarta = { module = "io.ktor:ktor-server-jetty-jakarta", version.ref = "ktor-version" } ktor-server-cio = { module = "io.ktor:ktor-server-cio", version.ref = "ktor-version" } diff --git a/runtime/protocol/http-client-engines/test-suite/build.gradle.kts b/runtime/protocol/http-client-engines/test-suite/build.gradle.kts index ece9d6e102..065872fe7a 100644 --- a/runtime/protocol/http-client-engines/test-suite/build.gradle.kts +++ b/runtime/protocol/http-client-engines/test-suite/build.gradle.kts @@ -38,6 +38,7 @@ kotlin { jvmAndNativeMain { dependencies { + implementation(libs.ktor.server.core) implementation(libs.kotlinx.coroutines.test) } } diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/TestServers.kt b/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/TestServers.kt index 1bc9d6e9ea..24c001d5b2 100644 --- a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/TestServers.kt +++ b/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/util/TestServers.kt @@ -12,7 +12,6 @@ import aws.smithy.kotlin.runtime.http.test.suite.tlsTests import aws.smithy.kotlin.runtime.http.test.suite.uploadTests import io.ktor.server.application.* import io.ktor.server.engine.* -import io.ktor.server.jetty.* import io.ktor.server.jetty.jakarta.Jetty import io.ktor.server.jetty.jakarta.JettyApplicationEngineBase import redirectTests diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt similarity index 77% rename from runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt rename to runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt index fad3e7fec9..52ad00b14d 100644 --- a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt +++ b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt @@ -1,13 +1,14 @@ /* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ +* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +* SPDX-License-Identifier: Apache-2.0 +*/ package aws.smithy.kotlin.runtime.http.test.suite import io.ktor.server.application.* import io.ktor.server.response.* import io.ktor.server.routing.* +import io.ktor.utils.io.writeFully import kotlinx.coroutines.delay import kotlin.time.Duration.Companion.milliseconds @@ -24,10 +25,10 @@ internal fun Application.concurrentTests() { route("slow") { get { val chunk = ByteArray(256) { it.toByte() } - call.respondOutputStream { + call.respondBytesWriter { repeat(10) { delay(200.milliseconds) - write(chunk) + writeFully(chunk) } } } diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Connections.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Connections.kt similarity index 100% rename from runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Connections.kt rename to runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Connections.kt diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt similarity index 81% rename from runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt rename to runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt index d524f647a3..7cd8ba93e6 100644 --- a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt +++ b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Downloads.kt @@ -6,6 +6,9 @@ package aws.smithy.kotlin.runtime.http.test.suite import aws.smithy.kotlin.runtime.hashing.sha256 +import aws.smithy.kotlin.runtime.io.GzipSdkSource +import aws.smithy.kotlin.runtime.io.readToByteArray +import aws.smithy.kotlin.runtime.io.source import aws.smithy.kotlin.runtime.text.encoding.encodeToHex import io.ktor.http.* import io.ktor.server.application.* @@ -13,8 +16,6 @@ import io.ktor.server.response.* import io.ktor.server.routing.* import io.ktor.utils.io.* import kotlinx.coroutines.delay -import java.io.ByteArrayOutputStream -import java.util.zip.GZIPOutputStream import kotlin.random.Random internal const val DOWNLOAD_SIZE = 16L * 1024 * 1024 // 16MB @@ -53,18 +54,9 @@ internal fun Application.downloadTests() { call.response.header("x-bar", "bar") } - // FIXME This is the only thing keeping this directory in `jvm`, could be `jvmAndNative` get("/gzipped") { val uncompressed = ByteArray(1024) { it.toByte() } - val compressed = ByteArrayOutputStream().use { baStream -> - GZIPOutputStream(baStream).use { gzStream -> - gzStream.write(uncompressed) - gzStream.flush() - } - baStream.flush() - baStream.toByteArray() - } - + val compressed = GzipSdkSource(uncompressed.source()).readToByteArray() call.response.header("Content-Encoding", "gzip") call.respondBytes(compressed) } diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Header.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Header.kt similarity index 100% rename from runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Header.kt rename to runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Header.kt diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Redirects.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Redirects.kt similarity index 100% rename from runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Redirects.kt rename to runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Redirects.kt diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Tls.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Tls.kt similarity index 100% rename from runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Tls.kt rename to runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Tls.kt diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Uploads.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Uploads.kt similarity index 100% rename from runtime/protocol/http-client-engines/test-suite/jvm/src/aws/smithy/kotlin/runtime/http/test/suite/Uploads.kt rename to runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Uploads.kt diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/io/GzipTestUtils.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/io/GzipTestUtils.kt index 109844814e..511fe59f43 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/io/GzipTestUtils.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/io/GzipTestUtils.kt @@ -5,6 +5,6 @@ package aws.smithy.kotlin.runtime.io /** - * Decompresses a byte array compressed using the gzip format + * Decompresses a [ByteArray] compressed using the gzip format */ internal expect fun decompressGzipBytes(bytes: ByteArray): ByteArray diff --git a/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/io/GzipTestUtilsJVM.kt b/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/io/GzipTestUtilsJVM.kt index 1d79af8102..1d879aa925 100644 --- a/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/io/GzipTestUtilsJVM.kt +++ b/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/io/GzipTestUtilsJVM.kt @@ -7,7 +7,7 @@ package aws.smithy.kotlin.runtime.io import java.util.zip.GZIPInputStream /** - * Decompresses a byte array compressed using the gzip format + * Decompresses a [ByteArray] compressed using the gzip format */ internal actual fun decompressGzipBytes(bytes: ByteArray): ByteArray = GZIPInputStream(bytes.inputStream()).use { it.readBytes() } From 779173bd50e2c978332d29bbacbc7a232ac0b6d8 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 15:58:02 -0500 Subject: [PATCH 48/51] Fix erroneous diff --- .../smithy/kotlin/runtime/http/test/suite/Concurrency.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt index 52ad00b14d..b3b482fa20 100644 --- a/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt +++ b/runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/suite/Concurrency.kt @@ -1,7 +1,7 @@ /* -* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -* SPDX-License-Identifier: Apache-2.0 -*/ + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ package aws.smithy.kotlin.runtime.http.test.suite From 6f0dd35925cf963f6806127f84e811bb95c79be7 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 13 Nov 2024 16:28:21 -0500 Subject: [PATCH 49/51] Revert "Remove quotes on Windows" This reverts commit f8135f65581e9f62b06794e9d010914ed2267fb0. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eec8725741..45b7b9cacc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,7 +126,7 @@ jobs: working-directory: ./smithy-kotlin run: | ./gradlew apiCheck - ./gradlew -Paws.sdk.kotlin.crt.disableCrossCompile=true build + ./gradlew -P"aws.sdk.kotlin.crt.disableCrossCompile"=true build - name: Save Test Reports if: failure() From 19fd7159de4667ec949b1ecd073e2339efd91ce4 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 14 Nov 2024 10:44:21 -0500 Subject: [PATCH 50/51] Support local.properties `compositeProjects` --- settings.gradle.kts | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 6e19c14d02..ac7f398bc4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,13 +26,37 @@ dependencyResolutionManagement { } } -// Set up aws-crt-kotlin as a composite build -val localAwsCrtKotlin = file("../aws-crt-kotlin") -if (localAwsCrtKotlin.exists()) { - println("Including aws-crt-kotlin as a composite build") - includeBuild(localAwsCrtKotlin) -} else { - println("Could not find aws-crt-kotlin in a sibling directory, not including it") +// 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 (e: Throwable) { + logger.error("Failed to 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" From fa0b7c061d157d8b8edff67d770a029f88d3c28e Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 14 Nov 2024 10:45:40 -0500 Subject: [PATCH 51/51] Cache K/N toolchain --- .github/actions/setup-build/action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 478e2da958..0a2b5cbb99 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -20,6 +20,17 @@ runs: path: 'aws-crt-kotlin' repository: 'awslabs/aws-crt-kotlin' + # Cache the Kotlin/Native toolchain based on the input Kotlin version from version catalog + # see https://kotlinlang.org/docs/native-improving-compilation-time.html + - name: Cache Kotlin Native toolchain + uses: actions/cache@v4 + with: + path: | + ~/.konan + key: ${{ runner.os }}-konan-${{ hashFiles('gradle/libs.versions.toml') }} + restore-keys: | + ${{ runner.os }}-konan- + - name: Configure JDK uses: actions/setup-java@v3 with: