[Commonizer] Print true time for resolving of libraries to be commonized
This commit is contained in:
+2
-2
@@ -62,7 +62,7 @@ internal class NativeKlibCommonize(options: Collection<Option<*>>) : Task(option
|
|||||||
val konanTargets = outputCommonizerTarget.konanTargets
|
val konanTargets = outputCommonizerTarget.konanTargets
|
||||||
val commonizerTargets = konanTargets.map(::CommonizerTarget)
|
val commonizerTargets = konanTargets.map(::CommonizerTarget)
|
||||||
|
|
||||||
val progressLogger = ProgressLogger(CliLoggerAdapter(2))
|
val progressLogger = ProgressLogger(CliLoggerAdapter(2), startImmediately = true)
|
||||||
val libraryLoader = DefaultNativeLibraryLoader(progressLogger)
|
val libraryLoader = DefaultNativeLibraryLoader(progressLogger)
|
||||||
val statsCollector = StatsCollector(statsType, commonizerTargets)
|
val statsCollector = StatsCollector(statsType, commonizerTargets)
|
||||||
val repository = FilesRepository(targetLibraries.toSet(), libraryLoader)
|
val repository = FilesRepository(targetLibraries.toSet(), libraryLoader)
|
||||||
@@ -104,7 +104,7 @@ internal class NativeDistributionCommonize(options: Collection<Option<*>>) : Tas
|
|||||||
val copyEndorsedLibs = getOptional<Boolean, BooleanOptionType> { it == "copy-endorsed-libs" } ?: false
|
val copyEndorsedLibs = getOptional<Boolean, BooleanOptionType> { it == "copy-endorsed-libs" } ?: false
|
||||||
val statsType = getOptional<StatsType, StatsTypeOptionType> { it == "log-stats" } ?: StatsType.NONE
|
val statsType = getOptional<StatsType, StatsTypeOptionType> { it == "log-stats" } ?: StatsType.NONE
|
||||||
|
|
||||||
val progressLogger = ProgressLogger(CliLoggerAdapter(2))
|
val progressLogger = ProgressLogger(CliLoggerAdapter(2), startImmediately = true)
|
||||||
val libraryLoader = DefaultNativeLibraryLoader(progressLogger)
|
val libraryLoader = DefaultNativeLibraryLoader(progressLogger)
|
||||||
val repository = KonanDistributionRepository(distribution, commonizerTargets.toSet(), libraryLoader)
|
val repository = KonanDistributionRepository(distribution, commonizerTargets.toSet(), libraryLoader)
|
||||||
val existingTargets = commonizerTargets.filter { repository.getLibraries(it).isNotEmpty() }.toSet()
|
val existingTargets = commonizerTargets.filter { repository.getLibraries(it).isNotEmpty() }.toSet()
|
||||||
|
|||||||
+1
-2
@@ -27,7 +27,6 @@ internal class LibraryCommonizer internal constructor(
|
|||||||
|
|
||||||
fun run() {
|
fun run() {
|
||||||
checkPreconditions()
|
checkPreconditions()
|
||||||
progressLogger.reset()
|
|
||||||
val allLibraries = loadLibraries()
|
val allLibraries = loadLibraries()
|
||||||
commonizeAndSaveResults(allLibraries)
|
commonizeAndSaveResults(allLibraries)
|
||||||
progressLogger.logTotal()
|
progressLogger.logTotal()
|
||||||
@@ -45,7 +44,7 @@ internal class LibraryCommonizer internal constructor(
|
|||||||
progressLogger.warning("No platform libraries found for target ${target.prettyName}. This target will be excluded from commonization.")
|
progressLogger.warning("No platform libraries found for target ${target.prettyName}. This target will be excluded from commonization.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progressLogger.log("Read lazy (uninitialized) libraries")
|
progressLogger.log("Resolved libraries to be commonized")
|
||||||
return AllNativeLibraries(stdlib, librariesByTargets)
|
return AllNativeLibraries(stdlib, librariesByTargets)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -7,10 +7,18 @@ package org.jetbrains.kotlin.descriptors.commonizer.utils
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.util.Logger
|
import org.jetbrains.kotlin.util.Logger
|
||||||
|
|
||||||
class ProgressLogger(private val wrapped: Logger) : Logger by wrapped {
|
class ProgressLogger(
|
||||||
|
private val wrapped: Logger,
|
||||||
|
startImmediately: Boolean = false
|
||||||
|
) : Logger by wrapped {
|
||||||
private val clockMark = ResettableClockMark()
|
private val clockMark = ResettableClockMark()
|
||||||
private var finished = true
|
private var finished = true
|
||||||
|
|
||||||
|
init {
|
||||||
|
if (startImmediately)
|
||||||
|
reset()
|
||||||
|
}
|
||||||
|
|
||||||
fun reset() {
|
fun reset() {
|
||||||
clockMark.reset()
|
clockMark.reset()
|
||||||
finished = false
|
finished = false
|
||||||
|
|||||||
Reference in New Issue
Block a user