Skip to content

Commit d300e79

Browse files
Add -friend-modules support to JKlib entrypoint
1 parent 2acd62f commit d300e79

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JKlibCompilerArguments.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,17 @@ Modes:
249249
field = value
250250
}
251251

252+
@Argument(
253+
value = "-friend-modules",
254+
valueDescription = "<path>",
255+
description = "Paths to friend modules.",
256+
)
257+
var friendModules: String? = null
258+
set(value) {
259+
checkFrozen()
260+
field = if (value.isNullOrEmpty()) null else value
261+
}
262+
252263
override fun copyOf(): Freezable = TODO() // copyK2JKlibCompilerArguments(this, K2JKlibCompilerArguments())
253264

254265
override val configurator: CommonCompilerArgumentsConfigurator = K2JKlibCompilerArgumentsConfigurator()

compiler/cli/src/org/jetbrains/kotlin/cli/jklib/K2JKlibCompiler.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,7 @@ class K2JKlibCompiler : CLICompiler<K2JKlibCompilerArguments>() {
749749
dependencies(configuration.jvmClasspathRoots.map { it.absolutePath })
750750
dependencies(configuration.jvmModularRoots.map { it.absolutePath })
751751
dependencies(resolvedLibraries.map { it.library.libraryFile.absolutePath })
752-
friendDependencies(configuration[JVMConfigurationKeys.FRIEND_PATHS] ?: emptyList())
753-
friendDependencies(module.getFriendPaths())
752+
friendDependencies(arguments.friendModules?.split(File.pathSeparator) ?: emptyList())
754753
}
755754

756755
val librariesScope = projectEnvironment.getSearchScopeForProjectLibraries()

0 commit comments

Comments
 (0)