Fixed konan.data.dir with caches
Removed TODOs after updating to kotlin bootstrap version with konan.data.dir gradle property changes Fixed warning of incorrect passing -Xkonan-data-dir arg in konanc from KGP and fixed setting konan-data-dir in SetupConfiguration#setupCommonOptionsForCaches #KT-60660 Fixed Merge-request: KT-MR-11299 Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
e8905ea849
commit
ade88e2b0f
+1
@@ -324,6 +324,7 @@ internal fun CompilerConfiguration.setupCommonOptionsForCaches(konanConfig: Kona
|
|||||||
put(BinaryOptions.runtimeAssertionsMode, konanConfig.runtimeAssertsMode)
|
put(BinaryOptions.runtimeAssertionsMode, konanConfig.runtimeAssertsMode)
|
||||||
put(LAZY_IR_FOR_CACHES, konanConfig.lazyIrForCaches)
|
put(LAZY_IR_FOR_CACHES, konanConfig.lazyIrForCaches)
|
||||||
put(CommonConfigurationKeys.PARALLEL_BACKEND_THREADS, konanConfig.threadsCount)
|
put(CommonConfigurationKeys.PARALLEL_BACKEND_THREADS, konanConfig.threadsCount)
|
||||||
|
putIfNotNull(KONAN_DATA_DIR, konanConfig.distribution.localKonanDir.absolutePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Array<String>?.toNonNullList() = this?.asList().orEmpty()
|
private fun Array<String>?.toNonNullList() = this?.asList().orEmpty()
|
||||||
|
|||||||
@@ -54,14 +54,10 @@ apply plugin: "kotlin.native.build-tools-conventions"
|
|||||||
|
|
||||||
ext {
|
ext {
|
||||||
distDir = UtilsKt.getKotlinNativeDist(project)
|
distDir = UtilsKt.getKotlinNativeDist(project)
|
||||||
// TODO(Dmitrii Krasnov): remove else branch after KT-50463 will be in current bootstrap
|
def konanDataDir = project.hasProperty('konan.data.dir') ? project.property('konan.data.dir').toString() : null
|
||||||
def konanDataDir = project.findProperty('konan.data.dir')
|
dependenciesDir = DependencyDirectories.INSTANCE.getDependenciesRoot(konanDataDir)
|
||||||
dependenciesDir = konanDataDir != null ?
|
|
||||||
DependencyDirectories.INSTANCE.getDependenciesRoot(konanDataDir.toString())
|
|
||||||
: DependencyDirectories.defaultDependenciesRoot
|
|
||||||
experimentalEnabled = project.hasProperty("org.jetbrains.kotlin.native.experimentalTargets")
|
experimentalEnabled = project.hasProperty("org.jetbrains.kotlin.native.experimentalTargets")
|
||||||
// TODO(Dmitrii Krasnov): add konanDataDir to the buildDistribution after KT-50463 will be in current bootstrap
|
platformManager = new PlatformManager(DistributionKt.buildDistribution(projectDir.absolutePath, konanDataDir),
|
||||||
platformManager = new PlatformManager(DistributionKt.buildDistribution(projectDir.absolutePath),
|
|
||||||
ext.experimentalEnabled)
|
ext.experimentalEnabled)
|
||||||
|
|
||||||
cacheableTargetNames = platformManager.hostPlatform.cacheableTargets
|
cacheableTargetNames = platformManager.hostPlatform.cacheableTargets
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ object KlibToolLogger : Logger, IrMessageLogger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(Dmitrii Krasnov): I'm not sure that we should put konan distribution dir here
|
|
||||||
val defaultRepository = File(DependencyDirectories.localKonanDir.resolve("klib").absolutePath)
|
val defaultRepository = File(DependencyDirectories.localKonanDir.resolve("klib").absolutePath)
|
||||||
|
|
||||||
open class ModuleDeserializer(val library: ByteArray) {
|
open class ModuleDeserializer(val library: ByteArray) {
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ project.logger.info("kotlin_root: $kotlin_root")
|
|||||||
globalProperties.load(new java.io.FileReader(project.file("$kotlin_root/gradle.properties")))
|
globalProperties.load(new java.io.FileReader(project.file("$kotlin_root/gradle.properties")))
|
||||||
ext.kotlinNativeVersionInResources = true
|
ext.kotlinNativeVersionInResources = true
|
||||||
|
|
||||||
// TODO(Dmitrii Krasnov): add konanDataDir to the buildDistribution after KT-50463 will be in current bootstrap
|
def konanDataDir = project.hasProperty('konan.data.dir') ? project.property('konan.data.dir').toString() : null
|
||||||
def platformManager = new PlatformManager(DistributionKt.buildDistribution(UtilsKt.getKotlinNativeDist(project).path), false)
|
def platformManager = new PlatformManager(DistributionKt.buildDistribution(UtilsKt.getKotlinNativeDist(project).path, konanDataDir), false)
|
||||||
def kotlinDist = null
|
def kotlinDist = null
|
||||||
if (hasProperty("kotlin_dist")) {
|
if (hasProperty("kotlin_dist")) {
|
||||||
kotlinDist = file(findProperty("kotlin_dist"))
|
kotlinDist = file(findProperty("kotlin_dist"))
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ plugins {
|
|||||||
val toolsPath = "../../tools"
|
val toolsPath = "../../tools"
|
||||||
val targetExtension = "Macos"
|
val targetExtension = "Macos"
|
||||||
|
|
||||||
// TODO: add konanDataDir to the buildDistribution after KT-50463 will be in current bootstrap
|
val konanDataDir = if (project.hasProperty("konan.data.dir")) project.property("konan.data.dir").toString() else null
|
||||||
project.extra["platformManager"] = PlatformManager(buildDistribution(projectDir.parentFile.parentFile.absolutePath), false)
|
project.extra["platformManager"] = PlatformManager(buildDistribution(projectDir.parentFile.parentFile.absolutePath, konanDataDir), false)
|
||||||
swiftBenchmark {
|
swiftBenchmark {
|
||||||
applicationName = "swiftInterop"
|
applicationName = "swiftInterop"
|
||||||
commonSrcDirs = listOf("$toolsPath/benchmarks/shared/src/main/kotlin/report", "src", "../shared/src/main/kotlin")
|
commonSrcDirs = listOf("$toolsPath/benchmarks/shared/src/main/kotlin/report", "src", "../shared/src/main/kotlin")
|
||||||
|
|||||||
+17
-12
@@ -31,7 +31,8 @@ private val Project.jvmArgs
|
|||||||
get() = PropertiesProvider(this).nativeJvmArgs?.split("\\s+".toRegex()).orEmpty()
|
get() = PropertiesProvider(this).nativeJvmArgs?.split("\\s+".toRegex()).orEmpty()
|
||||||
|
|
||||||
internal val Project.konanHome: String
|
internal val Project.konanHome: String
|
||||||
get() = PropertiesProvider(this).nativeHome?.let { file(it).absolutePath }
|
get() = PropertiesProvider(this).konanDataDir?.let { NativeCompilerDownloader(project).compilerDirectory.absolutePath }
|
||||||
|
?: PropertiesProvider(this).nativeHome?.let { file(it).absolutePath }
|
||||||
?: NativeCompilerDownloader(project).compilerDirectory.absolutePath
|
?: NativeCompilerDownloader(project).compilerDirectory.absolutePath
|
||||||
|
|
||||||
internal val Project.disableKonanDaemon: Boolean
|
internal val Project.disableKonanDaemon: Boolean
|
||||||
@@ -90,14 +91,14 @@ internal abstract class KotlinNativeToolRunner(
|
|||||||
val konanDataDir: String?,
|
val konanDataDir: String?,
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
fun fromProject(project: Project) = Settings(
|
fun of(konanHome: String, konanDataDir: String?, project: Project) = Settings(
|
||||||
konanVersion = project.konanVersion,
|
konanVersion = project.konanVersion,
|
||||||
konanHome = project.konanHome,
|
konanHome = konanHome,
|
||||||
konanPropertiesFile = project.file("${project.konanHome}/konan/konan.properties"),
|
konanPropertiesFile = project.file("${konanHome}/konan/konan.properties"),
|
||||||
useXcodeMessageStyle = project.useXcodeMessageStyle,
|
useXcodeMessageStyle = project.useXcodeMessageStyle,
|
||||||
jvmArgs = project.jvmArgs,
|
jvmArgs = project.jvmArgs,
|
||||||
classpath = project.files(project.kotlinNativeCompilerJar, "${project.konanHome}/konan/lib/trove4j.jar"),
|
classpath = project.files(project.kotlinNativeCompilerJar, "${konanHome}/konan/lib/trove4j.jar"),
|
||||||
konanDataDir = project.konanDataDir
|
konanDataDir = konanDataDir
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,15 +147,15 @@ internal abstract class KotlinNativeToolRunner(
|
|||||||
super.run(args + extractArgsFromSettings())
|
super.run(args + extractArgsFromSettings())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun extractArgsFromSettings(): List<String> {
|
protected open fun extractArgsFromSettings(): List<String> {
|
||||||
return settings.konanDataDir?.let { listOf("-Xkonan-data-dir", it) } ?: emptyList()
|
return settings.konanDataDir?.let { listOf("-Xkonan-data-dir=$it") } ?: emptyList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A common ancestor for all runners that run the cinterop tool. */
|
/** A common ancestor for all runners that run the cinterop tool. */
|
||||||
internal abstract class AbstractKotlinNativeCInteropRunner(
|
internal abstract class AbstractKotlinNativeCInteropRunner(
|
||||||
toolName: String,
|
toolName: String,
|
||||||
settings: Settings,
|
private val settings: Settings,
|
||||||
executionContext: GradleExecutionContext,
|
executionContext: GradleExecutionContext,
|
||||||
metricsReporter: BuildMetricsReporter<GradleBuildTime, GradleBuildPerformanceMetric>
|
metricsReporter: BuildMetricsReporter<GradleBuildTime, GradleBuildPerformanceMetric>
|
||||||
) : KotlinNativeToolRunner(toolName, settings, executionContext, metricsReporter) {
|
) : KotlinNativeToolRunner(toolName, settings, executionContext, metricsReporter) {
|
||||||
@@ -171,6 +172,10 @@ internal abstract class AbstractKotlinNativeCInteropRunner(
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun extractArgsFromSettings(): List<String> {
|
||||||
|
return settings.konanDataDir?.let { listOf("-Xkonan-data-dir", it) } ?: emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
private val llvmExecutablesPath: String? by lazy {
|
private val llvmExecutablesPath: String? by lazy {
|
||||||
if (HostManager.host == KonanTarget.MINGW_X64) {
|
if (HostManager.host == KonanTarget.MINGW_X64) {
|
||||||
// TODO: Read it from Platform properties when it is accessible.
|
// TODO: Read it from Platform properties when it is accessible.
|
||||||
@@ -222,8 +227,8 @@ internal class KotlinNativeCompilerRunner(
|
|||||||
val disableKonanDaemon: Boolean,
|
val disableKonanDaemon: Boolean,
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
fun fromProject(project: Project) = Settings(
|
fun of(konanHome: String, konanDataDir: String?, project: Project) = Settings(
|
||||||
parent = KotlinNativeToolRunner.Settings.fromProject(project),
|
parent = KotlinNativeToolRunner.Settings.of(konanHome, konanDataDir, project),
|
||||||
disableKonanDaemon = project.disableKonanDaemon,
|
disableKonanDaemon = project.disableKonanDaemon,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -260,7 +265,7 @@ internal class KotlinNativeLibraryGenerationRunner(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun fromProject(project: Project) = KotlinNativeLibraryGenerationRunner(
|
fun fromProject(project: Project) = KotlinNativeLibraryGenerationRunner(
|
||||||
settings = Settings.fromProject(project),
|
settings = Settings.of(project.konanHome, project.konanDataDir, project),
|
||||||
executionContext = GradleExecutionContext.fromProject(project),
|
executionContext = GradleExecutionContext.fromProject(project),
|
||||||
metricsReporter = GradleBuildMetricsReporter()
|
metricsReporter = GradleBuildMetricsReporter()
|
||||||
)
|
)
|
||||||
|
|||||||
+3
-4
@@ -14,6 +14,7 @@ import org.gradle.api.logging.Logger
|
|||||||
import org.gradle.api.provider.ValueSource
|
import org.gradle.api.provider.ValueSource
|
||||||
import org.gradle.api.provider.ValueSourceParameters
|
import org.gradle.api.provider.ValueSourceParameters
|
||||||
import org.jetbrains.kotlin.compilerRunner.KotlinNativeToolRunner
|
import org.jetbrains.kotlin.compilerRunner.KotlinNativeToolRunner
|
||||||
|
import org.jetbrains.kotlin.compilerRunner.konanDataDir
|
||||||
import org.jetbrains.kotlin.compilerRunner.konanHome
|
import org.jetbrains.kotlin.compilerRunner.konanHome
|
||||||
import org.jetbrains.kotlin.compilerRunner.konanVersion
|
import org.jetbrains.kotlin.compilerRunner.konanVersion
|
||||||
import org.jetbrains.kotlin.gradle.logging.kotlinInfo
|
import org.jetbrains.kotlin.gradle.logging.kotlinInfo
|
||||||
@@ -48,7 +49,7 @@ class NativeCompilerDownloader(
|
|||||||
|
|
||||||
val compilerDirectory: File
|
val compilerDirectory: File
|
||||||
get() = DependencyDirectories
|
get() = DependencyDirectories
|
||||||
.getLocalKonanDir(project.kotlinPropertiesProvider.konanDataDir)
|
.getLocalKonanDir(project.konanDataDir)
|
||||||
.resolve(dependencyNameWithOsAndVersion)
|
.resolve(dependencyNameWithOsAndVersion)
|
||||||
|
|
||||||
private val logger: Logger
|
private val logger: Logger
|
||||||
@@ -200,7 +201,7 @@ class NativeCompilerDownloader(
|
|||||||
|
|
||||||
private fun checkClassPath() {
|
private fun checkClassPath() {
|
||||||
project.providers.of(NativeCompilerDownloaderClassPathChecker::class.java) {
|
project.providers.of(NativeCompilerDownloaderClassPathChecker::class.java) {
|
||||||
it.parameters.classPath.setFrom(KotlinNativeToolRunner.Settings.fromProject(project).classpath)
|
it.parameters.classPath.setFrom(KotlinNativeToolRunner.Settings.of(project.konanHome, project.konanDataDir, project).classpath)
|
||||||
}.usedAtConfigurationTime(project.configurationTimePropertiesAccessor).get()
|
}.usedAtConfigurationTime(project.configurationTimePropertiesAccessor).get()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +229,6 @@ internal fun Project.setupNativeCompiler(konanTarget: KonanTarget) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downloader.downloadIfNeeded()
|
downloader.downloadIfNeeded()
|
||||||
|
|
||||||
logger.info("Kotlin/Native distribution: $konanHome")
|
logger.info("Kotlin/Native distribution: $konanHome")
|
||||||
} else {
|
} else {
|
||||||
logger.info("User-provided Kotlin/Native distribution: $konanHome")
|
logger.info("User-provided Kotlin/Native distribution: $konanHome")
|
||||||
@@ -239,4 +239,3 @@ internal fun Project.setupNativeCompiler(konanTarget: KonanTarget) {
|
|||||||
PlatformLibrariesGenerator(project, konanTarget).generatePlatformLibsIfNeeded()
|
PlatformLibrariesGenerator(project, konanTarget).generatePlatformLibsIfNeeded()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -63,7 +63,13 @@ constructor(
|
|||||||
val compilation: KotlinNativeCompilation
|
val compilation: KotlinNativeCompilation
|
||||||
get() = binary.compilation
|
get() = binary.compilation
|
||||||
|
|
||||||
private val runnerSettings = KotlinNativeCompilerRunner.Settings.fromProject(project)
|
@get:Internal
|
||||||
|
val konanDataDir: Provider<String?> = project.provider { project.konanDataDir }
|
||||||
|
|
||||||
|
@get:Internal
|
||||||
|
val konanHome: Provider<String> = project.provider { project.konanHome }
|
||||||
|
|
||||||
|
private val runnerSettings = KotlinNativeCompilerRunner.Settings.of(konanHome.get(), konanDataDir.getOrNull(), project)
|
||||||
|
|
||||||
final override val toolOptions: KotlinCommonCompilerToolOptions = objectFactory
|
final override val toolOptions: KotlinCommonCompilerToolOptions = objectFactory
|
||||||
.newInstance<KotlinCommonCompilerToolOptionsDefault>()
|
.newInstance<KotlinCommonCompilerToolOptionsDefault>()
|
||||||
@@ -205,7 +211,7 @@ constructor(
|
|||||||
private val externalDependenciesArgs by lazy { ExternalDependenciesBuilder(project, compilation).buildCompilerArgs() }
|
private val externalDependenciesArgs by lazy { ExternalDependenciesBuilder(project, compilation).buildCompilerArgs() }
|
||||||
|
|
||||||
private val cacheBuilderSettings by lazy {
|
private val cacheBuilderSettings by lazy {
|
||||||
CacheBuilder.Settings.createWithProject(project, binary, konanTarget, toolOptions, externalDependenciesArgs)
|
CacheBuilder.Settings.createWithProject(konanHome.get(), konanDataDir.getOrNull(), project, binary, konanTarget, toolOptions, externalDependenciesArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
private class CacheSettings(val orchestration: NativeCacheOrchestration, val kind: NativeCacheKind,
|
private class CacheSettings(val orchestration: NativeCacheOrchestration, val kind: NativeCacheKind,
|
||||||
|
|||||||
+15
-6
@@ -358,9 +358,11 @@ internal constructor(
|
|||||||
@get:Internal // these sources are normally a subset of `source` ones which are already tracked
|
@get:Internal // these sources are normally a subset of `source` ones which are already tracked
|
||||||
val commonSources: ConfigurableFileCollection = project.files()
|
val commonSources: ConfigurableFileCollection = project.files()
|
||||||
|
|
||||||
@Optional
|
@get:Internal
|
||||||
@get:Input
|
val konanDataDir: Provider<String?> = project.provider { project.konanDataDir }
|
||||||
val konanDataDir: String? = project.konanDataDir
|
|
||||||
|
@get:Internal
|
||||||
|
val konanHome: Provider<String> = project.provider { project.konanHome }
|
||||||
|
|
||||||
@get:Nested
|
@get:Nested
|
||||||
override val multiplatformStructure: K2MultiplatformStructure = objectFactory.newInstance()
|
override val multiplatformStructure: K2MultiplatformStructure = objectFactory.newInstance()
|
||||||
@@ -430,7 +432,7 @@ internal constructor(
|
|||||||
override val additionalCompilerOptions: Provider<Collection<String>>
|
override val additionalCompilerOptions: Provider<Collection<String>>
|
||||||
get() = compilerOptions.freeCompilerArgs as Provider<Collection<String>>
|
get() = compilerOptions.freeCompilerArgs as Provider<Collection<String>>
|
||||||
|
|
||||||
private val runnerSettings = KotlinNativeCompilerRunner.Settings.fromProject(project)
|
private val runnerSettings = KotlinNativeCompilerRunner.Settings.of(konanHome.get(), konanDataDir.getOrNull(), project)
|
||||||
// endregion.
|
// endregion.
|
||||||
|
|
||||||
@Suppress("DeprecatedCallableAddReplaceWith")
|
@Suppress("DeprecatedCallableAddReplaceWith")
|
||||||
@@ -759,6 +761,8 @@ internal class CacheBuilder(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun createWithProject(
|
fun createWithProject(
|
||||||
|
konanHome: String,
|
||||||
|
konanDataDir: String?,
|
||||||
project: Project,
|
project: Project,
|
||||||
binary: NativeBinary,
|
binary: NativeBinary,
|
||||||
konanTarget: KonanTarget,
|
konanTarget: KonanTarget,
|
||||||
@@ -767,7 +771,7 @@ internal class CacheBuilder(
|
|||||||
): Settings {
|
): Settings {
|
||||||
val konanCacheKind = project.getKonanCacheKind(konanTarget)
|
val konanCacheKind = project.getKonanCacheKind(konanTarget)
|
||||||
return Settings(
|
return Settings(
|
||||||
runnerSettings = KotlinNativeCompilerRunner.Settings.fromProject(project),
|
runnerSettings = KotlinNativeCompilerRunner.Settings.of(konanHome, konanDataDir, project),
|
||||||
konanCacheKind = konanCacheKind,
|
konanCacheKind = konanCacheKind,
|
||||||
libraries = binary.compilation.compileDependencyFiles,
|
libraries = binary.compilation.compileDependencyFiles,
|
||||||
gradleUserHomeDir = project.gradle.gradleUserHomeDir,
|
gradleUserHomeDir = project.gradle.gradleUserHomeDir,
|
||||||
@@ -1074,8 +1078,13 @@ abstract class CInteropProcess @Inject internal constructor(params: Params) :
|
|||||||
val outputFile: File
|
val outputFile: File
|
||||||
get() = outputFileProvider.get()
|
get() = outputFileProvider.get()
|
||||||
|
|
||||||
private val runnerSettings = KotlinNativeToolRunner.Settings.fromProject(project)
|
@get:Internal
|
||||||
|
val konanDataDir: Provider<String?> = project.provider { project.konanDataDir }
|
||||||
|
|
||||||
|
@get:Internal
|
||||||
|
val konanHome: Provider<String> = project.provider { project.konanHome }
|
||||||
|
|
||||||
|
private val runnerSettings = KotlinNativeToolRunner.Settings.of(konanHome.get(), konanDataDir.getOrNull(), project)
|
||||||
// Inputs and outputs.
|
// Inputs and outputs.
|
||||||
|
|
||||||
@OutputFile
|
@OutputFile
|
||||||
|
|||||||
+9
-1
@@ -25,6 +25,8 @@ import org.jetbrains.kotlin.build.report.metrics.GradleBuildPerformanceMetric
|
|||||||
import org.jetbrains.kotlin.build.report.metrics.GradleBuildTime
|
import org.jetbrains.kotlin.build.report.metrics.GradleBuildTime
|
||||||
import org.jetbrains.kotlin.compilerRunner.KotlinNativeCompilerRunner
|
import org.jetbrains.kotlin.compilerRunner.KotlinNativeCompilerRunner
|
||||||
import org.jetbrains.kotlin.compilerRunner.KotlinToolRunner
|
import org.jetbrains.kotlin.compilerRunner.KotlinToolRunner
|
||||||
|
import org.jetbrains.kotlin.compilerRunner.konanDataDir
|
||||||
|
import org.jetbrains.kotlin.compilerRunner.konanHome
|
||||||
import org.jetbrains.kotlin.compilerRunner.addBuildMetricsForTaskAction
|
import org.jetbrains.kotlin.compilerRunner.addBuildMetricsForTaskAction
|
||||||
import org.jetbrains.kotlin.gradle.dsl.*
|
import org.jetbrains.kotlin.gradle.dsl.*
|
||||||
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
|
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
|
||||||
@@ -175,7 +177,13 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
|||||||
val metrics: Property<BuildMetricsReporter<GradleBuildTime, GradleBuildPerformanceMetric>> = project.objects
|
val metrics: Property<BuildMetricsReporter<GradleBuildTime, GradleBuildPerformanceMetric>> = project.objects
|
||||||
.property(GradleBuildMetricsReporter())
|
.property(GradleBuildMetricsReporter())
|
||||||
|
|
||||||
private val runnerSettings = KotlinNativeCompilerRunner.Settings.fromProject(project)
|
@get:Internal
|
||||||
|
val konanDataDir: Provider<String?> = project.provider { project.konanDataDir }
|
||||||
|
|
||||||
|
@get:Internal
|
||||||
|
val konanHome: Provider<String> = project.provider { project.konanHome }
|
||||||
|
|
||||||
|
private val runnerSettings = KotlinNativeCompilerRunner.Settings.of(konanHome.get(), konanDataDir.getOrNull(),project)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
baseName.convention(project.name)
|
baseName.convention(project.name)
|
||||||
|
|||||||
@@ -20,15 +20,6 @@ class Distribution private constructor(private val serialized: Serialized) : jav
|
|||||||
konanDataDir: String? = null
|
konanDataDir: String? = null
|
||||||
) : this(Serialized(konanHome, onlyDefaultProfiles, runtimeFileOverride, propertyOverrides, konanDataDir))
|
) : this(Serialized(konanHome, onlyDefaultProfiles, runtimeFileOverride, propertyOverrides, konanDataDir))
|
||||||
|
|
||||||
// TODO: Remove after KT-50463 will be in current bootstrap
|
|
||||||
@Deprecated("Binary compatibility until bootstrap with KT-50463", level = DeprecationLevel.HIDDEN)
|
|
||||||
constructor(
|
|
||||||
konanHome: String,
|
|
||||||
onlyDefaultProfiles: Boolean = false,
|
|
||||||
runtimeFileOverride: String? = null,
|
|
||||||
propertyOverrides: Map<String, String>? = null,
|
|
||||||
) : this(Serialized(konanHome, onlyDefaultProfiles, runtimeFileOverride, propertyOverrides, null))
|
|
||||||
|
|
||||||
val konanHome by serialized::konanHome
|
val konanHome by serialized::konanHome
|
||||||
private val onlyDefaultProfiles by serialized::onlyDefaultProfiles
|
private val onlyDefaultProfiles by serialized::onlyDefaultProfiles
|
||||||
private val runtimeFileOverride by serialized::runtimeFileOverride
|
private val runtimeFileOverride by serialized::runtimeFileOverride
|
||||||
@@ -151,10 +142,6 @@ class Distribution private constructor(private val serialized: Serialized) : jav
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move into K/N?
|
// TODO: Move into K/N?
|
||||||
fun buildDistribution(konanHome: String) = Distribution(konanHome,true, null)
|
fun buildDistribution(konanHome: String, konanDataDir: String? = null) = Distribution(konanHome,true, null, konanDataDir = konanDataDir)
|
||||||
|
|
||||||
fun buildDistribution(konanHome: String, konanDataDir: String?) = Distribution(konanHome,true, null, konanDataDir = konanDataDir)
|
fun customerDistribution(konanHome: String, konanDataDir: String? = null) = Distribution(konanHome,false, null, konanDataDir = konanDataDir)
|
||||||
|
|
||||||
fun customerDistribution(konanHome: String) = Distribution(konanHome,false, null)
|
|
||||||
|
|
||||||
fun customerDistribution(konanHome: String, konanDataDir: String?) = Distribution(konanHome,false, null, konanDataDir = konanDataDir)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user