Skip to content

Commit d34227f

Browse files
authored
Fix reading of build_snapshot_train gradlew property. (#3326)
Reason: build_snapshot_train type had Boolean for the root project ktor, while in the rest of projects it is String? (:ktor-bom, :ktor-client, :ktor-http). That led to the java.lang.ClassCastException.
1 parent 91253f8 commit d34227f

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ buildscript {
1616
* Additionally, mavenLocal and Sonatype snapshots are added to repository list and stress tests are disabled.
1717
* DO NOT change the name of these properties without adapting kotlinx.train build chain.
1818
*/
19-
extra["build_snapshot_train"] = rootProject.properties["build_snapshot_train"].let { it != null && it != "" }
20-
val build_snapshot_train: Boolean by extra
19+
extra["build_snapshot_train"] = rootProject.properties["build_snapshot_train"]
20+
val build_snapshot_train: String? by extra
2121

22-
if (build_snapshot_train) {
22+
if (build_snapshot_train?.toBoolean() == true) {
2323
extra["kotlin_version"] = rootProject.properties["kotlin_snapshot_version"]
2424
val kotlin_version: String? by extra
2525
if (kotlin_version == null) {

buildSrc/src/main/kotlin/Train.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import org.gradle.api.tasks.testing.*
66
import org.gradle.kotlin.dsl.*
77

88
fun Project.filterSnapshotTests() {
9-
val build_snapshot_train: Boolean by extra
10-
if (!build_snapshot_train) return
9+
val build_snapshot_train: String? by extra
10+
if (build_snapshot_train?.toBoolean() != true) return
1111

1212
println("Hacking test tasks, removing stress and flaky tests")
1313
subprojects {
@@ -47,9 +47,10 @@ fun Project.filterSnapshotTests() {
4747

4848
fun Project.setupTrainForSubproject() {
4949
if (COMMON_JVM_ONLY) return
50-
51-
val build_snapshot_train: Boolean? by extra
52-
if (build_snapshot_train != true) return
50+
val build_snapshot_train: String? by extra
51+
if (build_snapshot_train?.toBoolean() != true) {
52+
return
53+
}
5354

5455
val atomicfu_version: String by extra
5556
val coroutines_version: String by extra

0 commit comments

Comments
 (0)