Drop all usages of WITH_RUNTIME directive

This commit is contained in:
Ivan Kylchik
2021-11-25 17:41:34 +03:00
committed by TeamCityServer
parent 1874318954
commit b131c52889
24 changed files with 27 additions and 42 deletions
@@ -12,11 +12,5 @@ object ConfigurationDirectives : SimpleDirectivesContainer() {
"List of kotlin configuration flags" "List of kotlin configuration flags"
) )
val WITH_RUNTIME by directive( val WITH_STDLIB by directive("Add Kotlin stdlib to classpath")
description = """
Add Kotlin stdlib to classpath
This directive is deprecated, use WITH_STDLIB instead
""".trimIndent()
)
val WITH_STDLIB by directive("Add Kotlin runtime to classpath")
} }
@@ -1,5 +1,5 @@
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// WITH_RUNTUME // WITH_STDLIB
// See also: KT-42083 // See also: KT-42083
@@ -2,7 +2,7 @@
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM // IGNORE_BACKEND: JVM
// WITH_RUNTIME // WITH_STDLIB
interface Semigroup<T> { interface Semigroup<T> {
infix fun T.combine(other: T): T infix fun T.combine(other: T): T
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
fun <E> SmartList(x: E) {} fun <E> SmartList(x: E) {}
fun <E> SmartList(x: Collection<E>) {} fun <E> SmartList(x: Collection<E>) {}
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
fun <E> SmartList(x: E) {} fun <E> SmartList(x: E) {}
fun <E> SmartList(x: Collection<E>) {} fun <E> SmartList(x: Collection<E>) {}
@@ -1,6 +1,6 @@
// FIR_IDENTICAL // FIR_IDENTICAL
// !LANGUAGE: +DisableCheckingChangedProgressionsResolve // !LANGUAGE: +DisableCheckingChangedProgressionsResolve
// WITH_RUNTIME // WITH_STDLIB
fun <E> SmartList(x: E) {} fun <E> SmartList(x: E) {}
fun <E> SmartList(x: Collection<E>) {} fun <E> SmartList(x: Collection<E>) {}
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
// !LANGUAGE: +ProgressionsChangingResolve // !LANGUAGE: +ProgressionsChangingResolve
fun <E> SmartList(x: E) {} fun <E> SmartList(x: E) {}
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
// !LANGUAGE: +ProgressionsChangingResolve // !LANGUAGE: +ProgressionsChangingResolve
fun <E> SmartList(x: E) {} fun <E> SmartList(x: E) {}
@@ -1,5 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// WITH_RUNTIME // WITH_STDLIB
fun List<Int>.decimateEveryEvenThird() = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>sequence<!> { fun List<Int>.decimateEveryEvenThird() = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>sequence<!> {
var counter = 1 var counter = 1
@@ -1,5 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// WITH_RUNTIME // WITH_STDLIB
fun List<Int>.decimateEveryEvenThird() = sequence { fun List<Int>.decimateEveryEvenThird() = sequence {
var counter = 1 var counter = 1
+1 -1
View File
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
import kotlin.collections.forEach as forEach1 import kotlin.collections.forEach as forEach1
+1 -1
View File
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
import kotlin.collections.forEach as forEach1 import kotlin.collections.forEach as forEach1
+1 -1
View File
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
class AllCollection2<T> { class AllCollection2<T> {
fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1 fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1
+1 -1
View File
@@ -1,4 +1,4 @@
// WITH_RUNTIME // WITH_STDLIB
class AllCollection2<T> { class AllCollection2<T> {
fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1 fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1
@@ -1,5 +1,5 @@
// !LANGUAGE: +EliminateAmbiguitiesWithExternalTypeParameters // !LANGUAGE: +EliminateAmbiguitiesWithExternalTypeParameters
// WITH_RUNTIME // WITH_STDLIB
class AllCollection<T> { class AllCollection<T> {
fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1 fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1
@@ -1,5 +1,5 @@
// !LANGUAGE: +EliminateAmbiguitiesWithExternalTypeParameters // !LANGUAGE: +EliminateAmbiguitiesWithExternalTypeParameters
// WITH_RUNTIME // WITH_STDLIB
class AllCollection<T> { class AllCollection<T> {
fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1 fun <K, T> addAll(vararg values: T, values2: Array<K>) = "OK" // 1
@@ -1,7 +1,7 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME // WITH_STDLIB
class View { class View {
val coefficient = 42 val coefficient = 42
@@ -1,7 +1,7 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME // WITH_STDLIB
interface Semigroup<T> { interface Semigroup<T> {
infix fun T.combine(other: T): T infix fun T.combine(other: T): T
@@ -140,8 +140,7 @@ class JsEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigu
fun getRuntimePathsForModule(module: TestModule, testServices: TestServices): List<String> { fun getRuntimePathsForModule(module: TestModule, testServices: TestServices): List<String> {
val result = mutableListOf<String>() val result = mutableListOf<String>()
val needsFullIrRuntime = JsEnvironmentConfigurationDirectives.KJS_WITH_FULL_RUNTIME in module.directives || val needsFullIrRuntime = JsEnvironmentConfigurationDirectives.KJS_WITH_FULL_RUNTIME in module.directives ||
ConfigurationDirectives.WITH_STDLIB in module.directives || ConfigurationDirectives.WITH_STDLIB in module.directives
ConfigurationDirectives.WITH_RUNTIME in module.directives
val names = if (needsFullIrRuntime) listOf("full.stdlib", "kotlin.test") else listOf("reduced.stdlib") val names = if (needsFullIrRuntime) listOf("full.stdlib", "kotlin.test") else listOf("reduced.stdlib")
names.mapTo(result) { System.getProperty("kotlin.js.$it.path") } names.mapTo(result) { System.getProperty("kotlin.js.$it.path") }
@@ -71,16 +71,15 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig
private const val JAVA_BINARIES_JAR_NAME = "java-binaries" private const val JAVA_BINARIES_JAR_NAME = "java-binaries"
fun extractConfigurationKind(registeredDirectives: RegisteredDirectives): ConfigurationKind { fun extractConfigurationKind(registeredDirectives: RegisteredDirectives): ConfigurationKind {
val withRuntime = ConfigurationDirectives.WITH_RUNTIME in registeredDirectives || val withStdlib = ConfigurationDirectives.WITH_STDLIB in registeredDirectives
ConfigurationDirectives.WITH_STDLIB in registeredDirectives
val withReflect = JvmEnvironmentConfigurationDirectives.WITH_REFLECT in registeredDirectives val withReflect = JvmEnvironmentConfigurationDirectives.WITH_REFLECT in registeredDirectives
val noRuntime = JvmEnvironmentConfigurationDirectives.NO_RUNTIME in registeredDirectives val noRuntime = JvmEnvironmentConfigurationDirectives.NO_RUNTIME in registeredDirectives
if (noRuntime && withRuntime) { if (noRuntime && withStdlib) {
error("NO_RUNTIME and WITH_RUNTIME can not be used together") error("NO_RUNTIME and WITH_STDLIB can not be used together")
} }
return when { return when {
withRuntime && !withReflect -> ConfigurationKind.NO_KOTLIN_REFLECT withStdlib && !withReflect -> ConfigurationKind.NO_KOTLIN_REFLECT
withRuntime || withReflect -> ConfigurationKind.ALL withStdlib || withReflect -> ConfigurationKind.ALL
noRuntime -> ConfigurationKind.JDK_NO_RUNTIME noRuntime -> ConfigurationKind.JDK_NO_RUNTIME
else -> ConfigurationKind.JDK_ONLY else -> ConfigurationKind.JDK_ONLY
} }
@@ -64,9 +64,6 @@ abstract class AbstractIrGeneratorTestCase : CodegenTestCase() {
var addRuntime = false var addRuntime = false
var addReflect = false var addReflect = false
for (file in files) { for (file in files) {
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_RUNTIME")) {
addRuntime = true
}
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_STDLIB")) { if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_STDLIB")) {
addRuntime = true addRuntime = true
} }
@@ -194,9 +194,6 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
var addRuntime = false var addRuntime = false
var addReflect = false var addReflect = false
for (file in files) { for (file in files) {
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_RUNTIME")) {
addRuntime = true
}
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_STDLIB")) { if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_STDLIB")) {
addRuntime = true addRuntime = true
} }
@@ -43,9 +43,8 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
val tmpdir = KtTestUtil.tmpDir(getTestName(true)) val tmpdir = KtTestUtil.tmpDir(getTestName(true))
val withRuntime = InTextDirectivesUtils.isDirectiveDefined(commonSrc.readText(), "WITH_RUNTIME") || val withStdlib = InTextDirectivesUtils.isDirectiveDefined(commonSrc.readText(), "WITH_STDLIB")
InTextDirectivesUtils.isDirectiveDefined(commonSrc.readText(), "WITH_STDLIB") val optionalStdlibCommon = if (withStdlib) arrayOf("-cp", findStdlibCommon().absolutePath) else emptyArray()
val optionalStdlibCommon = if (withRuntime) arrayOf("-cp", findStdlibCommon().absolutePath) else emptyArray()
val commonDest = File(tmpdir, "common").absolutePath val commonDest = File(tmpdir, "common").absolutePath
val jvmDest = File(tmpdir, "jvm").absolutePath.takeIf { jvmSrc != null } val jvmDest = File(tmpdir, "jvm").absolutePath.takeIf { jvmSrc != null }
@@ -1,7 +1,7 @@
// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// WITH_RUNTIME // WITH_STDLIB
package a package a