[K/N][Gradle] Use build service to read konan.properties
Also pass additionalCacheFlags when compiling compiler caches.
This commit is contained in:
committed by
TeamCityServer
parent
84e7b53926
commit
708931b404
@@ -69,13 +69,11 @@ class Distribution(
|
||||
result
|
||||
}
|
||||
|
||||
/**
|
||||
* Consider using [org.jetbrains.kotlin.gradle.targets.native.KonanPropertiesBuildService] in case of Gradle.
|
||||
*/
|
||||
val compilerVersion by lazy {
|
||||
val propertyVersion = properties["compilerVersion"]?.toString()
|
||||
val bundleVersion = if (konanHome.contains("-1"))
|
||||
konanHome.substring(konanHome.lastIndexOf("-1") + 1)
|
||||
else
|
||||
null
|
||||
propertyVersion ?: bundleVersion
|
||||
getCompilerVersion(properties["compilerVersion"]?.toString(), konanHome)
|
||||
}
|
||||
|
||||
val klib = "$konanHome/klib"
|
||||
@@ -98,6 +96,20 @@ class Distribution(
|
||||
override fun availableSubTarget(genericName: String) =
|
||||
additionalPropertyFiles(genericName).map { it.name }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Try to guess compiler version using [konanHome].
|
||||
*/
|
||||
private fun getBundleVersion(konanHome: String): String? =
|
||||
if (konanHome.contains("-1"))
|
||||
konanHome.substring(konanHome.lastIndexOf("-1") + 1)
|
||||
else
|
||||
null
|
||||
|
||||
fun getCompilerVersion(propertyVersion: String?, konanHome: String): String? =
|
||||
propertyVersion ?: getBundleVersion(konanHome)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Move into K/N?
|
||||
|
||||
Reference in New Issue
Block a user