diff --git a/compiler/arguments/resources/kotlin-compiler-arguments.json b/compiler/arguments/resources/kotlin-compiler-arguments.json index 6a0698951861b..480d575dbb68f 100644 --- a/compiler/arguments/resources/kotlin-compiler-arguments.json +++ b/compiler/arguments/resources/kotlin-compiler-arguments.json @@ -7026,7 +7026,7 @@ "current": "Paths to output directories for friend modules (modules whose internals should be visible).", "valueInVersions": [] }, - "delimiter": "Default", + "delimiter": null, "affectsCompilationOutcome": true, "valueType": { "type": "org.jetbrains.kotlin.arguments.dsl.types.StringArrayType", @@ -7327,7 +7327,7 @@ "current": "Paths to directories with Java source files.", "valueInVersions": [] }, - "delimiter": "Default", + "delimiter": null, "affectsCompilationOutcome": true, "valueType": { "type": "org.jetbrains.kotlin.arguments.dsl.types.StringArrayType", diff --git a/compiler/arguments/src/org/jetbrains/kotlin/arguments/description/JvmCompilerArguments.kt b/compiler/arguments/src/org/jetbrains/kotlin/arguments/description/JvmCompilerArguments.kt index af4f5c68dad8c..7192761d6645c 100644 --- a/compiler/arguments/src/org/jetbrains/kotlin/arguments/description/JvmCompilerArguments.kt +++ b/compiler/arguments/src/org/jetbrains/kotlin/arguments/description/JvmCompilerArguments.kt @@ -430,7 +430,6 @@ This can be used in the event of problems with the new implementation.""".asRele valueType = StringArrayType.defaultNull valueDescription = "".asReleaseDependent() argumentType = PathListType.defaultEmpty - delimiter = KotlinCompilerArgument.Delimiter.Default lifecycle( introducedVersion = KotlinReleaseVersion.v1_3_40, @@ -592,7 +591,6 @@ problems with parentheses in identifiers on certain platforms.""".asReleaseDepen valueType = StringArrayType.defaultNull valueDescription = "".asReleaseDependent() argumentType = PathListType.defaultEmpty - delimiter = KotlinCompilerArgument.Delimiter.Default lifecycle( introducedVersion = KotlinReleaseVersion.v1_2_70, diff --git a/compiler/build-tools/kotlin-build-tools-api-forward-compatibility-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt b/compiler/build-tools/kotlin-build-tools-api-forward-compatibility-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt index 825fd29c0ccf4..dd63f571349f7 100644 --- a/compiler/build-tools/kotlin-build-tools-api-forward-compatibility-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt +++ b/compiler/build-tools/kotlin-build-tools-api-forward-compatibility-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt @@ -151,7 +151,8 @@ private val jvmArgumentTestDescriptors: List> = lis testBaseDir.resolve("path/to/friend1").toFile().absolutePath, testBaseDir.resolve("path/to/friend2").toFile().absolutePath, testBaseDir.resolve("path/to/friend3").toFile().absolutePath, - ) + ), + arrayOf(testBaseDir.resolve("path/with,comma").toFile().absolutePath) ), argumentRawValues = listOf( arrayOf( @@ -160,7 +161,6 @@ private val jvmArgumentTestDescriptors: List> = lis testBaseDir.resolve("path/to/friend3").toFile().absolutePath, ).joinToString(",") ), - invalidArgumentValues = listOf(arrayOf(testBaseDir.resolve("path/with,comma").toFile().absolutePath)), valueString = { value -> value?.joinToString(",") }, expectedArgumentStringsFor = { value -> listOf("-Xfriend-paths=$value") }, ), @@ -288,7 +288,8 @@ private val jvmArgumentTestDescriptors: List> = lis testBaseDir.resolve("path/to/java/src1").toFile().absolutePath, testBaseDir.resolve("path/to/java/src2").toFile().absolutePath, testBaseDir.resolve("path/to/java/src3").toFile().absolutePath, - ) + ), + arrayOf(testBaseDir.resolve("path/with,comma").toFile().absolutePath) ), argumentRawValues = listOf( arrayOf( @@ -297,7 +298,6 @@ private val jvmArgumentTestDescriptors: List> = lis testBaseDir.resolve("path/to/java/src3").toFile().absolutePath, ).joinToString(",") ), - invalidArgumentValues = listOf(arrayOf(testBaseDir.resolve("path/with,comma").toFile().absolutePath)), valueString = { value -> value?.joinToString(",") }, expectedArgumentStringsFor = { value -> listOf("-Xjava-source-roots=$value") }, ), diff --git a/compiler/build-tools/kotlin-build-tools-api-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt b/compiler/build-tools/kotlin-build-tools-api-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt index 99f4996cf4723..eed751f3cd677 100644 --- a/compiler/build-tools/kotlin-build-tools-api-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt +++ b/compiler/build-tools/kotlin-build-tools-api-tests/src/testCompatibility/kotlin/arguments/model/jvm/JvmArgumentProviders.kt @@ -174,7 +174,8 @@ private val jvmCompilerArguments: List> = listOf( testBaseDir.resolve("path/to/friend1"), testBaseDir.resolve("path/to/friend2"), testBaseDir.resolve("path/to/friend3"), - ) + ), + listOf(testBaseDir.resolve("path/with,comma")) ), argumentRawValues = listOf( listOf( @@ -183,7 +184,6 @@ private val jvmCompilerArguments: List> = listOf( testBaseDir.resolve("path/to/friend3"), ).joinToString(","), ), - invalidArgumentValues = listOf(listOf(testBaseDir.resolve("path/with,comma"))), valueString = { value -> value?.joinToString(",") { it.toFile().absolutePath } }, expectedArgumentStringsFor = { value -> listOf("-Xfriend-paths=$value") }, ), @@ -307,6 +307,7 @@ private val jvmCompilerArguments: List> = listOf( testBaseDir.resolve("path/to/java/src2"), testBaseDir.resolve("path/to/java/src3"), ), + listOf(testBaseDir.resolve("path/with,comma")) ), argumentRawValues = listOf( listOf( @@ -315,7 +316,6 @@ private val jvmCompilerArguments: List> = listOf( testBaseDir.resolve("path/to/java/src3"), ).joinToString(",") { it.toFile().absolutePath } ), - invalidArgumentValues = listOf(listOf(testBaseDir.resolve("path/with,comma"))), valueString = { value -> value?.joinToString(",") { it.toFile().absolutePath } }, expectedArgumentStringsFor = { value -> listOf("-Xjava-source-roots=$value") }, ), diff --git a/compiler/build-tools/kotlin-build-tools-api/src/main/kotlin/org/jetbrains/kotlin/buildtools/api/internal/wrappers/KotlinWrapperPre2_4_20.kt b/compiler/build-tools/kotlin-build-tools-api/src/main/kotlin/org/jetbrains/kotlin/buildtools/api/internal/wrappers/KotlinWrapperPre2_4_20.kt index 7ef3efc9ac55b..6b4d0786dd248 100644 --- a/compiler/build-tools/kotlin-build-tools-api/src/main/kotlin/org/jetbrains/kotlin/buildtools/api/internal/wrappers/KotlinWrapperPre2_4_20.kt +++ b/compiler/build-tools/kotlin-build-tools-api/src/main/kotlin/org/jetbrains/kotlin/buildtools/api/internal/wrappers/KotlinWrapperPre2_4_20.kt @@ -100,14 +100,6 @@ internal class KotlinWrapperPre2_4_20( base[key] = value } - JvmCompilerArguments.X_FRIEND_PATHS, - JvmCompilerArguments.X_JAVA_SOURCE_ROOTS, - -> { - @Suppress("UNCHECKED_CAST") - (value as List).checkNoneContains(",") - base[key] = value - } - else -> base[key] = value } } diff --git a/compiler/build-tools/kotlin-build-tools-compat/gen/org/jetbrains/kotlin/buildtools/internal/compat/arguments/JvmCompilerArgumentsImpl.kt b/compiler/build-tools/kotlin-build-tools-compat/gen/org/jetbrains/kotlin/buildtools/internal/compat/arguments/JvmCompilerArgumentsImpl.kt index 3de2938175749..04c5c56650554 100644 --- a/compiler/build-tools/kotlin-build-tools-compat/gen/org/jetbrains/kotlin/buildtools/internal/compat/arguments/JvmCompilerArgumentsImpl.kt +++ b/compiler/build-tools/kotlin-build-tools-compat/gen/org/jetbrains/kotlin/buildtools/internal/compat/arguments/JvmCompilerArgumentsImpl.kt @@ -198,13 +198,13 @@ internal class JvmCompilerArgumentsImpl( if (X_EMIT_JVM_TYPE_ANNOTATIONS in this) { arguments.emitJvmTypeAnnotations = get(X_EMIT_JVM_TYPE_ANNOTATIONS)} if (X_ENHANCE_TYPE_PARAMETER_TYPES_TO_DEF_NOT_NULL in this) { arguments.enhanceTypeParameterTypesToDefNotNull = get(X_ENHANCE_TYPE_PARAMETER_TYPES_TO_DEF_NOT_NULL)} try { if (X_ENHANCED_COROUTINES_DEBUGGING in this) { arguments.enhancedCoroutinesDebugging = get(X_ENHANCED_COROUTINES_DEBUGGING)} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_ENHANCED_COROUTINES_DEBUGGING. Current compiler version is: $KC_VERSION, but the argument was introduced in 2.2.0""").initCause(e) } - if (X_FRIEND_PATHS in this) { arguments.friendPaths = get(X_FRIEND_PATHS).map { it.absolutePathStringOrThrow() }.also { list -> list.checkNoneContains(",") }.toTypedArray()} + if (X_FRIEND_PATHS in this) { arguments.friendPaths = get(X_FRIEND_PATHS).map { it.absolutePathStringOrThrow() }.toTypedArray()} if (X_GENERATE_STRICT_METADATA_VERSION in this) { arguments.strictMetadataVersionSemantics = get(X_GENERATE_STRICT_METADATA_VERSION)} try { if (X_INDY_ALLOW_ANNOTATED_LAMBDAS in this) { arguments.indyAllowAnnotatedLambdas = get(X_INDY_ALLOW_ANNOTATED_LAMBDAS)} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_INDY_ALLOW_ANNOTATED_LAMBDAS. Current compiler version is: $KC_VERSION, but the argument was introduced in 2.2.0""").initCause(e) } if (X_IR_DO_NOT_CLEAR_BINDING_CONTEXT in this) { arguments.doNotClearBindingContext = get(X_IR_DO_NOT_CLEAR_BINDING_CONTEXT)} try { if (X_IR_INLINER in this) { arguments.setUsingReflection("enableIrInliner", get(X_IR_INLINER))} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_IR_INLINER. Current compiler version is: $KC_VERSION, but the argument was removed in 2.3.0""").initCause(e) } if (X_JAVA_PACKAGE_PREFIX in this) { arguments.javaPackagePrefix = get(X_JAVA_PACKAGE_PREFIX)} - if (X_JAVA_SOURCE_ROOTS in this) { arguments.javaSourceRoots = get(X_JAVA_SOURCE_ROOTS).map { it.absolutePathStringOrThrow() }.also { list -> list.checkNoneContains(",") }.toTypedArray()} + if (X_JAVA_SOURCE_ROOTS in this) { arguments.javaSourceRoots = get(X_JAVA_SOURCE_ROOTS).map { it.absolutePathStringOrThrow() }.toTypedArray()} try { if (X_JAVAC_ARGUMENTS in this) { arguments.setUsingReflection("javacArguments", get(X_JAVAC_ARGUMENTS) ?: emptyArray())} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_JAVAC_ARGUMENTS. Current compiler version is: $KC_VERSION, but the argument was removed in 2.4.0""").initCause(e) } if (X_JDK_RELEASE in this) { arguments.jdkRelease = get(X_JDK_RELEASE)?.stringValue} if (X_JSPECIFY_ANNOTATIONS in this) { arguments.jspecifyAnnotations = get(X_JSPECIFY_ANNOTATIONS)?.stringValue} diff --git a/compiler/build-tools/kotlin-build-tools-impl/gen/org/jetbrains/kotlin/buildtools/internal/arguments/JvmCompilerArgumentsImpl.kt b/compiler/build-tools/kotlin-build-tools-impl/gen/org/jetbrains/kotlin/buildtools/internal/arguments/JvmCompilerArgumentsImpl.kt index dafc96ef35db3..ecaf7e80709cb 100644 --- a/compiler/build-tools/kotlin-build-tools-impl/gen/org/jetbrains/kotlin/buildtools/internal/arguments/JvmCompilerArgumentsImpl.kt +++ b/compiler/build-tools/kotlin-build-tools-impl/gen/org/jetbrains/kotlin/buildtools/internal/arguments/JvmCompilerArgumentsImpl.kt @@ -202,14 +202,14 @@ internal class JvmCompilerArgumentsImpl( if (X_EMIT_JVM_TYPE_ANNOTATIONS in this) { arguments.emitJvmTypeAnnotations = get(X_EMIT_JVM_TYPE_ANNOTATIONS)} if (X_ENHANCE_TYPE_PARAMETER_TYPES_TO_DEF_NOT_NULL in this) { arguments.enhanceTypeParameterTypesToDefNotNull = get(X_ENHANCE_TYPE_PARAMETER_TYPES_TO_DEF_NOT_NULL)} if (X_ENHANCED_COROUTINES_DEBUGGING in this) { arguments.enhancedCoroutinesDebugging = get(X_ENHANCED_COROUTINES_DEBUGGING)} - if (X_FRIEND_PATHS in this) { arguments.friendPaths = get(X_FRIEND_PATHS).map { it.absolutePathStringOrThrow() }.also { list -> list.checkNoneContains(",") }.toTypedArray()} + if (X_FRIEND_PATHS in this) { arguments.friendPaths = get(X_FRIEND_PATHS).map { it.absolutePathStringOrThrow() }.toTypedArray()} if (X_GENERATE_STRICT_METADATA_VERSION in this) { arguments.strictMetadataVersionSemantics = get(X_GENERATE_STRICT_METADATA_VERSION)} if (X_IGNORED_ANNOTATIONS_FOR_BRIDGES in this) { arguments.ignoredAnnotationsForBridges = get(X_IGNORED_ANNOTATIONS_FOR_BRIDGES).toTypedArray()} if (X_INDY_ALLOW_ANNOTATED_LAMBDAS in this) { arguments.indyAllowAnnotatedLambdas = get(X_INDY_ALLOW_ANNOTATED_LAMBDAS)} if (X_IR_DO_NOT_CLEAR_BINDING_CONTEXT in this) { arguments.doNotClearBindingContext = get(X_IR_DO_NOT_CLEAR_BINDING_CONTEXT)} try { if (X_IR_INLINER in this) { arguments.setUsingReflection("enableIrInliner", get(X_IR_INLINER))} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_IR_INLINER. Current compiler version is: $KC_VERSION, but the argument was removed in 2.3.0""").initCause(e) } if (X_JAVA_PACKAGE_PREFIX in this) { arguments.javaPackagePrefix = get(X_JAVA_PACKAGE_PREFIX)} - if (X_JAVA_SOURCE_ROOTS in this) { arguments.javaSourceRoots = get(X_JAVA_SOURCE_ROOTS).map { it.absolutePathStringOrThrow() }.also { list -> list.checkNoneContains(",") }.toTypedArray()} + if (X_JAVA_SOURCE_ROOTS in this) { arguments.javaSourceRoots = get(X_JAVA_SOURCE_ROOTS).map { it.absolutePathStringOrThrow() }.toTypedArray()} try { if (X_JAVAC_ARGUMENTS in this) { arguments.setUsingReflection("javacArguments", get(X_JAVAC_ARGUMENTS) ?: emptyArray())} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_JAVAC_ARGUMENTS. Current compiler version is: $KC_VERSION, but the argument was removed in 2.4.0""").initCause(e) } if (X_JDK_RELEASE in this) { arguments.jdkRelease = get(X_JDK_RELEASE)?.stringValue} if (X_JSPECIFY_ANNOTATIONS in this) { arguments.jspecifyAnnotations = get(X_JSPECIFY_ANNOTATIONS)?.stringValue} @@ -372,14 +372,14 @@ internal class JvmCompilerArgumentsImpl( if (X_EMIT_JVM_TYPE_ANNOTATIONS in this) { arguments.emitJvmTypeAnnotations = get(X_EMIT_JVM_TYPE_ANNOTATIONS)} if (X_ENHANCE_TYPE_PARAMETER_TYPES_TO_DEF_NOT_NULL in this) { arguments.enhanceTypeParameterTypesToDefNotNull = get(X_ENHANCE_TYPE_PARAMETER_TYPES_TO_DEF_NOT_NULL)} if (X_ENHANCED_COROUTINES_DEBUGGING in this) { arguments.enhancedCoroutinesDebugging = get(X_ENHANCED_COROUTINES_DEBUGGING)} - if (X_FRIEND_PATHS in this) { arguments.friendPaths = get(X_FRIEND_PATHS).map { it.absolutePathStringOrThrow() }.also { list -> list.checkNoneContains(",") }.toTypedArray()} + if (X_FRIEND_PATHS in this) { arguments.friendPaths = get(X_FRIEND_PATHS).map { it.absolutePathStringOrThrow() }.toTypedArray()} if (X_GENERATE_STRICT_METADATA_VERSION in this) { arguments.strictMetadataVersionSemantics = get(X_GENERATE_STRICT_METADATA_VERSION)} if (X_IGNORED_ANNOTATIONS_FOR_BRIDGES in this) { arguments.ignoredAnnotationsForBridges = get(X_IGNORED_ANNOTATIONS_FOR_BRIDGES).toTypedArray()} if (X_INDY_ALLOW_ANNOTATED_LAMBDAS in this) { arguments.indyAllowAnnotatedLambdas = get(X_INDY_ALLOW_ANNOTATED_LAMBDAS)} if (X_IR_DO_NOT_CLEAR_BINDING_CONTEXT in this) { arguments.doNotClearBindingContext = get(X_IR_DO_NOT_CLEAR_BINDING_CONTEXT)} try { if (X_IR_INLINER in this) { arguments.setUsingReflection("enableIrInliner", get(X_IR_INLINER))} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_IR_INLINER. Current compiler version is: $KC_VERSION, but the argument was removed in 2.3.0""").initCause(e) } if (X_JAVA_PACKAGE_PREFIX in this) { arguments.javaPackagePrefix = get(X_JAVA_PACKAGE_PREFIX)} - if (X_JAVA_SOURCE_ROOTS in this) { arguments.javaSourceRoots = get(X_JAVA_SOURCE_ROOTS).map { it.absolutePathStringOrThrow() }.also { list -> list.checkNoneContains(",") }.toTypedArray()} + if (X_JAVA_SOURCE_ROOTS in this) { arguments.javaSourceRoots = get(X_JAVA_SOURCE_ROOTS).map { it.absolutePathStringOrThrow() }.toTypedArray()} try { if (X_JAVAC_ARGUMENTS in this) { arguments.setUsingReflection("javacArguments", get(X_JAVAC_ARGUMENTS) ?: emptyArray())} } catch (e: NoSuchMethodError) { throw IllegalStateException("""Compiler parameter not recognized: X_JAVAC_ARGUMENTS. Current compiler version is: $KC_VERSION, but the argument was removed in 2.4.0""").initCause(e) } if (X_JDK_RELEASE in this) { arguments.jdkRelease = get(X_JDK_RELEASE)?.stringValue} if (X_JSPECIFY_ANNOTATIONS in this) { arguments.jspecifyAnnotations = get(X_JSPECIFY_ANNOTATIONS)?.stringValue} diff --git a/compiler/build-tools/kotlin-build-tools-impl/src/main/kotlin/org/jetbrains/kotlin/buildtools/internal/arguments/CompilerArgumentValueAdapter.kt b/compiler/build-tools/kotlin-build-tools-impl/src/main/kotlin/org/jetbrains/kotlin/buildtools/internal/arguments/CompilerArgumentValueAdapter.kt index 72fadd584667f..5fe6674046888 100644 --- a/compiler/build-tools/kotlin-build-tools-impl/src/main/kotlin/org/jetbrains/kotlin/buildtools/internal/arguments/CompilerArgumentValueAdapter.kt +++ b/compiler/build-tools/kotlin-build-tools-impl/src/main/kotlin/org/jetbrains/kotlin/buildtools/internal/arguments/CompilerArgumentValueAdapter.kt @@ -497,7 +497,7 @@ private object JvmCompilerArgumentPre2_4_0ValueAdapter : CommonCompilerArgumentP if (value == null) return emptyList() as T val arrayValue = value as Array - arrayValue.also { array -> array.asList().checkNoneContains(",") }.map { Path(it) } as T + arrayValue.map { Path(it) } as T } JvmCompilerArgumentsImpl.X_ADD_MODULES.id, diff --git a/compiler/cli/cli-base/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-base/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index 4fb322082ac60..ed6a9399c3f64 100644 --- a/compiler/cli/cli-base/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-base/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -178,7 +178,6 @@ inside suspend functions and lambdas to distinguish them from user code by debug value = "-Xfriend-paths", valueDescription = "", description = "Paths to output directories for friend modules (modules whose internals should be visible).", - delimiter = Argument.Delimiters.default, ) var friendPaths: Array = emptyArray() set(value) { @@ -241,7 +240,6 @@ inside suspend functions and lambdas to distinguish them from user code by debug value = "-Xjava-source-roots", valueDescription = "", description = "Paths to directories with Java source files.", - delimiter = Argument.Delimiters.default, ) var javaSourceRoots: Array = emptyArray() set(value) {