Rename ICReporter.report/reportVerbose to info/debug
to make it clear what severity levels they are mapped to. ^KT-52839 Fixed
This commit is contained in:
@@ -18,17 +18,16 @@ interface ICReporter {
|
||||
|
||||
fun report(message: () -> String, severity: ReportSeverity)
|
||||
|
||||
// TODO: Move these 3 functions outside of this interface and make them extension functions so they can't be overridden
|
||||
fun warn(message: () -> String) = report(message, severity = ReportSeverity.WARNING)
|
||||
fun report(message: () -> String) = report(message, severity = ReportSeverity.INFO)
|
||||
fun reportVerbose(message: () -> String) = report(message, severity = ReportSeverity.DEBUG)
|
||||
|
||||
fun reportCompileIteration(incremental: Boolean, sourceFiles: Collection<File>, exitCode: ExitCode)
|
||||
fun reportMarkDirtyClass(affectedFiles: Iterable<File>, classFqName: String)
|
||||
fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String)
|
||||
fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String)
|
||||
}
|
||||
|
||||
fun ICReporter.warn(message: () -> String) = report(message, severity = ICReporter.ReportSeverity.WARNING)
|
||||
fun ICReporter.info(message: () -> String) = report(message, severity = ICReporter.ReportSeverity.INFO)
|
||||
fun ICReporter.debug(message: () -> String) = report(message, severity = ICReporter.ReportSeverity.DEBUG)
|
||||
|
||||
object DoNothingICReporter : ICReporter {
|
||||
override fun report(message: () -> String, severity: ICReporter.ReportSeverity) {}
|
||||
override fun reportCompileIteration(incremental: Boolean, sourceFiles: Collection<File>, exitCode: ExitCode) {}
|
||||
|
||||
@@ -18,7 +18,7 @@ abstract class ICReporterBase(private val pathsBase: File? = null) : ICReporter
|
||||
|
||||
override fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String) {
|
||||
affectedFiles.forEach { file ->
|
||||
reportVerbose { "${pathsAsString(file)} is marked dirty: $reason" }
|
||||
debug { "${pathsAsString(file)} is marked dirty: $reason" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.build.GeneratedJvmClass
|
||||
import org.jetbrains.kotlin.build.JvmSourceRoot
|
||||
import org.jetbrains.kotlin.build.isModuleMappingFile
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.debug
|
||||
import org.jetbrains.kotlin.config.Services
|
||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
|
||||
@@ -152,7 +153,7 @@ fun ChangesCollector.getDirtyData(
|
||||
val sealedParents = HashSet<FqName>()
|
||||
|
||||
for (change in changes()) {
|
||||
reporter.reportVerbose { "Process $change" }
|
||||
reporter.debug { "Process $change" }
|
||||
|
||||
if (change is ChangeInfo.SignatureChanged) {
|
||||
val fqNames = if (!change.areSubclassesAffected) listOf(change.fqName) else withSubtypes(change.fqName, caches)
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.vfs.impl.ZipHandler
|
||||
import com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem
|
||||
import org.jetbrains.kotlin.build.DEFAULT_KOTLIN_SOURCE_FILES_EXTENSIONS
|
||||
import org.jetbrains.kotlin.build.report.RemoteBuildReporter
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.cli.common.CLICompiler
|
||||
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||
@@ -35,8 +36,6 @@ import org.jetbrains.kotlin.cli.common.repl.ReplEvalResult
|
||||
import org.jetbrains.kotlin.cli.js.K2JSCompiler
|
||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.jarfs.FastJarFileSystem
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.jarfs.FastJarHandler
|
||||
import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import org.jetbrains.kotlin.config.Services
|
||||
@@ -600,7 +599,7 @@ abstract class CompileServiceImplBase(
|
||||
val workingDir = incrementalCompilationOptions.workingDir
|
||||
|
||||
val modulesApiHistory = incrementalCompilationOptions.run {
|
||||
reporter.report { "Use module detection: ${multiModuleICSettings.useModuleDetection}" }
|
||||
reporter.info { "Use module detection: ${multiModuleICSettings.useModuleDetection}" }
|
||||
|
||||
if (!multiModuleICSettings.useModuleDetection) {
|
||||
ModulesApiHistoryJvm(modulesInfo)
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import org.jetbrains.kotlin.build.report.BuildReporter
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl
|
||||
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver
|
||||
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
|
||||
@@ -153,7 +154,7 @@ class AbiSnapshotImpl(override val protos: MutableMap<FqName, ProtoData>) : AbiS
|
||||
|
||||
fun read(file: File, reporter: BuildReporter): AbiSnapshot? {
|
||||
if (!file.exists()) {
|
||||
reporter.report { "jar snapshot $file is found for jar" }
|
||||
reporter.info { "jar snapshot $file is found for jar" }
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.incremental
|
||||
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
@@ -36,7 +37,7 @@ data class BuildDiffsStorage(val buildDiffs: List<BuildDifference>) {
|
||||
|
||||
fun readDiffsFromFile(file: File, reporter: ICReporter?): MutableList<BuildDifference>? {
|
||||
fun reportFail(reason: String) {
|
||||
reporter?.report { "Could not read diff from file $file: $reason" }
|
||||
reporter?.info { "Could not read diff from file $file: $reason" }
|
||||
}
|
||||
|
||||
if (!file.exists()) return null
|
||||
@@ -77,7 +78,7 @@ data class BuildDiffsStorage(val buildDiffs: List<BuildDifference>) {
|
||||
}
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
reporter?.report { "Could not write diff to file $file: $e" }
|
||||
reporter?.info { "Could not write diff to file $file: $e" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -20,6 +20,7 @@ import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.PsiJavaFile
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildAttribute
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
@@ -38,7 +39,7 @@ internal class ChangedJavaFilesProcessor(
|
||||
val removedJava = filesDiff.removed.filter(File::isJavaFile)
|
||||
|
||||
if (removedJava.any()) {
|
||||
reporter.report { "Some java files are removed: [${removedJava.joinToString()}]" }
|
||||
reporter.info { "Some java files are removed: [${removedJava.joinToString()}]" }
|
||||
return ChangesEither.Unknown(BuildAttribute.JAVA_CHANGE_UNTRACKED_FILE_IS_REMOVED)
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@ internal class ChangedJavaFilesProcessor(
|
||||
|
||||
val psiFile = psiFileFactory(javaFile)
|
||||
if (psiFile !is PsiJavaFile) {
|
||||
reporter.report { "Expected PsiJavaFile, got ${psiFile?.javaClass}" }
|
||||
reporter.info { "Expected PsiJavaFile, got ${psiFile?.javaClass}" }
|
||||
return ChangesEither.Unknown(BuildAttribute.JAVA_CHANGE_UNEXPECTED_PSI)
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.incremental.storage.BasicMapsOwner
|
||||
import org.jetbrains.kotlin.incremental.storage.IncrementalFileToPathConverter
|
||||
import org.jetbrains.kotlin.serialization.SerializerExtensionProtocol
|
||||
@@ -62,7 +63,7 @@ abstract class IncrementalCachesManager<PlatformCache : AbstractIncrementalCache
|
||||
cache.flush(false)
|
||||
} catch (e: Throwable) {
|
||||
isSuccessfulyClosed = false
|
||||
reporter.report { "Exception when flushing cache ${cache.javaClass}: $e" }
|
||||
reporter.info { "Exception when flushing cache ${cache.javaClass}: $e" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +71,7 @@ abstract class IncrementalCachesManager<PlatformCache : AbstractIncrementalCache
|
||||
cache.close()
|
||||
} catch (e: Throwable) {
|
||||
isSuccessfulyClosed = false
|
||||
reporter.report { "Exception when closing cache ${cache.javaClass}: $e" }
|
||||
reporter.info { "Exception when closing cache ${cache.javaClass}: $e" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-7
@@ -19,10 +19,13 @@ package org.jetbrains.kotlin.incremental
|
||||
import org.jetbrains.kotlin.build.DEFAULT_KOTLIN_SOURCE_FILES_EXTENSIONS
|
||||
import org.jetbrains.kotlin.build.GeneratedFile
|
||||
import org.jetbrains.kotlin.build.report.BuildReporter
|
||||
import org.jetbrains.kotlin.build.report.debug
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildAttribute
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildPerformanceMetric
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildTime
|
||||
import org.jetbrains.kotlin.build.report.metrics.measure
|
||||
import org.jetbrains.kotlin.build.report.warn
|
||||
import org.jetbrains.kotlin.cli.common.*
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||
@@ -98,7 +101,7 @@ abstract class IncrementalCompilerRunner<
|
||||
projectDir: File? = null,
|
||||
classpathAbiSnapshot: Map<String, AbiSnapshot>
|
||||
): ExitCode {
|
||||
reporter.report { "Non-incremental compilation will be performed: $reason" }
|
||||
reporter.info { "Non-incremental compilation will be performed: $reason" }
|
||||
reporter.measure(BuildTime.CLEAR_OUTPUT_ON_REBUILD) {
|
||||
cleanOutputsAndLocalStateOnRebuild(args)
|
||||
}
|
||||
@@ -133,7 +136,7 @@ abstract class IncrementalCompilerRunner<
|
||||
|
||||
val classpathAbiSnapshot =
|
||||
if (withAbiSnapshot) {
|
||||
reporter.report { "Incremental compilation with ABI snapshot enabled" }
|
||||
reporter.info { "Incremental compilation with ABI snapshot enabled" }
|
||||
reporter.measure(BuildTime.SET_UP_ABI_SNAPSHOTS) {
|
||||
setupJarDependencies(args, withAbiSnapshot, reporter)
|
||||
}
|
||||
@@ -196,7 +199,7 @@ abstract class IncrementalCompilerRunner<
|
||||
}
|
||||
} finally {
|
||||
if (!caches.close(flush = true)) {
|
||||
reporter.report { "Unable to close IC caches. Cleaning internal state" }
|
||||
reporter.info { "Unable to close IC caches. Cleaning internal state" }
|
||||
cleanOutputsAndLocalStateOnRebuild(args)
|
||||
}
|
||||
}
|
||||
@@ -212,15 +215,15 @@ abstract class IncrementalCompilerRunner<
|
||||
// Use Set as additionalOutputFiles may already contain destinationDir and workingDir
|
||||
val outputFiles = setOf(destinationDir(args), workingDir) + additionalOutputFiles
|
||||
|
||||
reporter.reportVerbose { "Cleaning outputs on rebuild" }
|
||||
reporter.debug { "Cleaning outputs on rebuild" }
|
||||
outputFiles.forEach {
|
||||
when {
|
||||
it.isDirectory -> {
|
||||
reporter.reportVerbose { " Deleting contents of directory '${it.path}'" }
|
||||
reporter.debug { " Deleting contents of directory '${it.path}'" }
|
||||
it.cleanDirectoryContents()
|
||||
}
|
||||
it.isFile -> {
|
||||
reporter.reportVerbose { " Deleting file '${it.path}'" }
|
||||
reporter.debug { " Deleting file '${it.path}'" }
|
||||
it.deleteRecursivelyOrThrow()
|
||||
}
|
||||
}
|
||||
@@ -322,7 +325,7 @@ abstract class IncrementalCompilerRunner<
|
||||
classpathAbiSnapshot: Map<String, AbiSnapshot> = HashMap()
|
||||
): ExitCode {
|
||||
if (compilationMode is CompilationMode.Rebuild) {
|
||||
reporter.report { "Non-incremental compilation will be performed: ${compilationMode.reason}" }
|
||||
reporter.info { "Non-incremental compilation will be performed: ${compilationMode.reason}" }
|
||||
}
|
||||
|
||||
preBuildHook(args, compilationMode)
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.build.GeneratedFile
|
||||
import org.jetbrains.kotlin.build.report.BuildReporter
|
||||
import org.jetbrains.kotlin.build.report.DoNothingICReporter
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildAttribute
|
||||
import org.jetbrains.kotlin.build.report.metrics.DoNothingBuildMetricsReporter
|
||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||
@@ -139,7 +140,7 @@ class IncrementalJsCompilerRunner(
|
||||
|
||||
when (classpathChanges) {
|
||||
is ChangesEither.Unknown -> {
|
||||
reporter.report { "Could not get classpath's changes: ${classpathChanges.reason}" }
|
||||
reporter.info { "Could not get classpath's changes: ${classpathChanges.reason}" }
|
||||
return CompilationMode.Rebuild(classpathChanges.reason)
|
||||
}
|
||||
is ChangesEither.Known -> {
|
||||
|
||||
+7
-9
@@ -26,9 +26,7 @@ import org.jetbrains.annotations.TestOnly
|
||||
import org.jetbrains.kotlin.build.DEFAULT_KOTLIN_SOURCE_FILES_EXTENSIONS
|
||||
import org.jetbrains.kotlin.build.GeneratedFile
|
||||
import org.jetbrains.kotlin.build.GeneratedJvmClass
|
||||
import org.jetbrains.kotlin.build.report.BuildReporter
|
||||
import org.jetbrains.kotlin.build.report.DoNothingICReporter
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.*
|
||||
import org.jetbrains.kotlin.build.report.metrics.*
|
||||
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||
@@ -236,7 +234,7 @@ open class IncrementalJvmCompilerRunner(
|
||||
val dirtyFiles = DirtyFilesContainer(caches, reporter, kotlinSourceFilesExtensions)
|
||||
initDirtyFiles(dirtyFiles, changedFiles)
|
||||
|
||||
reporter.reportVerbose { "Classpath changes info passed from Gradle task: ${classpathChanges::class.simpleName}" }
|
||||
reporter.debug { "Classpath changes info passed from Gradle task: ${classpathChanges::class.simpleName}" }
|
||||
val classpathChanges = when (classpathChanges) {
|
||||
// Note: classpathChanges is deserialized, so they are no longer singleton objects and need to be compared using `is` (not `==`)
|
||||
is NoChanges -> ChangesEither.Known(emptySet(), emptySet())
|
||||
@@ -266,7 +264,7 @@ open class IncrementalJvmCompilerRunner(
|
||||
return CompilationMode.Rebuild(BuildAttribute.NO_BUILD_HISTORY)
|
||||
}
|
||||
val lastBuildInfo = BuildInfo.read(lastBuildInfoFile)
|
||||
reporter.reportVerbose { "Last Kotlin Build info -- $lastBuildInfo" }
|
||||
reporter.debug { "Last Kotlin Build info -- $lastBuildInfo" }
|
||||
val scopes = caches.lookupCache.lookupSymbols.map { it.scope.ifBlank { it.name } }.distinct()
|
||||
|
||||
getClasspathChanges(
|
||||
@@ -280,7 +278,7 @@ open class IncrementalJvmCompilerRunner(
|
||||
@Suppress("UNUSED_VARIABLE") // for sealed when
|
||||
val unused = when (classpathChanges) {
|
||||
is ChangesEither.Unknown -> {
|
||||
reporter.report {
|
||||
reporter.info {
|
||||
"Could not get classpath's changes: ${classpathChanges.reason}"
|
||||
}
|
||||
return CompilationMode.Rebuild(classpathChanges.reason)
|
||||
@@ -327,20 +325,20 @@ open class IncrementalJvmCompilerRunner(
|
||||
if (!caches.platformCache.isTrackedFile(javaFile)) {
|
||||
if (!javaFile.exists()) {
|
||||
// todo: can we do this more optimal?
|
||||
reporter.report { "Could not get changed for untracked removed java file $javaFile" }
|
||||
reporter.info { "Could not get changed for untracked removed java file $javaFile" }
|
||||
return BuildAttribute.JAVA_CHANGE_UNTRACKED_FILE_IS_REMOVED
|
||||
}
|
||||
|
||||
val psiFile = psiFileProvider.javaFile(javaFile)
|
||||
if (psiFile !is PsiJavaFile) {
|
||||
reporter.report { "[Precise Java tracking] Expected PsiJavaFile, got ${psiFile?.javaClass}" }
|
||||
reporter.info { "[Precise Java tracking] Expected PsiJavaFile, got ${psiFile?.javaClass}" }
|
||||
return BuildAttribute.JAVA_CHANGE_UNEXPECTED_PSI
|
||||
}
|
||||
|
||||
for (psiClass in psiFile.classes) {
|
||||
val qualifiedName = psiClass.qualifiedName
|
||||
if (qualifiedName == null) {
|
||||
reporter.report { "[Precise Java tracking] Class with unknown qualified name in $javaFile" }
|
||||
reporter.info { "[Precise Java tracking] Class with unknown qualified name in $javaFile" }
|
||||
return BuildAttribute.JAVA_CHANGE_UNKNOWN_QUALIFIER
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.incremental
|
||||
import com.intellij.util.containers.MultiMap
|
||||
import org.jetbrains.kotlin.build.GeneratedFile
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.debug
|
||||
import org.jetbrains.kotlin.incremental.snapshots.FileSnapshotMap
|
||||
import org.jetbrains.kotlin.incremental.storage.BasicMapsOwner
|
||||
import org.jetbrains.kotlin.incremental.storage.FileToPathConverter
|
||||
@@ -41,7 +42,7 @@ class InputsCache(
|
||||
fun removeOutputForSourceFiles(sources: Iterable<File>) {
|
||||
for (sourceFile in sources) {
|
||||
sourceToOutputMap.remove(sourceFile).forEach {
|
||||
reporter.reportVerbose { "Deleting $it on clearing cache for $sourceFile" }
|
||||
reporter.debug { "Deleting $it on clearing cache for $sourceFile" }
|
||||
it.delete()
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import org.jetbrains.kotlin.build.report.BuildReporter
|
||||
import org.jetbrains.kotlin.build.report.info
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildTime
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildAttribute
|
||||
import org.jetbrains.kotlin.build.report.metrics.measure
|
||||
@@ -38,7 +39,7 @@ internal fun getClasspathChanges(
|
||||
|
||||
// todo: removed classes could be processed normally
|
||||
if (removedClasspath.isNotEmpty()) {
|
||||
reporter.report { "Some files are removed from classpath: $removedClasspath" }
|
||||
reporter.info { "Some files are removed from classpath: $removedClasspath" }
|
||||
return ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_REMOVED_ENTRY)
|
||||
}
|
||||
|
||||
@@ -53,7 +54,7 @@ internal fun getClasspathChanges(
|
||||
val actualAbiSnapshot = lastBuildInfo.dependencyToAbiSnapshot[module]
|
||||
if (actualAbiSnapshot == null) {
|
||||
|
||||
reporter.report { "Some jar are removed from classpath $module" }
|
||||
reporter.info { "Some jar are removed from classpath $module" }
|
||||
return ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_REMOVED_ENTRY)
|
||||
}
|
||||
val diffData = AbiSnapshotDiffService.doCompute(abiSnapshot, actualAbiSnapshot, caches, scopes)
|
||||
@@ -80,7 +81,7 @@ internal fun getClasspathChanges(
|
||||
val historyFiles = when (historyFilesEither) {
|
||||
is Either.Success<Set<File>> -> historyFilesEither.value
|
||||
is Either.Error -> {
|
||||
reporter.report { "Could not find history files: ${historyFilesEither.reason}" }
|
||||
reporter.info { "Could not find history files: ${historyFilesEither.reason}" }
|
||||
return ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_HISTORY_IS_NOT_FOUND)
|
||||
}
|
||||
}
|
||||
@@ -89,20 +90,20 @@ internal fun getClasspathChanges(
|
||||
for (historyFile in historyFiles) {
|
||||
val allBuilds = BuildDiffsStorage.readDiffsFromFile(historyFile, reporter = reporter)
|
||||
?: return run {
|
||||
reporter.report { "Could not read diffs from $historyFile" }
|
||||
reporter.info { "Could not read diffs from $historyFile" }
|
||||
ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_HISTORY_CANNOT_BE_READ)
|
||||
}
|
||||
|
||||
val (knownBuilds, newBuilds) = allBuilds.partition { it.ts <= lastBuildTS }
|
||||
if (knownBuilds.isEmpty()) {
|
||||
reporter.report { "No previously known builds for $historyFile" }
|
||||
reporter.info { "No previously known builds for $historyFile" }
|
||||
return ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_HISTORY_NO_KNOWN_BUILDS)
|
||||
}
|
||||
|
||||
|
||||
for (buildDiff in newBuilds) {
|
||||
if (!buildDiff.isIncremental) {
|
||||
reporter.report { "Non-incremental build from dependency $historyFile" }
|
||||
reporter.info { "Non-incremental build from dependency $historyFile" }
|
||||
return ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_NON_INCREMENTAL_BUILD_IN_DEP)
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.incremental.classpathDiff
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import org.jetbrains.kotlin.build.report.DoNothingICReporter
|
||||
import org.jetbrains.kotlin.build.report.debug
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildTime
|
||||
import org.jetbrains.kotlin.build.report.metrics.measure
|
||||
@@ -52,7 +53,7 @@ object ClasspathChangesComputer {
|
||||
)
|
||||
)
|
||||
}
|
||||
reporter.reportVerbose {
|
||||
reporter.debug {
|
||||
"Shrunk current classpath snapshot for diffing," +
|
||||
" retained ${shrunkCurrentClasspathAgainstPreviousLookups.size} / ${currentClasspathSnapshot.size} classes"
|
||||
}
|
||||
@@ -61,7 +62,7 @@ object ClasspathChangesComputer {
|
||||
val shrunkPreviousClasspathSnapshot = reporter.measure(BuildTime.LOAD_SHRUNK_PREVIOUS_CLASSPATH_SNAPSHOT) {
|
||||
ListExternalizer(AccessibleClassSnapshotExternalizer).loadFromFile(classpathSnapshotFiles.shrunkPreviousClasspathSnapshotFile)
|
||||
}
|
||||
reporter.reportVerbose {
|
||||
reporter.debug {
|
||||
"Loaded shrunk previous classpath snapshot for diffing, found ${shrunkPreviousClasspathSnapshot.size} classes"
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.incremental.classpathDiff
|
||||
|
||||
import org.jetbrains.kotlin.build.report.BuildReporter
|
||||
import org.jetbrains.kotlin.build.report.ICReporter
|
||||
import org.jetbrains.kotlin.build.report.debug
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter
|
||||
|
||||
class ClasspathSnapshotBuildReporter(private val buildReporter: BuildReporter) :
|
||||
@@ -17,7 +18,7 @@ class ClasspathSnapshotBuildReporter(private val buildReporter: BuildReporter) :
|
||||
}
|
||||
|
||||
fun reportVerboseWithLimit(maxLength: Int = 1000, message: () -> String) {
|
||||
reportVerbose {
|
||||
debug {
|
||||
message().let {
|
||||
if (it.length > maxLength) {
|
||||
it.substring(0, maxLength) + "... (string too long, showing $maxLength / ${it.length} chars)"
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.incremental.classpathDiff
|
||||
|
||||
import org.jetbrains.kotlin.build.report.debug
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildPerformanceMetric
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildTime
|
||||
@@ -308,7 +309,7 @@ internal fun shrinkAndSaveClasspathSnapshot(
|
||||
}
|
||||
}
|
||||
|
||||
reporter.reportVerbose {
|
||||
reporter.debug {
|
||||
"Shrunk current classpath snapshot after compilation (shrink mode = ${shrinkMode::class.simpleName})" + when (shrinkMode) {
|
||||
is ShrinkMode.UnchangedLookupsUnchangedClasspath -> ", no updates since previous run"
|
||||
else -> ", retained ${shrunkCurrentClasspath!!.size} / ${currentClasspath!!.size} classes"
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.build.GeneratedFile
|
||||
import org.jetbrains.kotlin.build.GeneratedJvmClass
|
||||
import org.jetbrains.kotlin.build.report.ICReporter.ReportSeverity
|
||||
import org.jetbrains.kotlin.build.report.ICReporterBase
|
||||
import org.jetbrains.kotlin.build.report.debug
|
||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.ERROR
|
||||
@@ -750,7 +751,7 @@ private fun ChangesCollector.processChangesUsingLookups(
|
||||
val allCaches = caches.flatMap { it.thisWithDependentCaches }
|
||||
val reporter = JpsICReporter()
|
||||
|
||||
reporter.reportVerbose { "Start processing changes" }
|
||||
reporter.debug { "Start processing changes" }
|
||||
|
||||
val dirtyFiles = getDirtyFiles(allCaches, lookupStorageManager)
|
||||
// if list of inheritors of sealed class has changed it should be recompiled with all the inheritors
|
||||
@@ -764,7 +765,7 @@ private fun ChangesCollector.processChangesUsingLookups(
|
||||
excludeFiles = excludeFiles
|
||||
)
|
||||
|
||||
reporter.reportVerbose { "End of processing changes" }
|
||||
reporter.debug { "End of processing changes" }
|
||||
}
|
||||
|
||||
data class FilesToRecompile(val dirtyFiles: Set<File>, val forceRecompileTogether: Set<File>)
|
||||
|
||||
Reference in New Issue
Block a user