[K/N][gradle] Set klib version from gradle

This commit is contained in:
Igor Chevdar
2022-11-25 12:51:42 +02:00
committed by Space Team
parent 9c86532eb0
commit 73e10b17c6
6 changed files with 22 additions and 1 deletions
@@ -28,6 +28,7 @@ internal class SharedCompilationData(
val refinesPaths: FileCollection
)
@Suppress("UNUSED_PARAMETER")
internal fun buildKotlinNativeKlibCompilerArgs(
outFile: File,
optimized: Boolean,
@@ -43,6 +44,7 @@ internal fun buildKotlinNativeKlibCompilerArgs(
moduleName: String,
shortModuleName: String,
friendModule: FileCollection,
libraryVersion: String,
sharedCompilationData: SharedCompilationData?,
source: FileTree,
commonSourcesTree: FileTree
@@ -65,6 +67,9 @@ internal fun buildKotlinNativeKlibCompilerArgs(
addArg("-friend-modules", friends.joinToString(File.pathSeparator) { it.absolutePath })
}
// TODO: uncomment after advancing bootstrap.
//add("-library-version=libraryVersion")
if (sharedCompilationData != null) {
val refinesPaths = sharedCompilationData.refinesPaths.files
if (refinesPaths.isNotEmpty()) {
@@ -231,6 +231,9 @@ abstract class AbstractKotlinNativeCompile<
val kotlinNativeVersion: String
get() = project.konanVersion.toString()
@get:Input
val artifactVersion = project.version.toString()
@get:Input
internal val useEmbeddableCompilerJar: Boolean
get() = project.nativeUseEmbeddableCompilerJar
@@ -487,6 +490,7 @@ internal constructor(
moduleName,
shortModuleName,
friendModule,
artifactVersion,
createSharedCompilationDataOrNull(),
sources.asFileTree,
commonSourcesTree
@@ -987,6 +991,10 @@ open class CInteropProcess @Inject internal constructor(params: Params) : Defaul
@get:Input
val konanVersion: CompilerVersion = project.konanVersion
@Suppress("unused")
@get:Input
val libraryVersion = project.version.toString()
@Suppress("unused")
@get:Input
val interopName: String = params.settings.name
@@ -1089,6 +1097,9 @@ open class CInteropProcess @Inject internal constructor(params: Params) : Defaul
addArg("-Xmodule-name", moduleName)
}
// TODO: uncomment after advancing bootstrap.
//addArg("-libraryVersion", libraryVersion)
addAll(extraOpts)
}