Skip to content

Commit

Permalink
chore: bump version for m0 release (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd authored Mar 18, 2021
1 parent da54f2a commit b8d5d82
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 30 deletions.
4 changes: 2 additions & 2 deletions client-runtime/auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ description = "AWS Service Authentication"
extra["displayName"] = "Software :: AWS :: Kotlin SDK :: Auth"
extra["moduleName"] = "aws.sdk.kotlin.runtime.auth"

val smithyKotlinClientRtVersion: String by project
val smithyKotlinVersion: String by project

kotlin {
sourceSets {
commonMain {
dependencies {
val crtKotlinVersion: String by project
api(project(":client-runtime:aws-client-rt"))
api("software.aws.smithy.kotlin:http:$smithyKotlinClientRtVersion")
api("software.aws.smithy.kotlin:http:$smithyKotlinVersion")
implementation(project(":client-runtime:crt-util"))
implementation("aws.sdk.kotlin.crt:aws-crt-kotlin:$crtKotlinVersion")
}
Expand Down
4 changes: 2 additions & 2 deletions client-runtime/aws-client-rt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ extra["displayName"] = "Software :: AWS :: Kotlin SDK :: Client Runtime"
extra["moduleName"] = "aws.sdk.kotlin.runtime"


val smithyKotlinClientRtVersion: String by project
val smithyKotlinVersion: String by project

kotlin {
sourceSets {
commonMain {
dependencies {
api("software.aws.smithy.kotlin:client-rt-core:$smithyKotlinClientRtVersion")
api("software.aws.smithy.kotlin:client-rt-core:$smithyKotlinVersion")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions client-runtime/crt-util/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = "Utilities for working with AWS CRT Kotlin"
extra["displayName"] = "Software :: AWS :: Kotlin SDK :: CRT :: Util"
extra["moduleName"] = "aws.sdk.kotlin.runtime.crt"

val smithyKotlinClientRtVersion: String by project
val smithyKotlinVersion: String by project
val crtKotlinVersion: String by project

kotlin {
Expand All @@ -16,7 +16,7 @@ kotlin {
dependencies {
api(project(":client-runtime:aws-client-rt"))
api("aws.sdk.kotlin.crt:aws-crt-kotlin:$crtKotlinVersion")
api("software.aws.smithy.kotlin:http:$smithyKotlinClientRtVersion")
api("software.aws.smithy.kotlin:http:$smithyKotlinVersion")
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions client-runtime/protocols/aws-json-protocols/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ description = "Support for the JSON suite of AWS protocols"
extra["displayName"] = "Software :: AWS :: Kotlin SDK :: JSON"
extra["moduleName"] = "aws.sdk.kotlin.runtime.protocol.json"

val smithyKotlinClientRtVersion: String by project
val smithyKotlinVersion: String by project

kotlin {
sourceSets {
commonMain {
dependencies {
api("software.aws.smithy.kotlin:http:$smithyKotlinClientRtVersion")
api("software.aws.smithy.kotlin:http:$smithyKotlinVersion")
api(project(":client-runtime:aws-client-rt"))
implementation(project(":client-runtime:protocols:http"))
implementation("software.aws.smithy.kotlin:serde:$smithyKotlinClientRtVersion")
implementation("software.aws.smithy.kotlin:serde-json:$smithyKotlinClientRtVersion")
implementation("software.aws.smithy.kotlin:utils:$smithyKotlinClientRtVersion")
implementation("software.aws.smithy.kotlin:serde:$smithyKotlinVersion")
implementation("software.aws.smithy.kotlin:serde-json:$smithyKotlinVersion")
implementation("software.aws.smithy.kotlin:utils:$smithyKotlinVersion")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class RestJsonError(private val registry: ExceptionRegistry) : Feature {
error = RestJsonErrorDeserializer.deserialize(httpResponse, payload)
} catch (ex: Exception) {
throw UnknownServiceErrorException(
"failed to parse response as restJson protocol error",
"failed to parse response as Json protocol error",
ex
).also {
setAseFields(it, wrappedResponse, null)
Expand All @@ -76,7 +76,7 @@ public class RestJsonError(private val registry: ExceptionRegistry) : Feature {
// we already consumed the response body, wrap it to allow the modeled exception to deserialize
// any members that may be bound to the document
val deserializer = registry[error.code]?.deserializer
val modeledException = deserializer?.deserialize(req.context, wrappedResponse) ?: UnknownServiceErrorException()
val modeledException = deserializer?.deserialize(req.context, wrappedResponse) ?: UnknownServiceErrorException(error.message).also { setAseFields(it, wrappedResponse, error) }
setAseFields(modeledException, wrappedResponse, error)

// this should never happen...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,6 @@ class RestJsonErrorTest {
// verify it pulls out the error details/meta
assertEquals(ex.errorCode, "")
assertEquals(ex.requestId, "guid")
assertEquals(ex.message, "failed to parse response as restJson protocol error")
assertEquals(ex.message, "failed to parse response as Json protocol error")
}
}
2 changes: 1 addition & 1 deletion client-runtime/protocols/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin {
jvm() // Create a JVM target with the default name 'jvm'
}
}
4 changes: 2 additions & 2 deletions client-runtime/protocols/http/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ description = "HTTP core for AWS service clients"
extra["displayName"] = "Software :: AWS :: Kotlin SDK :: HTTP"
extra["moduleName"] = "aws.sdk.kotlin.runtime.http"

val smithyKotlinClientRtVersion: String by project
val smithyKotlinVersion: String by project

kotlin {
sourceSets {
commonMain {
dependencies {
api(project(":client-runtime:aws-client-rt"))
api(project(":client-runtime:regions"))
api("software.aws.smithy.kotlin:http:$smithyKotlinClientRtVersion")
api("software.aws.smithy.kotlin:http:$smithyKotlinVersion")
}
}

Expand Down
2 changes: 1 addition & 1 deletion client-runtime/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* SPDX-License-Identifier: Apache-2.0.
*/

description = "Internal test utilities"
description = "Internal test utilities"
4 changes: 2 additions & 2 deletions codegen/protocol-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ tasks["smithyBuildJar"].enabled = false

tasks.create<SmithyBuild>("buildSdk") {
// ensure the generated clients use the same version of the runtime as the aws client-runtime
val smithyKotlinClientRtVersion: String by project
val smithyKotlinVersion: String by project
doFirst {
System.setProperty("smithy.kotlin.codegen.clientRuntimeVersion", smithyKotlinClientRtVersion)
System.setProperty("smithy.kotlin.codegen.clientRuntimeVersion", smithyKotlinVersion)
}
addRuntimeClasspath = true
}
Expand Down
4 changes: 2 additions & 2 deletions codegen/sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ task("generateSmithyBuild") {

tasks.create<SmithyBuild>("generateSdk") {
// ensure the generated clients use the same version of the runtime as the aws client-runtime
val smithyKotlinClientRtVersion: String by project
val smithyKotlinVersion: String by project
doFirst {
System.setProperty("smithy.kotlin.codegen.clientRuntimeVersion", smithyKotlinClientRtVersion)
System.setProperty("smithy.kotlin.codegen.clientRuntimeVersion", smithyKotlinVersion)
}

addRuntimeClasspath = true
Expand Down
16 changes: 15 additions & 1 deletion codegen/smithy-aws-kotlin-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ plugins {
jacoco
}

val sdkVersion: String by project
description = "Codegen support for AWS protocols"
group = "software.amazon.smithy"
version = "0.1.0"
version = sdkVersion

val smithyVersion: String by project
val kotestVersion: String by project
Expand All @@ -26,8 +27,21 @@ dependencies {
testImplementation("io.kotest:kotest-assertions-core-jvm:$kotestVersion")
}

val generateSdkRuntimeVersion by tasks.registering {
// generate the version of the runtime to use as a resource.
// this keeps us from having to manually change version numbers in multiple places
val resourcesDir = "$buildDir/resources/main/aws/sdk/kotlin/codegen"
val versionFile = file("$resourcesDir/sdk-version.txt")
outputs.file(versionFile)
sourceSets.main.get().output.dir(resourcesDir)
doLast {
versionFile.writeText("$version")
}
}

tasks.compileKotlin {
kotlinOptions.jvmTarget = kotlinJVMTargetVersion
dependsOn(generateSdkRuntimeVersion)
}

tasks.compileTestKotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,32 @@
*/
package aws.sdk.kotlin.codegen

import software.amazon.smithy.codegen.core.CodegenException
import software.amazon.smithy.kotlin.codegen.GradleConfiguration
import software.amazon.smithy.kotlin.codegen.KotlinDependency
import software.amazon.smithy.kotlin.codegen.isValidVersion

// root namespace for the AWS client-runtime
const val AWS_CLIENT_RT_ROOT_NS = "aws.sdk.kotlin.runtime"
const val AWS_CLIENT_RT_AUTH_NS = "aws.sdk.kotlin.runtime.auth"
const val AWS_CLIENT_RT_REGIONS_NS = "aws.sdk.kotlin.runtime.regions"

private fun getDefaultRuntimeVersion(): String {
// generated as part of the build, see smithy-aws-kotlin-codegen/build.gradle.kts
try {
val version = object {}.javaClass.getResource("sdk-version.txt").readText()
check(isValidVersion(version)) { "Version parsed from sdk-version.txt '$version' is not a valid version string" }
return version
} catch (ex: Exception) {
throw CodegenException("failed to load sdk-version.txt which sets the default aws-client-runtime version", ex)
}
}

// publishing info
const val AWS_CLIENT_RT_GROUP: String = "aws.sdk.kotlin"
// note: this version doesn't really matter since we substitute it for project dependency notation
// when generating client build files
const val AWS_CLIENT_RT_VERSION: String = "0.1.0"
// when generating client build files (it is used by protocol tests though)
val AWS_CLIENT_RT_VERSION: String = getDefaultRuntimeVersion()

/**
* Container object for AWS specific dependencies
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
kotlin.code.style=official

# sdk
sdkVersion=0.1.0
sdkVersion=0.1.0-M0

# codegen
smithyVersion=1.6.1
smithyGradleVersion=0.5.2
smithyKotlinVersion=0.1.0
# smithy-kotlin codegen and runtime are versioned together
smithyKotlinVersion=0.1.0-M0

# kotlin
kotlinVersion=1.4.31
Expand All @@ -18,9 +19,8 @@ kotlinJVMTargetVersion=1.8
# kotlin libraries
coroutinesVersion=1.4.3

# default smithy-kotlin:client-runtime library version
smithyKotlinClientRtVersion=0.1.0
crtKotlinVersion=0.1.0
# crt
crtKotlinVersion=0.1.0-M0

# testing/utility
junitVersion=5.6.2
Expand Down

0 comments on commit b8d5d82

Please sign in to comment.