[K/N] Add an option to specify a bundle ID of a produced framework
This commit is contained in:
@@ -380,6 +380,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
}
|
||||
})
|
||||
putIfNotNull(RUNTIME_LOGS, arguments.runtimeLogs)
|
||||
putIfNotNull(BUNDLE_ID, parseBundleId(arguments, outputKind, configuration))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -642,7 +643,20 @@ private fun parseKeyValuePairs(
|
||||
}
|
||||
}?.toMap()
|
||||
|
||||
|
||||
private fun parseBundleId(
|
||||
arguments: K2NativeCompilerArguments,
|
||||
outputKind: CompilerOutputKind,
|
||||
configuration: CompilerConfiguration
|
||||
): String? {
|
||||
val argumentValue = arguments.bundleId
|
||||
return if (argumentValue != null && outputKind != CompilerOutputKind.FRAMEWORK) {
|
||||
configuration.report(STRONG_WARNING, "Setting a bundle ID is only supported when producing a framework " +
|
||||
"but the compiler is producing ${outputKind.name.lowercase()}")
|
||||
null
|
||||
} else {
|
||||
argumentValue
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) = K2Native.main(args)
|
||||
fun mainNoExitWithGradleRenderer(args: Array<String>) = K2Native.mainNoExitWithGradleRenderer(args)
|
||||
|
||||
+7
@@ -102,6 +102,13 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
// Make sure to prepend them with -X.
|
||||
// Keep the list lexically sorted.
|
||||
|
||||
@Argument(
|
||||
value = "-Xbundle-id",
|
||||
valueDescription = "<id>",
|
||||
description = "Bundle ID to be set in Info.plist of a produced framework"
|
||||
)
|
||||
var bundleId: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-Xcache-directory",
|
||||
valueDescription = "<path>",
|
||||
|
||||
Reference in New Issue
Block a user