Skip to content

Commit

Permalink
re-export smithy kotlin dep in our bom and version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Oct 21, 2023
1 parent e5d12eb commit 0348e2d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 35 deletions.
2 changes: 1 addition & 1 deletion aws-runtime/aws-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kotlin {

// additional dependencies required by generated sts provider
implementation(libs.smithy.kotlin.serde.xml)
implementation(libs.smithy.kotlin.serde.formurl)
implementation(libs.smithy.kotlin.serde.form.url)
implementation(libs.smithy.kotlin.aws.xml.protocols)

// additional dependencies required by generated sso provider(s)
Expand Down
26 changes: 17 additions & 9 deletions bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,27 @@ fun createBomConstraintsAndVersionCatalog() {
}
}

val ignoredSmithyKotlin = setOf(
"smithy.kotlin.codegen",
"smithy.kotlin.http.test",
"smithy.kotlin.test",
"smithy.kotlin.smithy.test",
"smithy.kotlin.aws.signing.test",
)

// add smithy-kotlin versions to our BOM and allow direct aliasing in the catalog
val smithyKotlinCatalog = extensions.getByType<VersionCatalogsExtension>().named("smithyKotlin")
catalogExt.versionCatalog {
smithyKotlinCatalog.libraryAliases.forEach { alias ->
val coordinates = smithyKotlinCatalog.findLibrary(alias).get()
bomConstraints.api(coordinates)
val newAlias = "runtime-smithykotlin-$alias"
library(newAlias, coordinates.get().toString())
}
val libsCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
libsCatalog.libraryAliases
.filter {
it.startsWith("smithy.kotlin") && ignoredSmithyKotlin.none { prefix -> it.startsWith(prefix) }
}.forEach { alias ->
val coordinates = libsCatalog.findLibrary(alias).get()
bomConstraints.api(coordinates)
val newAlias = "runtime-${alias.replace('.', '-')}"
library(newAlias, coordinates.get().toString())
}
}


}

