diff --git a/gradle.properties b/gradle.properties index 6df49d64b56..8da73b5875a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,4 +17,6 @@ kotlinx.atomicfu.enableJvmIrTransformation=true kotlinx.atomicfu.enableNativeIrTransformation=false # https://github.com/google/ksp/blob/main/docs/ksp2.md -ksp.useKSP2=true +# Disable KSP2 due to a bug around subsequent invocations +# https://github.com/google/dagger/issues/4181 / https://github.com/google/ksp/issues/1678 +ksp.useKSP2=false diff --git a/hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts b/hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts index 45b2496b5f4..df60c718184 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts +++ b/hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts @@ -40,14 +40,14 @@ kotlin { commonTest { dependencies { implementation(libs.kotlinx.coroutines.test) - implementation(libs.kotest.assertions.core) - implementation(libs.kotest.runner.junit5) } } jvmTest { dependencies { implementation(libs.mockk) + implementation(libs.kotest.assertions.core) + implementation(libs.kotest.runner.junit5) } } } @@ -67,8 +67,9 @@ ksp { } if (project.NATIVE_ENABLED) { - // Configure KSP for commonMain source generation; https://github.com/google/ksp/issues/963#issuecomment-1894144639 - + // Configure KSP for multiplatform: https://kotlinlang.org/docs/ksp-multiplatform.html + // https://github.com/google/ksp/issues/963#issuecomment-1894144639 + // https://github.com/google/ksp/issues/965 dependencies.kspCommonMainMetadata(project(":hll:dynamodb-mapper:dynamodb-mapper-ops-codegen")) kotlin.sourceSets.commonMain { diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/Filter.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/Filter.kt index 98c966b0199..6889ee93cdb 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/Filter.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/Filter.kt @@ -6,6 +6,7 @@ package aws.sdk.kotlin.hll.dynamodbmapper.expressions import aws.sdk.kotlin.hll.dynamodbmapper.util.dynamicAttr import aws.smithy.kotlin.runtime.ExperimentalApi +import kotlin.jvm.JvmName /** * A DSL interface providing support for "low-level" filter expressions. Implementations of this interface provide diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/LiteralExpr.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/LiteralExpr.kt index 62ceda9e122..13caf15dc15 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/LiteralExpr.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/LiteralExpr.kt @@ -8,6 +8,7 @@ import aws.sdk.kotlin.hll.dynamodbmapper.expressions.internal.LiteralExprImpl import aws.sdk.kotlin.hll.dynamodbmapper.util.attr import aws.sdk.kotlin.services.dynamodb.model.AttributeValue import aws.smithy.kotlin.runtime.ExperimentalApi +import kotlin.jvm.JvmName /** * Represents an expression that consists of a single literal value diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/SortKeyFilter.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/SortKeyFilter.kt index 5e8b2b2a01d..0dd7fa804f3 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/SortKeyFilter.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/expressions/SortKeyFilter.kt @@ -5,6 +5,7 @@ package aws.sdk.kotlin.hll.dynamodbmapper.expressions import aws.smithy.kotlin.runtime.ExperimentalApi +import kotlin.jvm.JvmName /** * Represents a sort key independent of schema diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/internal/DynamoDbMapperImpl.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/internal/DynamoDbMapperImpl.kt index fec5954e804..8276aeb0f1b 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/internal/DynamoDbMapperImpl.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/internal/DynamoDbMapperImpl.kt @@ -14,6 +14,7 @@ import aws.sdk.kotlin.services.dynamodb.withConfig import aws.smithy.kotlin.runtime.businessmetrics.emitBusinessMetric import aws.smithy.kotlin.runtime.client.RequestInterceptorContext import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor +import aws.smithy.kotlin.runtime.io.use internal data class DynamoDbMapperImpl( override val client: DynamoDbClient, diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/model/Item.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/model/Item.kt index 0c2d4c97718..3341b58ada1 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/model/Item.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/model/Item.kt @@ -8,6 +8,7 @@ import aws.sdk.kotlin.hll.dynamodbmapper.model.internal.ItemImpl import aws.sdk.kotlin.hll.dynamodbmapper.util.dynamicAttr import aws.sdk.kotlin.services.dynamodb.model.AttributeValue import aws.smithy.kotlin.runtime.ExperimentalApi +import kotlin.jvm.JvmName /** * An immutable representation of a low-level item in a DynamoDB table. Items consist of attributes, each of which have diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/util/AttributeValues.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/util/AttributeValues.kt index 597f2636aa7..d46dd9158b4 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/util/AttributeValues.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/util/AttributeValues.kt @@ -5,6 +5,7 @@ package aws.sdk.kotlin.hll.dynamodbmapper.util import aws.sdk.kotlin.services.dynamodb.model.AttributeValue +import kotlin.jvm.JvmName internal val NULL_ATTR = AttributeValue.Null(true) diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/TextConverters.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/TextConverters.kt index 0baea144585..df119cf0433 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/TextConverters.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/TextConverters.kt @@ -18,7 +18,7 @@ public object TextConverters { /** * Converts between [CharArray] and [String] */ - public val CharArrayToStringConverter: Converter = Converter(::String, String::toCharArray) + public val CharArrayToStringConverter: Converter = Converter(CharArray::concatToString, String::toCharArray) /** * Converts between [Char] and [String] diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/expressions/KeyFilterTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/expressions/KeyFilterTest.kt index 09b4f1387b4..a3ee5160946 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/expressions/KeyFilterTest.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/expressions/KeyFilterTest.kt @@ -10,9 +10,9 @@ import aws.sdk.kotlin.hll.dynamodbmapper.items.ItemConverter import aws.sdk.kotlin.hll.dynamodbmapper.items.ItemSchema import aws.sdk.kotlin.hll.dynamodbmapper.items.KeySpec import aws.sdk.kotlin.hll.dynamodbmapper.model.Item -import org.junit.jupiter.api.assertThrows import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertFailsWith class KeyFilterTest { private val singleKeySchema = ItemSchema(DummyConverter, KeySpec.String("primary")) @@ -31,7 +31,7 @@ class KeyFilterTest { fun testSingleKeySchemaWithErroneousSortKey() { val kf = KeyFilter("foo") { sortKey eq 2 } - assertThrows { + assertFailsWith { kf.toExpression(singleKeySchema) } } diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConvertersTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConvertersTest.kt index 87b91e87554..2077b365a7f 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConvertersTest.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConvertersTest.kt @@ -7,6 +7,7 @@ package aws.sdk.kotlin.hll.dynamodbmapper.values import aws.sdk.kotlin.hll.dynamodbmapper.util.attr import aws.sdk.kotlin.hll.dynamodbmapper.util.dynamicAttr import aws.sdk.kotlin.services.dynamodb.model.AttributeValue +import kotlin.jvm.JvmName import kotlin.test.assertContentEquals import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/ScalarConvertersTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/ScalarConvertersTest.kt index 286f098af00..18a2ecb9053 100644 --- a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/ScalarConvertersTest.kt +++ b/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/ScalarConvertersTest.kt @@ -18,7 +18,7 @@ class ScalarConvertersTest : ValueConvertersTest() { @Test fun testByteArrayConverter() = given(ByteArrayConverter) { byteArrayOf() inDdbIs theSame - "Foo".toByteArray() inDdbIs theSame + "Foo".encodeToByteArray() inDdbIs theSame ByteArray(1024) { it.toByte() } inDdbIs theSame } diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbMapperTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbMapperTest.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbMapperTest.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbMapperTest.kt diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/DeleteItemTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/DeleteItemTest.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/DeleteItemTest.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/DeleteItemTest.kt diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/GetItemTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/GetItemTest.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/GetItemTest.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/GetItemTest.kt diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/PutItemTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/PutItemTest.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/PutItemTest.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/PutItemTest.kt diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/QueryTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/QueryTest.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/QueryTest.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/QueryTest.kt diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/ScanTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/ScanTest.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/ScanTest.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/operations/ScanTest.kt diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbClientExtensions.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbClientExtensions.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbClientExtensions.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbClientExtensions.kt diff --git a/hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbLocalTest.kt b/hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbLocalTest.kt similarity index 100% rename from hll/dynamodb-mapper/dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbLocalTest.kt rename to hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbLocalTest.kt