-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: setup DynamoDbMapper publication #1419
Changes from 13 commits
b5582b8
ea26cf9
5a55ba7
23178a8
74e1d12
7be214b
307443d
cae3faa
dffb9b4
a6cc242
7f8c9b6
eacd39d
fdf75ed
b75dbb9
aa38515
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
|
||
import aws.sdk.kotlin.gradle.dsl.configurePublishing | ||
import aws.sdk.kotlin.gradle.kmp.* | ||
import aws.smithy.kotlin.runtime.InternalApi | ||
import aws.smithy.kotlin.runtime.text.ensureSuffix | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
description = "High-level libraries for the AWS SDK for Kotlin" | ||
|
@@ -31,22 +33,32 @@ val optinAnnotations = listOf( | |
"kotlin.RequiresOptIn", | ||
) | ||
|
||
@OptIn(InternalApi::class) | ||
fun getHllPreviewVersion() = if (sdkVersion.contains("-SNAPSHOT")) { // i.e. 1.3.29-beta-SNAPSHOT | ||
sdkVersion | ||
.removeSuffix("-SNAPSHOT") | ||
.ensureSuffix("-beta-SNAPSHOT") | ||
} else { | ||
sdkVersion.ensureSuffix("-beta") // i.e. 1.3.29-beta | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Any reason not to make this a |
||
|
||
subprojects { | ||
group = "aws.sdk.kotlin" | ||
version = getHllPreviewVersion() | ||
configurePublishing("aws-sdk-kotlin") | ||
} | ||
|
||
subprojects { | ||
if (!needsKmpConfigured) { | ||
return@subprojects | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Why was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All subprojects should have those values configured, they are not KMP-specific which is what the pre-existing block is for |
||
|
||
group = "aws.sdk.kotlin" | ||
version = sdkVersion | ||
|
||
apply { | ||
plugin("org.jetbrains.kotlin.multiplatform") | ||
plugin("org.jetbrains.dokka") | ||
plugin(libraries.plugins.aws.kotlin.repo.tools.kmp.get().pluginId) | ||
} | ||
|
||
configurePublishing("aws-sdk-kotlin") | ||
|
||
kotlin { | ||
explicitApi() | ||
|
||
|
@@ -94,7 +106,6 @@ apiValidation { | |
|
||
ignoredProjects += listOf( | ||
"hll-codegen", | ||
"dynamodb-mapper-annotation-processor-test", | ||
"dynamodb-mapper-codegen", | ||
"dynamodb-mapper-ops-codegen", | ||
"dynamodb-mapper-schema-codegen", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import aws.smithy.kotlin.runtime.InternalApi | ||
import aws.smithy.kotlin.runtime.text.ensureSuffix | ||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: How are these imports resolvable by the build script? Do we have the SDK/Smithy runtime in the classpath at this point? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why it works like this, but we do have a dependency on smithy-kotlin:runtime-core in this module, and the imports to resolve |
||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
/* | ||
|
@@ -45,10 +47,6 @@ gradlePlugin { | |
} | ||
} | ||
|
||
val sdkVersion: String by project | ||
group = "aws.sdk.kotlin" | ||
version = sdkVersion | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("dynamodb-mapper-schema-generator-plugin") { | ||
|
@@ -57,6 +55,27 @@ publishing { | |
} | ||
} | ||
|
||
/** | ||
* The `java-gradle-plugin` plugin creates a javadoc jar by default, conflicting with the empty javadoc jar (emptyJar) | ||
* created in aws-kotlin-repo-tools. Configure dependencies and disable the emptyJar task to avoid conflicts. | ||
*/ | ||
afterEvaluate { | ||
tasks.withType<PublishToMavenRepository> { | ||
dependsOn(tasks.named("javadocJar")) | ||
} | ||
|
||
tasks.named("publishDynamodb-mapper-schema-generatorPluginMarkerMavenPublicationToMavenLocal") { | ||
dependsOn(tasks.named("javadocJar")) | ||
} | ||
|
||
tasks.findByName("signDynamodb-mapper-schema-generatorPluginMarkerMavenPublication") | ||
?.dependsOn(tasks.named("javadocJar")) | ||
Comment on lines
+63
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Refactor |
||
|
||
tasks.named("emptyJar") { | ||
enabled = false | ||
} | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
testLogging { | ||
|
@@ -69,6 +88,17 @@ tasks.test { | |
} | ||
|
||
// FIXME Commonize the following functions into the aws-kotlin-repo-tools build-support | ||
val sdkVersion: String by project | ||
|
||
@OptIn(InternalApi::class) | ||
fun getHllPreviewVersion() = if (sdkVersion.contains("-SNAPSHOT")) { // i.e. 1.3.29-beta-SNAPSHOT | ||
sdkVersion | ||
.removeSuffix("-SNAPSHOT") | ||
.ensureSuffix("-beta-SNAPSHOT") | ||
} else { | ||
sdkVersion.ensureSuffix("-beta") // i.e. 1.3.29-beta | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: When commonizing this function I'm assuming we'll also commonize the other declaration of Nit: If so can we add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally I don't think this function will last long enough, it should be removed once we GA the DynamoDbMapper |
||
/** | ||
* Create a file containing the sdkVersion to use as a resource | ||
* This saves us from having to manually change version numbers in multiple places | ||
|
@@ -81,7 +111,7 @@ val generateSdkVersionFile by tasks.registering { | |
outputs.file(versionFile) | ||
sourceSets.main.get().output.dir(resourcesDir) | ||
doLast { | ||
versionFile.writeText(sdkVersion) | ||
versionFile.writeText(getHllPreviewVersion()) | ||
} | ||
} | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,10 +37,6 @@ dependencies { | |
testImplementation(libs.kotlin.test.junit5) | ||
} | ||
|
||
val sdkVersion: String by project | ||
group = "aws.sdk.kotlin" | ||
version = sdkVersion | ||
|
||
Comment on lines
-40
to
-43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: What version will hll-codegen use now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It gets the version from the parent module hll: https://github.com/awslabs/aws-sdk-kotlin/pull/1419/files/fdf75ed58ff28d75e36f8d52662480a0c3d72ff1#diff-bc29db26a69fa060c49b8d3399f5ee9eb8014006435f213e5f424c0b0656be7eR47 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK so we'll just re-add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes and it's set up so we just have to change it in that one spot |
||
val sourcesJar by tasks.creating(Jar::class) { | ||
group = "publishing" | ||
description = "Assembles Kotlin sources jar" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "i.e." → "e.g."