-
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
Conversation
…nto feat-ddb-publish
A new generated diff is ready to view.
|
A new generated diff is ready to view.
|
hll/build.gradle.kts
Outdated
@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 comment
The reason will be displayed to describe this comment to others. Learn more.
hll/build.gradle.kts
Outdated
@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 comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Any reason not to make this a val
instead of a fun
?
val sdkVersion: String by project | ||
group = "aws.sdk.kotlin" | ||
version = sdkVersion | ||
|
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: What version will hll-codegen use now?
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
OK so we'll just re-add version = sdkVersion
when it comes time to GA the mapper?
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.
Yes and it's set up so we just have to change it in that one spot
import aws.smithy.kotlin.runtime.InternalApi | ||
import aws.smithy.kotlin.runtime.text.ensureSuffix |
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
hll/build.gradle.kts
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why was group
, version
, and configurePublishing
refactored into a second subprojects
block?
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.
All subprojects should have those values configured, they are not KMP-specific which is what the pre-existing block is for
// 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 comment
The 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 getHllPreviewVersion()
?
Nit: If so can we add a // FIXME
or a // TODO
to the other instance to remind us
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.
Personally I don't think this function will last long enough, it should be removed once we GA the DynamoDbMapper
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")) |
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: Refactor tasks.named("javadocJar")
into a val
Quality Gate passedIssues Measures |
A new generated diff is ready to view.
|
This PR sets up DynamoDBMapper and other related libraries for publication. It also removes the dynamodb-mapper-annotation-processor-test module since it's now duplicated by SchemaGeneratorPluginTest
Issue #
Description of changes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.