Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changes/058bf26f-7f37-439a-9170-d0a2c9c84e3e.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.runtime.config.auth

import aws.sdk.kotlin.runtime.InternalSdkApi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.runtime.config.checksums

import aws.sdk.kotlin.runtime.InternalSdkApi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.runtime.util

import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.runtime.auth.credentials

import aws.sdk.kotlin.runtime.auth.credentials.internal.credentials
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.runtime.http.interceptors

import aws.smithy.kotlin.runtime.client.ProtocolResponseInterceptorContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.runtime.http.interceptors.businessmetrics

import aws.sdk.kotlin.runtime.http.BUSINESS_METRICS_MAX_LENGTH
Expand Down Expand Up @@ -31,9 +26,7 @@ internal fun formatMetrics(metrics: MutableSet<BusinessMetric>, logger: Logger):
true
}
}
if (allowedMetrics.isEmpty()) {
return ""
}
if (allowedMetrics.isEmpty()) return ""
val metricsString = allowedMetrics.joinToString(",", "m/") { it.identifier }
val metricsByteArray = metricsString.encodeToByteArray()

Expand Down
12 changes: 0 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ buildscript {
// Add our custom gradle build logic to buildscript classpath
classpath(libs.aws.kotlin.repo.tools.build.support)
}

configurations.classpath {
resolutionStrategy {
/*
Version bumping the SDK to 1.5.x in repo tools broke our buildscript classpath:
java.lang.NoSuchMethodError: 'void kotlinx.coroutines.CancellableContinuation.resume(java.lang.Object, kotlin.jvm.functions.Function3)

FIXME: Figure out what broke our buildscipt classpath, this is a temporary fix
*/
force("com.squareup.okhttp3:okhttp-coroutines:5.0.0-alpha.14")
}
}
}

plugins {
Expand Down
5 changes: 0 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

plugins {
alias(libs.plugins.kotlin.jvm)
`kotlin-dsl`
Expand Down
5 changes: 0 additions & 5 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

rootProject.name = "buildSrc"

dependencyResolutionManagement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.tests.codegen

/**
Expand Down
5 changes: 0 additions & 5 deletions buildSrc/src/main/kotlin/dokka-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import org.jsoup.Jsoup
import kotlin.io.path.ExperimentalPathApi
import kotlin.io.path.PathWalkOption
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen

import software.amazon.smithy.aws.traits.ServiceTrait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.businessmetrics

import aws.sdk.kotlin.codegen.AwsRuntimeTypes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.businessmetrics

import aws.sdk.kotlin.codegen.AwsRuntimeTypes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.model.traits.testing

import software.amazon.smithy.model.node.ObjectNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.smoketests

import aws.sdk.kotlin.codegen.AwsRuntimeTypes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.smoketests

import software.amazon.smithy.kotlin.codegen.KotlinSettings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.smoketests.testing

import aws.sdk.kotlin.codegen.model.traits.testing.TestFailedResponseTrait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.smoketests.testing

import aws.sdk.kotlin.codegen.model.traits.testing.TestFailedResponseTrait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen

import software.amazon.smithy.build.MockManifest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.codegen.endpoints

import software.amazon.smithy.kotlin.codegen.core.KotlinWriter
Expand Down
65 changes: 45 additions & 20 deletions codegen/protocol-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,38 +73,63 @@ dependencies {
codegen(libs.smithy.aws.protocol.tests)
}

abstract class ProtocolTestTask @Inject constructor(private val project: Project) : DefaultTask() {
/**
* The projection
*/
@get:Input
abstract val projectionName: Property<String>

/**
* The projection root directory
*/
@get:Input
abstract val projectionRootDirectory: Property<String>

@TaskAction
fun runTests() {
val projectionRootDir = project.file(projectionRootDirectory.get())
println("[$projectionName] buildDir: $projectionRootDir")
if (!projectionRootDir.exists()) {
throw GradleException("$projectionRootDir does not exist")
}
val wrapper = if (System.getProperty("os.name").lowercase().contains("windows")) "gradlew.bat" else "gradlew"
val gradlew = project.rootProject.file(wrapper).absolutePath

// NOTE - this still requires us to publish to maven local.
project.exec {
workingDir = projectionRootDir
executable = gradlew
args = listOf("test")
}
}
}

smithyBuild.projections.forEach {
val protocolName = it.name

val dirProvider = smithyBuild
.smithyKotlinProjectionPath(protocolName)
.map { file(it.toString()) }
tasks.register<ProtocolTestTask>("testProtocol-$protocolName") {
dependsOn(tasks.generateSmithyProjections)
group = "Verification"
projectionName.set(it.name)
projectionRootDirectory.set(smithyBuild.smithyKotlinProjectionPath(it.name).map { it.toString() })
}

// FIXME This is a hack to work around how protocol tests aren't in the actual service model and thus codegen
// separately from service customizations.
val copyStaticFiles = tasks.register<Copy>("copyStaticFiles-$protocolName") {
group = "codegen"
from(rootProject.projectDir.resolve("services/$protocolName/common/src"))
into(smithyBuild.smithyKotlinProjectionSrcDir(protocolName))
into(smithyBuild.smithyKotlinProjectionSrcDir(it.name))
}

tasks.register<Exec>("testProtocol-$protocolName") {
group = "Verification"
dependsOn(tasks.generateSmithyProjections, copyStaticFiles)

doFirst {
val dir = dirProvider.get()
require(dir.exists()) { "$dir does not exist" }

val wrapper = if (System.getProperty("os.name").lowercase().contains("windows")) "gradlew.bat" else "gradlew"
val gradlew = rootProject.layout.projectDirectory.file(wrapper).asFile.absolutePath

workingDir = dir
executable = gradlew
args = listOf("test")
}
tasks.generateSmithyProjections.configure {
finalizedBy(copyStaticFiles)
}
}

tasks.register("testAllProtocols") {
group = "Verification"
dependsOn(tasks.matching { it.name.startsWith("testProtocol-") })
val allTests = tasks.withType<ProtocolTestTask>()
dependsOn(allTests)
}
5 changes: 0 additions & 5 deletions examples/cloudwatch-logs-graalvm/src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.example

import aws.sdk.kotlin.services.cloudwatchlogs.CloudWatchLogsClient
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ksp-version = "2.2.0-2.0.2" # Keep in sync with kotlin-version

dokka-version = "2.0.0"

aws-kotlin-repo-tools-version = "0.4.49"
aws-kotlin-repo-tools-version = "0.4.48"

# libs
coroutines-version = "1.10.2"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-9.0.0-bin.zip
distributionUrl=https://services.gradle.org/distributions/gradle-8.14.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.hll.dynamodbmapper.codegen.model

import aws.sdk.kotlin.hll.codegen.model.Type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations

import aws.smithy.kotlin.runtime.collections.AttributeKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.hll.dynamodbmapper.plugins

import aws.sdk.kotlin.hll.codegen.rendering.Visibility
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.hll.dynamodbmapper.plugins

import org.gradle.testkit.runner.GradleRunner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package org.example

import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbAttribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package org.example

import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbAttribute
Expand Down
Loading
Loading