-
Notifications
You must be signed in to change notification settings - Fork 55
feat: setup DynamoDbMapper publication #1419
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
Changes from all 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 |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| import aws.smithy.kotlin.runtime.InternalApi | ||
| import aws.smithy.kotlin.runtime.text.ensureSuffix | ||
| 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
Contributor
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) | ||
| val hllPreviewVersion = if (sdkVersion.contains("-SNAPSHOT")) { // e.g. 1.3.29-beta-SNAPSHOT | ||
| sdkVersion | ||
| .removeSuffix("-SNAPSHOT") | ||
| .ensureSuffix("-beta-SNAPSHOT") | ||
| } else { | ||
| sdkVersion.ensureSuffix("-beta") // e.g. 1.3.29-beta | ||
| } | ||
|
|
||
| /** | ||
| * 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(hllPreviewVersion) | ||
| } | ||
| } | ||
|
|
||
|
|
||
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
Contributor
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?
Member
Author
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
Contributor
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
Member
Author
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.
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 comment
The 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