Interop: Support setting custom unique name for interop libs
This commit is contained in:
committed by
Ilya Matveev
parent
ce1cb39c41
commit
ffe8ce5524
+5
@@ -114,6 +114,11 @@ open class CInteropArguments(argParser: ArgParser =
|
|||||||
fullName = SHORT_MODULE_NAME,
|
fullName = SHORT_MODULE_NAME,
|
||||||
description = "A short name used to denote this library in the IDE and during Objective-C export"
|
description = "A short name used to denote this library in the IDE and during Objective-C export"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val moduleName by argParser.option(ArgType.String,
|
||||||
|
fullName = "Xmodule-name",
|
||||||
|
description = "A full name of the library used for dependency resolution"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class JSInteropArguments(argParser: ArgParser = ArgParser("jsinterop",
|
class JSInteropArguments(argParser: ArgParser = ArgParser("jsinterop",
|
||||||
|
|||||||
+2
-1
@@ -273,7 +273,8 @@ private fun processCLib(flavorName: String, cinteropArguments: CInteropArguments
|
|||||||
}
|
}
|
||||||
|
|
||||||
val klibSuffix = CompilerOutputKind.LIBRARY.suffix(target)
|
val klibSuffix = CompilerOutputKind.LIBRARY.suffix(target)
|
||||||
val moduleName = File(cinteropArguments.output).name.removeSuffixIfPresent(klibSuffix)
|
val moduleName = cinteropArguments.moduleName
|
||||||
|
?: File(cinteropArguments.output).name.removeSuffixIfPresent(klibSuffix)
|
||||||
|
|
||||||
val configuration = InteropConfiguration(
|
val configuration = InteropConfiguration(
|
||||||
library = compilation,
|
library = compilation,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ fun invokeInterop(flavor: String, args: Array<String>): Array<String>? {
|
|||||||
val purgeUserLibs = arguments.purgeUserLibs
|
val purgeUserLibs = arguments.purgeUserLibs
|
||||||
val nopack = arguments.nopack
|
val nopack = arguments.nopack
|
||||||
val temporaryFilesDir = arguments.tempDir
|
val temporaryFilesDir = arguments.tempDir
|
||||||
|
val moduleName = (arguments as? CInteropArguments)?.moduleName
|
||||||
val shortModuleName = (arguments as? CInteropArguments)?.shortModuleName
|
val shortModuleName = (arguments as? CInteropArguments)?.shortModuleName
|
||||||
|
|
||||||
val buildDir = File("$outputFileName-build")
|
val buildDir = File("$outputFileName-build")
|
||||||
@@ -67,6 +68,7 @@ fun invokeInterop(flavor: String, args: Array<String>): Array<String>? {
|
|||||||
(if (noEndorsedLibs) arrayOf("-$NOENDORSEDLIBS") else emptyArray()) +
|
(if (noEndorsedLibs) arrayOf("-$NOENDORSEDLIBS") else emptyArray()) +
|
||||||
(if (purgeUserLibs) arrayOf("-$PURGE_USER_LIBS") else emptyArray()) +
|
(if (purgeUserLibs) arrayOf("-$PURGE_USER_LIBS") else emptyArray()) +
|
||||||
(if (nopack) arrayOf("-$NOPACK") else emptyArray()) +
|
(if (nopack) arrayOf("-$NOPACK") else emptyArray()) +
|
||||||
|
moduleName?.let { arrayOf("-module-name", it) }.orEmpty() +
|
||||||
shortModuleName?.let { arrayOf("-Xshort-module-name=$it") }.orEmpty() +
|
shortModuleName?.let { arrayOf("-Xshort-module-name=$it") }.orEmpty() +
|
||||||
arguments.kotlincOption
|
arguments.kotlincOption
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user