Skip to content

Commit

Permalink
Use kotlin-test 2.0 in apollo-compiler in order to not break generate…
Browse files Browse the repository at this point in the history
…d code compilation with 1.9
  • Loading branch information
BoD authored and Anka committed Oct 30, 2024
1 parent 425afc9 commit 5d177b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gradle/libraries.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ kotlin-stdlib-wasm-js = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test" } # the Kotlin plugin resolves the version
kotlin-test-js = { group = "org.jetbrains.kotlin", name = "kotlin-test-js" } # the Kotlin plugin resolves the version
kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit" } # the Kotlin plugin resolves the version
kotlin-test-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin-stdlib" } # use the same version as the stdlib
kotlin-test-junit-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin-stdlib" } # use the same version as the stdlib
kotlinx-benchmark-runtime = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.8"
kotlinx-benchmark = "org.jetbrains.kotlinx:kotlinx-benchmark-plugin:0.4.8"
kotlinx-browser = "org.jetbrains.kotlinx:kotlinx-browser:0.2"
Expand Down
11 changes: 10 additions & 1 deletion libraries/apollo-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ dependencies {
testImplementation(libs.kotlin.compiletesting)
testImplementation(libs.google.testing.compile)
testImplementation(libs.truth)
testImplementation(libs.kotlin.test.junit)
testImplementation(libs.kotlin.test.junit.stdlib) {
because("We compile the generated code with Kotlin 1.9, which doesn't understand classes compiled with 2.1")
}
testImplementation(libs.google.testparameterinjector)
testImplementation(project(":apollo-api-java")) {
because("Generated Java code references Java and Guava Optionals")
Expand Down Expand Up @@ -80,3 +82,10 @@ tasks.withType<Test>().configureEach {
addRelativeInput("usedtypesDir","src/test/usedtypes")
addRelativeInput("validationDir", "src/test/validation")
}

configurations.all {
resolutionStrategy {
// We compile the generated code with Kotlin 1.9, which doesn't understand classes compiled with 2.1
force(libs.kotlin.test.stdlib.get())
}
}

0 comments on commit 5d177b0

Please sign in to comment.