[CLI] K2JVMCompilerArguments: Model modulePath as Array<String>

to allow interning individual file-path arguments on the IDE

KTIJ-24976
This commit is contained in:
Sebastian Sellmair
2023-04-03 09:29:25 +02:00
committed by Space Team
parent 9dcd40d7b7
commit fb66764c4d
5 changed files with 13 additions and 7 deletions
@@ -33,7 +33,7 @@ fun copyK2JVMCompilerArguments(from: K2JVMCompilerArguments, to: K2JVMCompilerAr
to.friendPaths = from.friendPaths?.copyOf()
to.includeRuntime = from.includeRuntime
to.inheritMultifileParts = from.inheritMultifileParts
to.javaModulePath = from.javaModulePath
to.javaModulePath = from.javaModulePath?.copyOf()
to.javaPackagePrefix = from.javaPackagePrefix
to.javaParameters = from.javaParameters
to.javaSourceRoots = from.javaSourceRoots?.copyOf()
@@ -210,8 +210,13 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
field = value
}
@Argument(value = "-Xmodule-path", valueDescription = "<path>", description = "Paths where to find Java 9+ modules")
var javaModulePath: String? = null
@Argument(
value = "-Xmodule-path",
valueDescription = "<path>",
description = "Paths where to find Java 9+ modules",
delimiter = Argument.Delimiters.pathSeparator
)
var javaModulePath: Array<String>? = null
set(value) {
checkFrozen()
field = if (value.isNullOrEmpty()) null else value
@@ -173,7 +173,7 @@ fun CompilerConfiguration.configureJdkHome(arguments: K2JVMCompilerArguments): B
}
fun CompilerConfiguration.configureJavaModulesContentRoots(arguments: K2JVMCompilerArguments) {
for (modularRoot in arguments.javaModulePath?.split(File.pathSeparatorChar).orEmpty()) {
for (modularRoot in arguments.javaModulePath.orEmpty()) {
add(CLIConfigurationKeys.CONTENT_ROOTS, JvmModulePathRoot(File(modularRoot)))
}
}