[K/N] Allow control of BundleShortVersionString and BundleVersion

Adding -Xbundle-version and -Xbundle-short-version-string
compiler arguments. These can be used in the freeCompilerArgs
in the gradle configuration to control the version strings
in the Info.plist in generated frameworks.

```
version = "1.0"

macosX64("native") {
    binaries.framework {
        compilation.kotlinOptions.freeCompilerArgs += "-Xbundle-version=$version"
    }
}
```

^KT-33117 Fixed.
This commit is contained in:
Mads Ager
2022-06-13 12:25:06 +02:00
committed by Space
parent fcdab3995a
commit c7e7080af6
5 changed files with 38 additions and 5 deletions
@@ -382,6 +382,8 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
})
putIfNotNull(RUNTIME_LOGS, arguments.runtimeLogs)
putIfNotNull(BUNDLE_ID, parseBundleId(arguments, outputKind, configuration))
putIfNotNull(BUNDLE_SHORT_VERSION_STRING, arguments.bundleShortVersionString)
putIfNotNull(BUNDLE_VERSION, arguments.bundleVersion)
put(MEANINGFUL_BRIDGE_NAMES, arguments.meaningfulBridgeNames)
arguments.testDumpOutputPath?.let { put(TEST_DUMP_OUTPUT_PATH, it) }
put(PARTIAL_LINKAGE, arguments.partialLinkage)
@@ -109,6 +109,20 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
)
var bundleId: String? = null
@Argument(
value = "-Xbundle-short-version-string",
valueDescription = "<short version string>",
description = "Bundle short version string to be set in Info.plist of a produced framework"
)
var bundleShortVersionString: String? = null
@Argument(
value = "-Xbundle-version",
valueDescription = "<version>",
description = "Bundle version to be set in Info.plist of a produced framework"
)
var bundleVersion: String? = null
@Argument(
value = "-Xcache-directory",
valueDescription = "<path>",