Skip to content

Commit 61a6919

Browse files
authored
misc: upgrade to Gradle 9.0.0 (#1665)
1 parent 3fdb5d8 commit 61a6919

File tree

12 files changed

+50
-65
lines changed

12 files changed

+50
-65
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "058bf26f-7f37-439a-9170-d0a2c9c84e3e",
3+
"type": "misc",
4+
"description": "Upgrade to Gradle 9.0.0"
5+
}

build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ buildscript {
1414
// Add our custom gradle build logic to buildscript classpath
1515
classpath(libs.aws.kotlin.repo.tools.build.support)
1616
}
17+
18+
configurations.classpath {
19+
resolutionStrategy {
20+
/*
21+
Version bumping the SDK to 1.5.x in repo tools broke our buildscript classpath:
22+
java.lang.NoSuchMethodError: 'void kotlinx.coroutines.CancellableContinuation.resume(java.lang.Object, kotlin.jvm.functions.Function3)
23+
24+
FIXME: Figure out what broke our buildscipt classpath, this is a temporary fix
25+
*/
26+
force("com.squareup.okhttp3:okhttp-coroutines:5.0.0-alpha.14")
27+
}
28+
}
1729
}
1830

1931
plugins {

codegen/protocol-tests/build.gradle.kts

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -73,63 +73,38 @@ dependencies {
7373
codegen(libs.smithy.aws.protocol.tests)
7474
}
7575

76-
abstract class ProtocolTestTask @Inject constructor(private val project: Project) : DefaultTask() {
77-
/**
78-
* The projection
79-
*/
80-
@get:Input
81-
abstract val projectionName: Property<String>
82-
83-
/**
84-
* The projection root directory
85-
*/
86-
@get:Input
87-
abstract val projectionRootDirectory: Property<String>
88-
89-
@TaskAction
90-
fun runTests() {
91-
val projectionRootDir = project.file(projectionRootDirectory.get())
92-
println("[$projectionName] buildDir: $projectionRootDir")
93-
if (!projectionRootDir.exists()) {
94-
throw GradleException("$projectionRootDir does not exist")
95-
}
96-
val wrapper = if (System.getProperty("os.name").lowercase().contains("windows")) "gradlew.bat" else "gradlew"
97-
val gradlew = project.rootProject.file(wrapper).absolutePath
98-
99-
// NOTE - this still requires us to publish to maven local.
100-
project.exec {
101-
workingDir = projectionRootDir
102-
executable = gradlew
103-
args = listOf("test")
104-
}
105-
}
106-
}
107-
10876
smithyBuild.projections.forEach {
10977
val protocolName = it.name
11078

111-
tasks.register<ProtocolTestTask>("testProtocol-$protocolName") {
112-
dependsOn(tasks.generateSmithyProjections)
113-
group = "Verification"
114-
projectionName.set(it.name)
115-
projectionRootDirectory.set(smithyBuild.smithyKotlinProjectionPath(it.name).map { it.toString() })
116-
}
79+
val dirProvider = smithyBuild
80+
.smithyKotlinProjectionPath(protocolName)
81+
.map { file(it.toString()) }
11782

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

126-
tasks.generateSmithyProjections.configure {
127-
finalizedBy(copyStaticFiles)
89+
tasks.register<Exec>("testProtocol-$protocolName") {
90+
group = "Verification"
91+
dependsOn(tasks.generateSmithyProjections, copyStaticFiles)
92+
93+
doFirst {
94+
val dir = dirProvider.get()
95+
require(dir.exists()) { "$dir does not exist" }
96+
97+
val wrapper = if (System.getProperty("os.name").lowercase().contains("windows")) "gradlew.bat" else "gradlew"
98+
val gradlew = rootProject.layout.projectDirectory.file(wrapper).asFile.absolutePath
99+
100+
workingDir = dir
101+
executable = gradlew
102+
args = listOf("test")
103+
}
128104
}
129105
}
130106

131107
tasks.register("testAllProtocols") {
132108
group = "Verification"
133-
val allTests = tasks.withType<ProtocolTestTask>()
134-
dependsOn(allTests)
109+
dependsOn(tasks.matching { it.name.startsWith("testProtocol-") })
135110
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ksp-version = "2.2.0-2.0.2" # Keep in sync with kotlin-version
44

55
dokka-version = "2.0.0"
66

7-
aws-kotlin-repo-tools-version = "0.4.36"
7+
aws-kotlin-repo-tools-version = "0.4.48"
88

99
# libs
1010
coroutines-version = "1.10.2"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https://services.gradle.org/distributions/gradle-8.14.2-bin.zip
3+
distributionUrl=https://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ if (project.NATIVE_ENABLED) {
113113
}
114114
}
115115

116-
listOf("jvmSourcesJar", "metadataSourcesJar").forEach {
116+
listOf("jvmSourcesJar", "metadataSourcesJar", "jvmProcessResources").forEach {
117117
tasks.named(it) {
118118
dependsOn(moveGenSrc)
119119
}

hll/hll-codegen/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ dependencies {
3030
api(project(":aws-runtime:aws-core"))
3131
implementation(libs.ksp.api)
3232
implementation(libs.smithy.kotlin.runtime.core)
33-
34-
testImplementation(libs.junit.jupiter)
35-
testImplementation(libs.junit.jupiter.params)
36-
testImplementation(libs.kotest.assertions.core.jvm)
37-
testImplementation(libs.kotlin.test.junit5)
33+
testImplementation(kotlin("test"))
3834
}
3935

4036
val sourcesJar by tasks.creating(Jar::class) {

hll/hll-codegen/src/test/kotlin/aws/sdk/kotlin/hll/codegen/core/TemplateEngineTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55
package aws.sdk.kotlin.hll.codegen.core
66

7-
import org.junit.jupiter.api.Assertions.assertEquals
8-
import org.junit.jupiter.api.Test
7+
import kotlin.test.Test
8+
import kotlin.test.assertEquals
99
import kotlin.test.assertFailsWith
1010

1111
class TemplateEngineTest {

hll/hll-codegen/src/test/kotlin/aws/sdk/kotlin/hll/codegen/core/TemplateProcessorTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ package aws.sdk.kotlin.hll.codegen.core
66

77
import aws.sdk.kotlin.hll.codegen.model.TypeRef
88
import aws.sdk.kotlin.hll.codegen.model.TypeVar
9-
import org.junit.jupiter.api.Assertions.assertEquals
10-
import org.junit.jupiter.api.Test
9+
import kotlin.test.Test
1110
import kotlin.test.assertContains
11+
import kotlin.test.assertEquals
1212

1313
class TemplateProcessorTest {
1414
@Test

hll/hll-codegen/src/test/kotlin/aws/sdk/kotlin/hll/codegen/util/StringsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55
package aws.sdk.kotlin.hll.codegen.util
66

7-
import org.junit.jupiter.api.Assertions.assertEquals
8-
import org.junit.jupiter.api.Test
7+
import kotlin.test.Test
8+
import kotlin.test.assertEquals
99

1010
class StringsTest {
1111
@Test

0 commit comments

Comments
 (0)