Skip to content

Commit ae50a0a

Browse files
ianbotsflauzadisaws-sdk-kotlin-ci
authored
feat: initial release of Developer Preview of DynamoDB Mapper for Kotlin (#1451)
* initial poc commit of DynamoDB Mapper (#1232) * add support for Mapper initialization (#1237) * implement mapper pipeline (#1266) * initial implementation of codegen for low-level operations/types (#1357) * initial implementation of secondary index support (#1375) * Create new codegen module and refactor annotation processor to use it (#1382) * feat: add Schema generator Gradle plugin (#1385) * Fix plugin test package * add attribute converters for "standard" values (#1381) * fix: schema generator plugin test module (#1394) * feat: annotation processor codegen configuration (#1392) * feat: add `@DynamoDbIgnore` annotation (#1402) * DDB Mapper filter expressions (runtime components) (#1401) * feat: basic annotation processing (#1399) * add DSL overloads, paginators, and better builder integration for DDB Mapper ops codegen (#1409) * chore: split dynamodb-mapper-codegen into two modules (#1414) * emit DDB_MAPPER business metric (#1426) * feat: setup DynamoDbMapper publication (#1419) * DDB Mapper filter expressions (codegen components) (#1424) * correct docs * mark every HLL/DDBM API experimental (#1428) * fix accidental inclusion of expression attribute members in high-level DynamoDB Mapper requests (#1432) * Upgrade to latest build plugin version * fix: various issues found during testing (#1450) * chore: update Athena changelog notes for 1.3.57 (2024-10-18) release (#1449) * feat: update AWS API models * feat: update AWS service endpoints metadata * chore: release 1.3.60 * chore: bump snapshot version to 1.3.61-SNAPSHOT * feat: initial release of Developer Preview of DynamoDB Mapper for Kotlin * Fix Kotlin gradle-plugin version * fix: ddb mapper tests (#1453) * Bump build plugin version --------- Co-authored-by: Matas <lauzmata@amazon.com> Co-authored-by: aws-sdk-kotlin-ci <aws-kotlin-sdk-automation@amazon.com>
1 parent b162b8d commit ae50a0a

File tree

217 files changed

+17822
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+17822
-6
lines changed

.brazil.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"dependencies": {
3+
"org.jetbrains.kotlin:kotlin-gradle-plugin:2.*": "KotlinGradlePlugin-2.x",
34
"org.jetbrains.kotlin:kotlin-stdlib-common:2.*.*": "KotlinStdlibCommon-2.x",
45
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.*.*": "KotlinStdlibJdk8-2.x",
56
"org.jetbrains.kotlin:kotlin-stdlib:2.*.*": "KotlinStdlib-2.x",
67
"org.jetbrains.kotlinx:atomicfu:0.*.*": "Atomicfu-0.x",
78
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": "KotlinxCoroutinesCoreJvm-1.x",
8-
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.*": "KotlinxCoroutinesJdk8-1.x"
9+
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.*": "KotlinxCoroutinesJdk8-1.x",
10+
"com.google.devtools.ksp:symbol-processing-api:2.*": "Maven-com-google-devtools-ksp_symbol-processing-api-2.x",
11+
"com.google.devtools.ksp:symbol-processing-gradle-plugin:2.*": "Maven-com-google-devtools-ksp_symbol-processing-gradle-plugin-2.x"
912
},
1013
"packageHandlingRules": {
1114
"versioning": {
1215
"defaultVersionLayout": "{MAJOR}.0.x"
1316
},
1417
"ignore": [
1518
"aws.sdk.kotlin:bom",
16-
"aws.sdk.kotlin.crt:aws-crt-kotlin-android",
1719
"aws.sdk.kotlin:testing",
1820
"aws.sdk.kotlin:version-catalog"
1921
],
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": "e4f3b5cb-9cdc-4bc7-b12d-e0a17b635f23",
3+
"type": "feature",
4+
"description": "Initial release of Developer Preview of **DynamoDB Mapper** for Kotlin",
5+
"issues": [
6+
"awslabs/aws-sdk-kotlin#472"
7+
],
8+
"module": "dynamodb-mapper"
9+
}

aws-runtime/aws-http/api/aws-http.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/AddUserAgentMetadata
141141
}
142142

143143
public final class aws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric : java/lang/Enum, aws/smithy/kotlin/runtime/businessmetrics/BusinessMetric {
144+
public static final field DDB_MAPPER Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
144145
public static final field S3_EXPRESS_BUCKET Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
145146
public static fun getEntries ()Lkotlin/enums/EnumEntries;
146147
public fun getIdentifier ()Ljava/lang/String;

aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/BusinessMetricsInterceptor.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ private fun formatMetrics(metrics: MutableSet<String>): String {
6464
@InternalApi
6565
public enum class AwsBusinessMetric(public override val identifier: String) : BusinessMetric {
6666
S3_EXPRESS_BUCKET("J"),
67+
DDB_MAPPER("d"),
6768
}

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ configureNexus()
145145
val lintPaths = listOf(
146146
"**/*.{kt,kts}",
147147
"!**/generated-src/**",
148+
"!**/generated/ksp/**",
149+
"!**/kspCaches/**",
148150
"!**/smithyprojections/**",
149151
)
150152

gradle.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@ smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$s
1414
# atomicfu
1515
kotlinx.atomicfu.enableJvmIrTransformation=true
1616
# FIXME - https://github.com/Kotlin/kotlinx-atomicfu/issues/274
17-
kotlinx.atomicfu.enableNativeIrTransformation=false
17+
kotlinx.atomicfu.enableNativeIrTransformation=false
18+
19+
# https://github.com/google/ksp/blob/main/docs/ksp2.md
20+
# Disable KSP2 due to a bug around subsequent invocations
21+
# https://github.com/google/dagger/issues/4181 / https://github.com/google/ksp/issues/1678
22+
ksp.useKSP2=false

gradle/libs.versions.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[versions]
22
kotlin-version = "2.0.21"
3+
ksp-version = "2.0.21-1.0.25" # Keep in sync with kotlin-version
4+
35
dokka-version = "1.9.10"
46

5-
aws-kotlin-repo-tools-version = "0.4.13"
7+
aws-kotlin-repo-tools-version = "0.4.14"
68

79
# libs
810
coroutines-version = "1.9.0"
@@ -16,6 +18,7 @@ smithy-kotlin-codegen-version = "0.33.17"
1618
smithy-version = "1.51.0"
1719

1820
# testing
21+
ddb-local-version = "2.5.2"
1922
junit-version = "5.10.5"
2023
kotest-version = "5.9.1"
2124
kotlinx-benchmark-version = "0.4.12"
@@ -26,8 +29,8 @@ slf4j-version = "2.0.16"
2629
[libraries]
2730
aws-kotlin-repo-tools-build-support = { module="aws.sdk.kotlin.gradle:build-support", version.ref = "aws-kotlin-repo-tools-version" }
2831

29-
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-version"}
30-
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin-version"}
32+
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-version" }
33+
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin-version" }
3134
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-version" }
3235
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin-version" }
3336
dokka-core = { module = "org.jetbrains.dokka:dokka-core", version.ref = "dokka-version" }
@@ -42,6 +45,9 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
4245
kotlinx-coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines-version" }
4346
kotlinx-coroutines-slf4j = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version.ref = "coroutines-version" }
4447

48+
ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp-version" }
49+
ksp-gradle-plugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp-version" }
50+
4551
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j-version" }
4652
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j-version" }
4753

@@ -107,6 +113,8 @@ kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-
107113
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-version" }
108114
mockk = { module = "io.mockk:mockk", version.ref = "mockk-version" }
109115

116+
ddb-local = { module = "com.amazonaws:DynamoDBLocal", version.ref = "ddb-local-version" }
117+
110118
[bundles]
111119
# bundle of smithy-kotlin dependencies all AWS service clients have
112120
smithy-kotlin-service-client = [
@@ -134,6 +142,8 @@ kotlin-multiplatform = {id = "org.jetbrains.kotlin.multiplatform", version.ref =
134142
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark-version" }
135143
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" }
136144
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-version"}
145+
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-version" }
137146
aws-kotlin-repo-tools-kmp = { id = "aws.sdk.kotlin.gradle.kmp", version.ref = "aws-kotlin-repo-tools-version" }
138147
aws-kotlin-repo-tools-smithybuild = { id = "aws.sdk.kotlin.gradle.smithybuild", version.ref = "aws-kotlin-repo-tools-version" }
139148
aws-kotlin-repo-tools-artifactsizemetrics = { id = "aws.sdk.kotlin.gradle.artifactsizemetrics", version.ref = "aws-kotlin-repo-tools-version" }
149+
gradle-plugin-publish = { id = "com.gradle.plugin-publish", version = "1.2.1"}

hll/build.gradle.kts

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
import aws.sdk.kotlin.gradle.dsl.configurePublishing
7+
import aws.sdk.kotlin.gradle.kmp.*
8+
import aws.smithy.kotlin.runtime.InternalApi
9+
import aws.smithy.kotlin.runtime.text.ensureSuffix
10+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
11+
12+
description = "High-level libraries for the AWS SDK for Kotlin"
13+
extra["displayName"] = "AWS :: SDK :: Kotlin :: HLL"
14+
extra["moduleName"] = "aws.sdk.kotlin.hll"
15+
16+
// FIXME 🔽🔽🔽 This is all copied from :aws-runtime and should be commonized 🔽🔽🔽
17+
18+
plugins {
19+
alias(libs.plugins.dokka)
20+
alias(libs.plugins.kotlinx.binary.compatibility.validator)
21+
alias(libs.plugins.aws.kotlin.repo.tools.kmp) apply false
22+
jacoco
23+
}
24+
25+
val sdkVersion: String by project
26+
27+
// capture locally - scope issue with custom KMP plugin
28+
val libraries = libs
29+
30+
val optinAnnotations = listOf(
31+
"aws.smithy.kotlin.runtime.ExperimentalApi",
32+
"aws.smithy.kotlin.runtime.InternalApi",
33+
"aws.sdk.kotlin.runtime.InternalSdkApi",
34+
"kotlin.RequiresOptIn",
35+
)
36+
37+
@OptIn(InternalApi::class)
38+
val hllPreviewVersion = if (sdkVersion.contains("-SNAPSHOT")) { // e.g. 1.3.29-beta-SNAPSHOT
39+
sdkVersion
40+
.removeSuffix("-SNAPSHOT")
41+
.ensureSuffix("-beta-SNAPSHOT")
42+
} else {
43+
sdkVersion.ensureSuffix("-beta") // e.g. 1.3.29-beta
44+
}
45+
46+
subprojects {
47+
group = "aws.sdk.kotlin"
48+
version = hllPreviewVersion
49+
configurePublishing("aws-sdk-kotlin")
50+
}
51+
52+
subprojects {
53+
if (!needsKmpConfigured) {
54+
return@subprojects
55+
}
56+
57+
apply {
58+
plugin("org.jetbrains.kotlin.multiplatform")
59+
plugin("org.jetbrains.dokka")
60+
plugin(libraries.plugins.aws.kotlin.repo.tools.kmp.get().pluginId)
61+
}
62+
63+
kotlin {
64+
explicitApi()
65+
66+
sourceSets {
67+
// dependencies available for all subprojects
68+
69+
all {
70+
optinAnnotations.forEach(languageSettings::optIn)
71+
}
72+
73+
named("commonTest") {
74+
dependencies {
75+
implementation(libraries.kotest.assertions.core)
76+
}
77+
}
78+
79+
named("jvmTest") {
80+
dependencies {
81+
implementation(libraries.kotest.assertions.core.jvm)
82+
implementation(libraries.slf4j.simple)
83+
}
84+
}
85+
}
86+
}
87+
88+
dependencies {
89+
dokkaPlugin(project(":dokka-aws"))
90+
}
91+
92+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
93+
compilerOptions {
94+
jvmTarget.set(JvmTarget.JVM_1_8)
95+
freeCompilerArgs.add("-Xexpect-actual-classes")
96+
}
97+
}
98+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile> {
99+
compilerOptions {
100+
freeCompilerArgs.add("-Xexpect-actual-classes")
101+
}
102+
}
103+
}
104+
105+
apiValidation {
106+
val availableSubprojects = subprojects.map { it.name }.toSet()
107+
108+
ignoredProjects += listOf(
109+
"hll-codegen",
110+
"dynamodb-mapper-codegen",
111+
"dynamodb-mapper-ops-codegen",
112+
"dynamodb-mapper-schema-codegen",
113+
"dynamodb-mapper-schema-generator-plugin-test",
114+
).filter { it in availableSubprojects } // Some projects may not be in the build depending on bootstrapping
115+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbAttribute : java/lang/annotation/Annotation {
2+
public abstract fun name ()Ljava/lang/String;
3+
}
4+
5+
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbIgnore : java/lang/annotation/Annotation {
6+
}
7+
8+
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbItem : java/lang/annotation/Annotation {
9+
public abstract fun converterName ()Ljava/lang/String;
10+
}
11+
12+
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbPartitionKey : java/lang/annotation/Annotation {
13+
}
14+
15+
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbSortKey : java/lang/annotation/Annotation {
16+
}
17+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
description = "DynamoDbMapper annotations"
7+
extra["displayName"] = "AWS :: SDK :: Kotlin :: HLL :: DynamoDbMapper :: Annotations"
8+
extra["moduleName"] = "aws.sdk.kotlin.hll.dynamodbmapper.annotations"

0 commit comments

Comments
 (0)