[Commonizer] Logging: Implement CommonizerLogLevel and hide verbose output by default
^KT-36679 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
7349ec8f2f
commit
b48850c993
+4
@@ -224,6 +224,10 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
||||
val enableCInteropCommonization: Boolean
|
||||
get() = booleanProperty("kotlin.mpp.enableCInteropCommonization") ?: false
|
||||
|
||||
|
||||
val commonizerLogLevel: String?
|
||||
get() = property("kotlin.mpp.commonizerLogLevel")
|
||||
|
||||
/**
|
||||
* Enables experimental commonization of 'higher level' shared native source sets
|
||||
*/
|
||||
|
||||
+2
-1
@@ -100,7 +100,8 @@ internal open class CInteropCommonizerTask : AbstractCInteropCommonizerTask() {
|
||||
inputLibraries = cinteropsForTarget.map { it.libraryFile.get() }.filter { it.exists() }.toSet(),
|
||||
dependencyLibraries = cinteropsForTarget.flatMap { it.dependencies.files }.map(::NonTargetedCommonizerDependency).toSet()
|
||||
+ nativeDistributionDependencies(parameters),
|
||||
outputDirectory = outputDirectory(parameters)
|
||||
outputDirectory = outputDirectory(parameters),
|
||||
logLevel = project.commonizerLogLevel
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.native.internal
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.jetbrains.kotlin.commonizer.CommonizerLogLevel
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider
|
||||
|
||||
internal val Project.commonizerLogLevel: CommonizerLogLevel
|
||||
get() {
|
||||
PropertiesProvider(this).commonizerLogLevel?.let { logLevelString ->
|
||||
val matchingLevel = CommonizerLogLevel.values().firstOrNull { logLevel -> logLevel.name.equals(logLevelString, true) }
|
||||
if (matchingLevel != null) return matchingLevel
|
||||
}
|
||||
|
||||
return if (logger.isInfoEnabled) CommonizerLogLevel.Info else CommonizerLogLevel.Quiet
|
||||
}
|
||||
+3
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.gradle.targets.native.internal
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.*
|
||||
import org.jetbrains.kotlin.commonizer.CommonizerLogLevel
|
||||
import org.jetbrains.kotlin.commonizer.SharedCommonizerTarget
|
||||
import org.jetbrains.kotlin.commonizer.identityString
|
||||
import org.jetbrains.kotlin.commonizer.isAncestorOf
|
||||
@@ -106,6 +107,8 @@ internal open class HierarchicalNativeDistributionCommonizerTask : DefaultTask()
|
||||
this += getRootOutputDirectory(target).absolutePath
|
||||
this += "-output-commonizer-target"
|
||||
this += target.identityString
|
||||
this += "-log-level"
|
||||
this += project.commonizerLogLevel.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user