From 505ec072bb2d8072c9f86f770d06bb9bb6d75b56 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 5 Mar 2020 14:13:03 +0100 Subject: [PATCH] Remove dependency of JarContentTest on JDK 8 It turns out that `jvmTarget` and `javaHome` settings in build.gradle.kts were changing the module settings and affected the compilation of kotlinx-metadata-jvm sources. The correct way to use JDK 8 in tests would be to change JVM target / JDK home of the specific KotlinCompile task via its `kotlinOptions`, but JarContentTest doesn't need JDK 8 anyway at this moment, so simplify that instead. --- libraries/kotlinx-metadata/jvm/build.gradle.kts | 5 ----- .../jvm/test/kotlinx/metadata/test/JarContentTest.kt | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/libraries/kotlinx-metadata/jvm/build.gradle.kts b/libraries/kotlinx-metadata/jvm/build.gradle.kts index a40cde3dc39..be9a52b6c86 100644 --- a/libraries/kotlinx-metadata/jvm/build.gradle.kts +++ b/libraries/kotlinx-metadata/jvm/build.gradle.kts @@ -48,11 +48,6 @@ dependencies { testRuntime(project(":kotlin-reflect")) } -tasks.named("compileTestKotlin") { - jvmTarget = "1.8" - javaHome = rootProject.extra["JDK_18"] as String -} - if (deployVersion != null) { publish() } diff --git a/libraries/kotlinx-metadata/jvm/test/kotlinx/metadata/test/JarContentTest.kt b/libraries/kotlinx-metadata/jvm/test/kotlinx/metadata/test/JarContentTest.kt index 79ba56b5795..39bee9e78b6 100644 --- a/libraries/kotlinx-metadata/jvm/test/kotlinx/metadata/test/JarContentTest.kt +++ b/libraries/kotlinx-metadata/jvm/test/kotlinx/metadata/test/JarContentTest.kt @@ -16,7 +16,6 @@ import org.junit.Assert.* import org.junit.Test import java.io.File import java.util.zip.ZipFile -import kotlin.text.Charsets.UTF_8 class JarContentTest { @Test @@ -27,7 +26,7 @@ class JarContentTest { } private fun checkClassesHasNoSpecificStringConstants(jar: File) { - val zipFile = ZipFile(jar, UTF_8) + val zipFile = ZipFile(jar) for (entry in zipFile.entries()) { if (!entry.name.endsWith(".class")) continue