Skip to content

Commit 9dc8e03

Browse files
committed
Use smithy-kotlin's ensureSuffix
1 parent e6051d3 commit 9dc8e03

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

hll/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import aws.sdk.kotlin.gradle.dsl.configurePublishing
77
import aws.sdk.kotlin.gradle.kmp.*
8+
import aws.smithy.kotlin.runtime.InternalApi
9+
import aws.smithy.kotlin.runtime.text.ensureSuffix
810
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
911

1012
description = "High-level libraries for the AWS SDK for Kotlin"
@@ -32,8 +34,7 @@ val optinAnnotations = listOf(
3234
"kotlin.RequiresOptIn",
3335
)
3436

35-
private fun String.ensureSuffix(suffix: String): String = if (endsWith(suffix)) this else plus(suffix)
36-
37+
@OptIn(InternalApi::class)
3738
val hllPreviewVersion = if (sdkVersion.contains("-SNAPSHOT")) { // e.g. 1.3.29-beta-SNAPSHOT
3839
sdkVersion
3940
.removeSuffix("-SNAPSHOT")

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2-
31
/*
42
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
53
* SPDX-License-Identifier: Apache-2.0
64
*/
5+
6+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
7+
import aws.smithy.kotlin.runtime.InternalApi
8+
import aws.smithy.kotlin.runtime.text.ensureSuffix
9+
710
description = "Plugin used to generate DynamoDbMapper schemas from user classes"
811
extra["displayName"] = "AWS :: SDK :: Kotlin :: HLL :: DynamoDbMapper :: Schema Generator Plugin"
912
extra["moduleName"] = "aws.sdk.kotlin.hll.dynamodbmapper.plugins"
@@ -88,8 +91,7 @@ tasks.test {
8891
// FIXME Commonize the following functions into the aws-kotlin-repo-tools build-support
8992
val sdkVersion: String by project
9093

91-
private fun String.ensureSuffix(suffix: String): String = if (endsWith(suffix)) this else plus(suffix)
92-
94+
@OptIn(InternalApi::class)
9395
val hllPreviewVersion = if (sdkVersion.contains("-SNAPSHOT")) { // e.g. 1.3.29-beta-SNAPSHOT
9496
sdkVersion
9597
.removeSuffix("-SNAPSHOT")

0 commit comments

Comments
 (0)