fun Project.artifactId(target: KotlinTarget): String = when (target) {
Expand Down
45 changes: 26 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,35 @@ slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j-version

smithy-kotlin-aws-credentials = { module = "aws.smithy.kotlin:aws-credentials", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-event-stream = { module = "aws.smithy.kotlin:aws-event-stream", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-json-protocols = { module = "aws.smithy.kotlin:aws-json-protocols", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-protocol-core = { module = "aws.smithy.kotlin:aws-protocol-core", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-signing-common = { module = "aws.smithy.kotlin:aws-signing-common", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-signing-crt = { module = "aws.smithy.kotlin:aws-signing-crt", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-signing-default = { module = "aws.smithy.kotlin:aws-signing-default", version.ref = "smithy-kotlin-version" }
smithy-kotlin-runtime-core = { module = "aws.smithy.kotlin:runtime-core", version.ref = "smithy-kotlin-version" }
smithy-kotlin-smithy-client = { module = "aws.smithy.kotlin:smithy-client", version.ref = "smithy-kotlin-version" }
smithy-kotlin-smithy-test = { module = "aws.smithy.kotlin:smithy-test", version.ref = "smithy-kotlin-version" }
smithy-kotlin-identity-api = { module = "aws.smithy.kotlin:identity-api", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-xml-protocols = { module = "aws.smithy.kotlin:aws-xml-protocols", version.ref = "smithy-kotlin-version" }
smithy-kotlin-crt-util = { module = "aws.smithy.kotlin:crt-util", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http = { module = "aws.smithy.kotlin:http", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-auth = { module = "aws.smithy.kotlin:http-auth", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-auth-api = { module = "aws.smithy.kotlin:http-auth-api", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-auth-aws = { module = "aws.smithy.kotlin:http-auth-aws", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-client = { module = "aws.smithy.kotlin:http-client", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-client-engine-default = { module = "aws.smithy.kotlin:http-client-engine-default", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-client-engine-crt = { module = "aws.smithy.kotlin:http-client-engine-crt", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-client-engine-default = { module = "aws.smithy.kotlin:http-client-engine-default", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-client-engine-okhttp = { module = "aws.smithy.kotlin:http-client-engine-okhttp", version.ref = "smithy-kotlin-version" }
smithy-kotlin-http-test = { module = "aws.smithy.kotlin:http-test", version.ref = "smithy-kotlin-version" }
smithy-kotlin-serde-core = { module = "aws.smithy.kotlin:serde", version.ref = "smithy-kotlin-version" }
smithy-kotlin-identity-api = { module = "aws.smithy.kotlin:identity-api", version.ref = "smithy-kotlin-version" }
smithy-kotlin-logging-slf4j2 = { module = "aws.smithy.kotlin:logging-slf4j2", version.ref = "smithy-kotlin-version" }
smithy-kotlin-runtime-core = { module = "aws.smithy.kotlin:runtime-core", version.ref = "smithy-kotlin-version" }
smithy-kotlin-serde = { module = "aws.smithy.kotlin:serde", version.ref = "smithy-kotlin-version" }
smithy-kotlin-serde-form-url = { module = "aws.smithy.kotlin:serde-form-url", version.ref = "smithy-kotlin-version" }
smithy-kotlin-serde-json = { module = "aws.smithy.kotlin:serde-json", version.ref = "smithy-kotlin-version" }
smithy-kotlin-serde-xml = { module = "aws.smithy.kotlin:serde-xml", version.ref = "smithy-kotlin-version" }
smithy-kotlin-serde-formurl = { module = "aws.smithy.kotlin:serde-form-url", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-protocol-core = { module = "aws.smithy.kotlin:aws-protocol-core", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-xml-protocols = { module = "aws.smithy.kotlin:aws-xml-protocols", version.ref = "smithy-kotlin-version" }
smithy-kotlin-aws-json-protocols = { module = "aws.smithy.kotlin:aws-json-protocols", version.ref = "smithy-kotlin-version" }
smithy-kotlin-smithy-client = { module = "aws.smithy.kotlin:smithy-client", version.ref = "smithy-kotlin-version" }
smithy-kotlin-smithy-test = { module = "aws.smithy.kotlin:smithy-test", version.ref = "smithy-kotlin-version" }
smithy-kotlin-telemetry-api = { module = "aws.smithy.kotlin:telemetry-api", version.ref = "smithy-kotlin-version" }
smithy-kotlin-telemetry-defaults = { module = "aws.smithy.kotlin:telemetry-defaults", version.ref = "smithy-kotlin-version" }
smithy-kotlin-telemetry-provider-otel = { module = "aws.smithy.kotlin:telemetry-provider-otel", version.ref = "smithy-kotlin-version" }
smithy-kotlin-test-suite = { module = "aws.smithy.kotlin:test-suite", version.ref = "smithy-kotlin-version" }
smithy-kotlin-testing = { module = "aws.smithy.kotlin:testing", version.ref = "smithy-kotlin-version" }

smithy-kotlin-codegen = { module = "software.amazon.smithy.kotlin:smithy-kotlin-codegen", version.ref = "smithy-kotlin-version" }
Expand Down Expand Up @@ -96,19 +103,19 @@ mockk = { module = "io.mockk:mockk", version.ref = "mockk-version" }
[bundles]
# bundle of smithy-kotlin dependencies all AWS service clients have
smithy-kotlin-service-client = [
"smithy-kotlin-runtime-core",
"smithy-kotlin-smithy-client",
"smithy-kotlin-http-client",
"smithy-kotlin-http-client-engine-default",
"smithy-kotlin-http",
"smithy-kotlin-http-auth",
"smithy-kotlin-http-auth-aws",
"smithy-kotlin-aws-credentials",
"smithy-kotlin-aws-protocol-core",
"smithy-kotlin-serde-core",
"smithy-kotlin-aws-signing-common",
"smithy-kotlin-aws-signing-default",
"smithy-kotlin-http",
"smithy-kotlin-http-auth",
"smithy-kotlin-http-auth-aws",
"smithy-kotlin-http-client",
"smithy-kotlin-http-client-engine-default",
"smithy-kotlin-identity-api",
"smithy-kotlin-aws-credentials",
"smithy-kotlin-runtime-core",
"smithy-kotlin-serde",
"smithy-kotlin-smithy-client",
"smithy-kotlin-telemetry-api",
"smithy-kotlin-telemetry-defaults",
]
Expand Down
6 changes: 0 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ dependencyResolutionManagement {
mavenLocal()
mavenCentral()
}

versionCatalogs {
create("smithyKotlin") {
from("aws.smithy.kotlin:version-catalog:0.28.0-SNAPSHOT")
}
}
}

sourceControl {
Expand Down

0 comments on commit 0348e2d

Please sign in to comment.