Skip to content

Commit 2f5c59d

Browse files
committed
1st pass
1 parent 66c2ca2 commit 2f5c59d

File tree

8 files changed

+8
-28
lines changed

8 files changed

+8
-28
lines changed

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ kotlinx.atomicfu.enableJvmIrTransformation=true
1616
# FIXME - https://github.com/Kotlin/kotlinx-atomicfu/issues/274
1717
kotlinx.atomicfu.enableNativeIrTransformation=false
1818

19+
# https://github.com/google/ksp/blob/main/docs/ksp2.md
1920
ksp.useKSP2=true

hll/dynamodb-mapper/dynamodb-mapper-annotations/api/dynamodb-mapper-annotations.api

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/Dyn
66
}
77

88
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbItem : java/lang/annotation/Annotation {
9-
public abstract fun converter ()Ljava/lang/Class;
9+
public abstract fun converterName ()Ljava/lang/String;
1010
}
1111

1212
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbPartitionKey : java/lang/annotation/Annotation {
@@ -15,14 +15,3 @@ public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/Dyn
1515
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbSortKey : java/lang/annotation/Annotation {
1616
}
1717

18-
public final class aws/sdk/kotlin/hll/dynamodbmapper/UnspecifiedItemConverter : aws/sdk/kotlin/hll/dynamodbmapper/items/ItemConverter {
19-
public static final field INSTANCE Laws/sdk/kotlin/hll/dynamodbmapper/UnspecifiedItemConverter;
20-
public fun convertFrom (Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;)Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;
21-
public synthetic fun convertFrom (Ljava/lang/Object;)Ljava/lang/Object;
22-
public fun convertTo (Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;)Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;
23-
public fun convertTo (Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;Ljava/util/Set;)Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;
24-
public synthetic fun convertTo (Ljava/lang/Object;)Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;
25-
public synthetic fun convertTo (Ljava/lang/Object;)Ljava/lang/Object;
26-
public synthetic fun convertTo (Ljava/lang/Object;Ljava/util/Set;)Laws/sdk/kotlin/hll/dynamodbmapper/model/Item;
27-
}
28-

hll/dynamodb-mapper/dynamodb-mapper-annotations/common/src/aws/sdk/kotlin/hll/dynamodbmapper/Annotations.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
*/
55
package aws.sdk.kotlin.hll.dynamodbmapper
66

7-
import aws.sdk.kotlin.hll.dynamodbmapper.items.ItemConverter
8-
import aws.sdk.kotlin.hll.dynamodbmapper.model.Item
9-
import aws.sdk.kotlin.runtime.InternalSdkApi
10-
import kotlin.reflect.KClass
11-
127
/**
138
* Specifies the attribute name for a property in a [DynamoDbItem]-annotated class/interface. If this annotation is not
149
* included then the attribute name matches the property name.

hll/dynamodb-mapper/dynamodb-mapper-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/model/MapperTypes.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import aws.sdk.kotlin.hll.codegen.model.Type
44
import aws.sdk.kotlin.hll.codegen.model.TypeRef
55
import aws.sdk.kotlin.hll.codegen.model.TypeVar
66
import aws.sdk.kotlin.hll.codegen.model.Types
7+
import aws.sdk.kotlin.runtime.InternalSdkApi
78

89
/**
910
* A container object for various DynamoDbMapper [Type] instances
1011
*/
12+
@InternalSdkApi
1113
public object MapperTypes {
1214
// Low-level types
1315
public val AttributeValue: TypeRef = TypeRef(MapperPkg.Ll.Model, "AttributeValue")

hll/dynamodb-mapper/dynamodb-mapper-schema-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/annotations/rendering/SchemaRenderer.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ internal class SchemaRenderer(
3838
@OptIn(KspExperimental::class)
3939
private val dynamoDbItemAnnotation = classDeclaration.getAnnotationsByType(DynamoDbItem::class).single()
4040

41-
init {
42-
val anno = classDeclaration.getAnnotationsByType(DynamoDbItem::class).single()
43-
ctx.logger.warn("It has a converter ${anno.converter}")
44-
ctx.logger.warn("It has a Java class ${anno.javaClass}")
45-
}
46-
4741
private val itemConverter: Type = dynamoDbItemAnnotation
4842
.converterName
4943
.takeIf { it.isNotBlank() }
@@ -300,7 +294,7 @@ internal class SchemaRenderer(
300294
else -> error("Unsupported key type $typeName, expected ByteArray, Int, or String")
301295
}
302296

303-
private val KSPropertyDeclaration.keySpecType: Type
297+
private val KSPropertyDeclaration.keySpecType: TypeRef
304298
get() = when (typeName) {
305299
"kotlin.ByteArray" -> MapperTypes.Items.KeySpecByteArray
306300
"kotlin.Int" -> MapperTypes.Items.KeySpecNumber

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/test/resources/custom-item-converter/CustomUser.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ package org.example
22

33
import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbItem
44
import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbPartitionKey
5-
import my.custom.item.converter.MyCustomUserConverter
65

7-
@DynamoDbItem(converter = MyCustomUserConverter::class)
6+
@DynamoDbItem("my.custom.item.converter.MyCustomUserConverter")
87
public data class CustomUser(
98
@DynamoDbPartitionKey var id: Int = 1,
109
var givenName: String = "Johnny",

hll/dynamodb-mapper/tests/dynamodb-mapper-annotation-processor-test/common/test/aws/sdk/kotlin/hll/dynamodbmapper/tests/processor/data/UserTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package aws.sdk.kotlin.hll.dynamodbmapper.tests.processor.data
66

77
import aws.sdk.kotlin.hll.dynamodbmapper.model.itemOf
8-
import aws.sdk.kotlin.hll.dynamodbmapper.tests.processor.data.dynamodbmapper.generatedschemas.UserConverter
8+
import aws.sdk.kotlin.hll.dynamodbmapper.tests.processor.data.aws.sdk.kotlin.hll.dynamodbmapper.generatedschemas.UserConverter
99
import aws.sdk.kotlin.services.dynamodb.model.AttributeValue
1010
import kotlin.test.Test
1111
import kotlin.test.assertEquals

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if ("dynamodb".isBootstrappedService) {
7575
include(":hll:dynamodb-mapper:dynamodb-mapper-ops-codegen")
7676
include(":hll:dynamodb-mapper:dynamodb-mapper-schema-codegen")
7777
include(":hll:dynamodb-mapper:dynamodb-mapper-annotations")
78-
// include(":hll:dynamodb-mapper:tests:dynamodb-mapper-annotation-processor-test")
78+
include(":hll:dynamodb-mapper:tests:dynamodb-mapper-annotation-processor-test")
7979
include(":hll:dynamodb-mapper:dynamodb-mapper-schema-generator-plugin")
8080
include(":hll:dynamodb-mapper:tests:dynamodb-mapper-schema-generator-plugin-test")
8181
} else {

0 commit comments

Comments
 (0)