Remove LV/AV customization for the compiler CLI modules

The customization was added for compatibility with Gradle. That isn't a problem anymore, as we don't use it from KGP and soon we will eliminate the direct dependency on kotlin-compiler from KGP.
This commit is contained in:
Alexander.Likhachev
2023-05-12 14:30:44 +02:00
committed by Space Team
parent 44d9a2136b
commit 877438b1f3
4 changed files with 10 additions and 17 deletions
+3 -7
View File
@@ -36,13 +36,9 @@ allprojects {
optInToExperimentalCompilerApi()
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {
languageVersion = "1.4"
apiVersion = "1.4"
freeCompilerArgs = freeCompilerArgs - "-progressive" + listOf(
"-Xskip-prerelease-check", "-Xsuppress-version-warnings", "-Xuse-mixed-named-arguments"
)
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile> {
compilerOptions {
progressiveMode.set(true)
}
}
@@ -20,7 +20,7 @@ class ByteArrayCharSequence(
override val length get() = end - start
override fun get(index: Int): Char = bytes[index + start].toChar()
override fun get(index: Int): Char = bytes[index + start].toInt().toChar()
override fun subSequence(startIndex: Int, endIndex: Int): CharSequence {
if (startIndex == 0 && endIndex == length) return this
@@ -31,7 +31,7 @@ class ByteArrayCharSequence(
val chars = CharArray(length)
for (i in 0 until length) {
chars[i] = bytes[i + start].toChar()
chars[i] = bytes[i + start].toInt().toChar()
}
return String(chars)
@@ -30,6 +30,7 @@ import org.jetbrains.kotlin.resolve.jvm.modules.JavaModule
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleFinder
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo
import java.io.File
import java.util.*
class CliJavaModuleFinder(
private val jdkHome: File?,
@@ -176,7 +177,7 @@ class CliJavaModuleFinder(
)
}
private fun codeFor(release: Int): String = release.toString(36).toUpperCase()
private fun codeFor(release: Int): String = release.toString(36).uppercase(Locale.getDefault())
private fun matchesRelease(fileName: String, release: Int) =
!fileName.contains("-") && fileName.contains(codeFor(release)) // skip `*-modules`