Skip to content

Commit aba83a8

Browse files
committed
Revert "misc: upgrade to Gradle 9.0.0 (#1665)"
This reverts commit 61a6919.
1 parent 20da6c0 commit aba83a8

File tree

11 files changed

+64
-49
lines changed

11 files changed

+64
-49
lines changed

.changes/058bf26f-7f37-439a-9170-d0a2c9c84e3e.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ 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-
}
2917
}
3018

3119
plugins {

codegen/protocol-tests/build.gradle.kts

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,38 +73,63 @@ 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+
76108
smithyBuild.projections.forEach {
77109
val protocolName = it.name
78110

79-
val dirProvider = smithyBuild
80-
.smithyKotlinProjectionPath(protocolName)
81-
.map { file(it.toString()) }
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+
}
82117

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.
83120
val copyStaticFiles = tasks.register<Copy>("copyStaticFiles-$protocolName") {
84121
group = "codegen"
85122
from(rootProject.projectDir.resolve("services/$protocolName/common/src"))
86-
into(smithyBuild.smithyKotlinProjectionSrcDir(protocolName))
123+
into(smithyBuild.smithyKotlinProjectionSrcDir(it.name))
87124
}
88125

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-
}
126+
tasks.generateSmithyProjections.configure {
127+
finalizedBy(copyStaticFiles)
104128
}
105129
}
106130

107131
tasks.register("testAllProtocols") {
108132
group = "Verification"
109-
dependsOn(tasks.matching { it.name.startsWith("testProtocol-") })
133+
val allTests = tasks.withType<ProtocolTestTask>()
134+
dependsOn(allTests)
110135
}
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-9.0.0-bin.zip
3+
distributionUrl=https://services.gradle.org/distributions/gradle-8.14.2-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", "jvmProcessResources").forEach {
116+
listOf("jvmSourcesJar", "metadataSourcesJar").forEach {
117117
tasks.named(it) {
118118
dependsOn(moveGenSrc)
119119
}

hll/hll-codegen/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ dependencies {
3030
api(project(":aws-runtime:aws-core"))
3131
implementation(libs.ksp.api)
3232
implementation(libs.smithy.kotlin.runtime.core)
33-
testImplementation(kotlin("test"))
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)
3438
}
3539

3640
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 kotlin.test.Test
8-
import kotlin.test.assertEquals
7+
import org.junit.jupiter.api.Assertions.assertEquals
8+
import org.junit.jupiter.api.Test
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 kotlin.test.Test
9+
import org.junit.jupiter.api.Assertions.assertEquals
10+
import org.junit.jupiter.api.Test
1011
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 kotlin.test.Test
8-
import kotlin.test.assertEquals
7+
import org.junit.jupiter.api.Assertions.assertEquals
8+
import org.junit.jupiter.api.Test
99

1010
class StringsTest {
1111
@Test

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ if ("dynamodb".isBootstrappedService) {
8787
include(":hll:dynamodb-mapper:dynamodb-mapper-schema-codegen")
8888
include(":hll:dynamodb-mapper:dynamodb-mapper-annotations")
8989
include(":hll:dynamodb-mapper:dynamodb-mapper-schema-generator-plugin")
90+
include(":hll:dynamodb-mapper:tests:dynamodb-mapper-schema-generator-plugin-test")
9091
} else {
9192
logger.warn(":services:dynamodb is not bootstrapped, skipping :hll:dynamodb-mapper and subprojects")
9293
}

0 commit comments

Comments
 (0)