Skip to content

Commit 2645b61

Browse files
authored
misc: upgrade to Gradle 9.0.0 (#1388)
1 parent ae0a41c commit 2645b61

File tree

4 files changed

+29
-40
lines changed

4 files changed

+29
-40
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "47e8421b-f037-4968-9592-13cc3e237448",
3+
"type": "misc",
4+
"description": "Upgrade to Gradle 9.0.0"
5+
}

codegen/protocol-tests/build.gradle.kts

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -95,51 +95,35 @@ tasks.generateSmithyProjections {
9595
}
9696
}
9797

98-
abstract class ProtocolTestTask @Inject constructor(private val project: Project) : DefaultTask() {
99-
/**
100-
* The projection
101-
*/
102-
@get:Input
103-
abstract val projectionName: Property<String>
104-
105-
/**
106-
* The projection root directory
107-
*/
108-
@get:Input
109-
abstract val projectionRootDirectory: Property<String>
110-
111-
@TaskAction
112-
fun runTests() {
113-
val projectionRootDir = project.file(projectionRootDirectory.get())
114-
println("[$projectionName] buildDir: $projectionRootDir")
115-
if (!projectionRootDir.exists()) {
116-
throw GradleException("$projectionRootDir does not exist")
117-
}
118-
val wrapper = if (System.getProperty("os.name").lowercase().contains("windows")) "gradlew.bat" else "gradlew"
119-
val gradlew = project.rootProject.file(wrapper).absolutePath
120-
121-
// NOTE - this still requires us to publish to maven local.
122-
project.exec {
123-
workingDir = projectionRootDir
124-
executable = gradlew
125-
args = listOf("test")
126-
}
127-
}
128-
}
129-
13098
smithyBuild.projections.forEach {
13199
val protocolName = it.name
100+
val dirProvider = smithyBuild
101+
.smithyKotlinProjectionPath(protocolName)
102+
.map { file(it.toString()) }
132103

133-
tasks.register<ProtocolTestTask>("testProtocol-$protocolName") {
134-
dependsOn(tasks.generateSmithyProjections)
104+
tasks.register<Exec>("testProtocol-$protocolName") {
135105
group = "Verification"
136-
projectionName.set(it.name)
137-
projectionRootDirectory.set(smithyBuild.smithyKotlinProjectionPath(it.name).map { it.toString() })
106+
dependsOn(tasks.generateSmithyProjections)
107+
108+
doFirst {
109+
val dir = dirProvider.get()
110+
require(dir.exists()) { "$dir does not exist" }
111+
112+
val wrapper = if (System.getProperty("os.name").lowercase().contains("windows")) {
113+
"gradlew.bat"
114+
} else {
115+
"gradlew"
116+
}
117+
val gradlew = rootProject.layout.projectDirectory.file(wrapper).asFile.absolutePath
118+
119+
workingDir = dir
120+
executable = gradlew
121+
args = listOf("test")
122+
}
138123
}
139124
}
140125

141126
tasks.register("testAllProtocols") {
142127
group = "Verification"
143-
val allTests = tasks.withType<ProtocolTestTask>()
144-
dependsOn(allTests)
128+
dependsOn(tasks.matching { it.name.startsWith("testProtocol-") })
145129
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
kotlin-version = "2.2.0"
33
dokka-version = "2.0.0"
44

5-
aws-kotlin-repo-tools-version = "0.4.35"
5+
aws-kotlin-repo-tools-version = "0.4.41"
66

77
# libs
88
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

0 commit comments

Comments
 (0)