Skip to content

Commit

Permalink
remove need for toolchain and fix jdk8 test OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Oct 10, 2023
1 parent a646926 commit 3a59793
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ allprojects {

if (testJavaVersion != null) {
tasks.withType<Test> {
// JDK8 tests fail with out of memory sometimes, not sure why...
maxHeapSize = "2g"
val toolchains = project.extensions.getByType<JavaToolchainService>()
javaLauncher.set(
toolchains.launcherFor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ import org.junit.jupiter.params.provider.MethodSource
import java.nio.file.FileSystems
import java.nio.file.Files
import java.nio.file.Path
import java.util.stream.Collectors
import kotlin.io.path.exists
import kotlin.io.path.isDirectory
import kotlin.io.path.name
import kotlin.io.path.readText
import kotlin.streams.toList
import kotlin.test.*
import kotlin.time.Duration.Companion.seconds

Expand Down Expand Up @@ -94,7 +94,9 @@ public actual abstract class SigningSuiteTestBase : HasSigner {
private val testDirPaths: List<Path> by lazy {
Files
.walk(testSuitePath)
.toList()
// Due to https://youtrack.jetbrains.com/issue/KT-47039 setting jvmTarget compatibility isn't enough
// ignore the toList() extension in-favor of something that should work JDK8+ even if we compile with JDK17+
.collect(Collectors.toList())
.filter { !it.isDirectory() && it.name == "request.txt" }
.filterNot { it.parent.name in disabledTests }
.map { it.parent }
Expand Down
9 changes: 6 additions & 3 deletions runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ subprojects {
}
}
}

// Due to https://youtrack.jetbrains.com/issue/KT-47039 setting jvmTarget compatibility isn't enough
jvmToolchain(8)
}

kotlin.sourceSets.all {
Expand All @@ -66,4 +63,10 @@ subprojects {
dependencies {
dokkaPlugin(project(":dokka-smithy"))
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
}

0 comments on commit 3a59793

Please sign in to comment.