Expand compilation scope for IC before backend is run
Sometimes IC raises compilation errors when rebuild succeeds.
This happens because IC uses serialized decriptors
for non-dirty files. Serialized descriptors can be different
from source file descriptors. For example, a source file
may contain an implicit return type or an implicit visibility
for overridden methods, but serialized descriptors always
contain explicit return types & methods' visibilities.
These problems can be solved by expanding a scope of incremental compilation
just after the analysis, but before error reporting & code generation.
In other words, we need to compare descriptors before error reporting and code generation.
If there are new dirty files, current round of IC must be aborted,
next round must be performed with new dirty files.
This commit implements IC scope expansion for JS Klib compiler
#KT-13677
#KT-28233
This commit is contained in:
@@ -83,6 +83,17 @@ open class IncrementalJsCache(
|
|||||||
dirtySources.addAll(removedAndCompiledSources)
|
dirtySources.addAll(removedAndCompiledSources)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun compare(translatedFiles: Map<File, TranslationResultValue>, changesCollector: ChangesCollector) {
|
||||||
|
for ((srcFile, data) in translatedFiles) {
|
||||||
|
val oldProtoMap = translationResults[srcFile]?.metadata?.let { protoData(srcFile, it) } ?: emptyMap()
|
||||||
|
val newProtoMap = protoData(srcFile, data.metadata)
|
||||||
|
|
||||||
|
for (classId in oldProtoMap.keys + newProtoMap.keys) {
|
||||||
|
changesCollector.collectProtoChanges(oldProtoMap[classId], newProtoMap[classId])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun compareAndUpdate(incrementalResults: IncrementalResultsConsumerImpl, changesCollector: ChangesCollector) {
|
fun compareAndUpdate(incrementalResults: IncrementalResultsConsumerImpl, changesCollector: ChangesCollector) {
|
||||||
val translatedFiles = incrementalResults.packageParts
|
val translatedFiles = incrementalResults.packageParts
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ data class BuildLogFinder(
|
|||||||
private val isDataContainerBuildLogEnabled: Boolean = false,
|
private val isDataContainerBuildLogEnabled: Boolean = false,
|
||||||
private val isGradleEnabled: Boolean = false,
|
private val isGradleEnabled: Boolean = false,
|
||||||
private val isJsEnabled: Boolean = false,
|
private val isJsEnabled: Boolean = false,
|
||||||
private val isJsIrEnabled: Boolean = false // TODO rename as it is used for metadata-only test
|
private val isJsIrEnabled: Boolean = false, // TODO rename as it is used for metadata-only test
|
||||||
|
private val isScopeExpansionEnabled: Boolean = false
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
private const val JS_LOG = "js-build.log"
|
private const val JS_LOG = "js-build.log"
|
||||||
private const val JS_IR_LOG = "js-ir-build.log"
|
private const val JS_IR_LOG = "js-ir-build.log"
|
||||||
|
private const val SCOPE_EXPANDING_LOG = "build-with-scope-expansion.log"
|
||||||
private const val GRADLE_LOG = "gradle-build.log"
|
private const val GRADLE_LOG = "gradle-build.log"
|
||||||
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
|
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
|
||||||
const val JS_JPS_LOG = "js-jps-build.log"
|
const val JS_JPS_LOG = "js-jps-build.log"
|
||||||
@@ -40,6 +42,7 @@ data class BuildLogFinder(
|
|||||||
val names = dir.list() ?: arrayOf()
|
val names = dir.list() ?: arrayOf()
|
||||||
val files = names.filter { File(dir, it).isFile }.toSet()
|
val files = names.filter { File(dir, it).isFile }.toSet()
|
||||||
val matchedName = when {
|
val matchedName = when {
|
||||||
|
isScopeExpansionEnabled && SCOPE_EXPANDING_LOG in files -> SCOPE_EXPANDING_LOG
|
||||||
isJsIrEnabled && JS_IR_LOG in files -> JS_IR_LOG
|
isJsIrEnabled && JS_IR_LOG in files -> JS_IR_LOG
|
||||||
isJsEnabled && JS_LOG in files -> JS_LOG
|
isJsEnabled && JS_LOG in files -> JS_LOG
|
||||||
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
|
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.config.IncrementalCompilation
|
|||||||
import org.jetbrains.kotlin.config.Services
|
import org.jetbrains.kotlin.config.Services
|
||||||
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
|
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
|
||||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||||
|
import org.jetbrains.kotlin.incremental.js.IncrementalNextRoundChecker
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalDataProvider
|
import org.jetbrains.kotlin.incremental.js.IncrementalDataProvider
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer
|
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer
|
||||||
import org.jetbrains.kotlin.ir.backend.js.*
|
import org.jetbrains.kotlin.ir.backend.js.*
|
||||||
@@ -296,6 +297,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
|||||||
|
|
||||||
configuration.putIfNotNull(JSConfigurationKeys.INCREMENTAL_DATA_PROVIDER, services[IncrementalDataProvider::class.java])
|
configuration.putIfNotNull(JSConfigurationKeys.INCREMENTAL_DATA_PROVIDER, services[IncrementalDataProvider::class.java])
|
||||||
configuration.putIfNotNull(JSConfigurationKeys.INCREMENTAL_RESULTS_CONSUMER, services[IncrementalResultsConsumer::class.java])
|
configuration.putIfNotNull(JSConfigurationKeys.INCREMENTAL_RESULTS_CONSUMER, services[IncrementalResultsConsumer::class.java])
|
||||||
|
configuration.putIfNotNull(JSConfigurationKeys.INCREMENTAL_NEXT_ROUND_CHECKER, services[IncrementalNextRoundChecker::class.java])
|
||||||
configuration.putIfNotNull(CommonConfigurationKeys.LOOKUP_TRACKER, services[LookupTracker::class.java])
|
configuration.putIfNotNull(CommonConfigurationKeys.LOOKUP_TRACKER, services[LookupTracker::class.java])
|
||||||
configuration.putIfNotNull(CommonConfigurationKeys.EXPECT_ACTUAL_TRACKER, services[ExpectActualTracker::class.java])
|
configuration.putIfNotNull(CommonConfigurationKeys.EXPECT_ACTUAL_TRACKER, services[ExpectActualTracker::class.java])
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.config.Services
|
|||||||
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
|
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
|
||||||
import org.jetbrains.kotlin.progress.CompilationCanceledException
|
import org.jetbrains.kotlin.progress.CompilationCanceledException
|
||||||
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
|
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
|
||||||
|
import org.jetbrains.kotlin.progress.IncrementalNextRoundException
|
||||||
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
|
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
|
||||||
import org.jetbrains.kotlin.utils.KotlinPaths
|
import org.jetbrains.kotlin.utils.KotlinPaths
|
||||||
import org.jetbrains.kotlin.utils.PathUtil
|
import org.jetbrains.kotlin.utils.PathUtil
|
||||||
@@ -96,12 +97,12 @@ abstract class CLICompiler<A : CommonCompilerArguments> : CLITool<A>() {
|
|||||||
|
|
||||||
return if (collector.hasErrors()) COMPILATION_ERROR else code
|
return if (collector.hasErrors()) COMPILATION_ERROR else code
|
||||||
} catch (e: CompilationCanceledException) {
|
} catch (e: CompilationCanceledException) {
|
||||||
collector.report(INFO, "Compilation was canceled", null)
|
collector.reportCompilationCancelled(e)
|
||||||
return ExitCode.OK
|
return ExitCode.OK
|
||||||
} catch (e: RuntimeException) {
|
} catch (e: RuntimeException) {
|
||||||
val cause = e.cause
|
val cause = e.cause
|
||||||
if (cause is CompilationCanceledException) {
|
if (cause is CompilationCanceledException) {
|
||||||
collector.report(INFO, "Compilation was canceled", null)
|
collector.reportCompilationCancelled(cause)
|
||||||
return ExitCode.OK
|
return ExitCode.OK
|
||||||
} else {
|
} else {
|
||||||
throw e
|
throw e
|
||||||
@@ -119,6 +120,12 @@ abstract class CLICompiler<A : CommonCompilerArguments> : CLITool<A>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun MessageCollector.reportCompilationCancelled(e: CompilationCanceledException) {
|
||||||
|
if (e !is IncrementalNextRoundException) {
|
||||||
|
report(INFO, "Compilation was canceled", null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupCommonArguments(configuration: CompilerConfiguration, arguments: A) {
|
private fun setupCommonArguments(configuration: CompilerConfiguration, arguments: A) {
|
||||||
configuration.setupCommonArguments(arguments, this::createMetadataVersion)
|
configuration.setupCommonArguments(arguments, this::createMetadataVersion)
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 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.incremental
|
||||||
|
|
||||||
|
// todo: add ON_ERROR scope expansion mode
|
||||||
|
enum class CompileScopeExpansionMode {
|
||||||
|
ALWAYS, NEVER
|
||||||
|
}
|
||||||
+11
-7
@@ -163,7 +163,7 @@ abstract class IncrementalCompilerRunner<
|
|||||||
|
|
||||||
protected open fun preBuildHook(args: Args, compilationMode: CompilationMode) {}
|
protected open fun preBuildHook(args: Args, compilationMode: CompilationMode) {}
|
||||||
protected open fun postCompilationHook(exitCode: ExitCode) {}
|
protected open fun postCompilationHook(exitCode: ExitCode) {}
|
||||||
protected open fun additionalDirtyFiles(caches: CacheManager, generatedFiles: List<GeneratedFile>): Iterable<File> =
|
protected open fun additionalDirtyFiles(caches: CacheManager, generatedFiles: List<GeneratedFile>, services: Services): Iterable<File> =
|
||||||
emptyList()
|
emptyList()
|
||||||
|
|
||||||
protected open fun additionalDirtyLookupSymbols(): Iterable<LookupSymbol> =
|
protected open fun additionalDirtyLookupSymbols(): Iterable<LookupSymbol> =
|
||||||
@@ -174,7 +174,8 @@ abstract class IncrementalCompilerRunner<
|
|||||||
lookupTracker: LookupTracker,
|
lookupTracker: LookupTracker,
|
||||||
expectActualTracker: ExpectActualTracker,
|
expectActualTracker: ExpectActualTracker,
|
||||||
caches: CacheManager,
|
caches: CacheManager,
|
||||||
compilationMode: CompilationMode
|
dirtySources: Set<File>,
|
||||||
|
isIncremental: Boolean
|
||||||
): Services.Builder =
|
): Services.Builder =
|
||||||
Services.Builder().apply {
|
Services.Builder().apply {
|
||||||
register(LookupTracker::class.java, lookupTracker)
|
register(LookupTracker::class.java, lookupTracker)
|
||||||
@@ -227,7 +228,10 @@ abstract class IncrementalCompilerRunner<
|
|||||||
val text = dirtySources.joinToString(separator = System.getProperty("line.separator")) { it.canonicalPath }
|
val text = dirtySources.joinToString(separator = System.getProperty("line.separator")) { it.canonicalPath }
|
||||||
dirtySourcesSinceLastTimeFile.writeText(text)
|
dirtySourcesSinceLastTimeFile.writeText(text)
|
||||||
|
|
||||||
val services = makeServices(args, lookupTracker, expectActualTracker, caches, compilationMode).build()
|
val services = makeServices(
|
||||||
|
args, lookupTracker, expectActualTracker, caches,
|
||||||
|
dirtySources.toSet(), compilationMode is CompilationMode.Incremental
|
||||||
|
).build()
|
||||||
|
|
||||||
args.reportOutputFiles = true
|
args.reportOutputFiles = true
|
||||||
val outputItemsCollector = OutputItemsCollectorImpl()
|
val outputItemsCollector = OutputItemsCollectorImpl()
|
||||||
@@ -237,20 +241,20 @@ abstract class IncrementalCompilerRunner<
|
|||||||
postCompilationHook(exitCode)
|
postCompilationHook(exitCode)
|
||||||
|
|
||||||
reporter.reportCompileIteration(compilationMode is CompilationMode.Incremental, sourcesToCompile, exitCode)
|
reporter.reportCompileIteration(compilationMode is CompilationMode.Incremental, sourcesToCompile, exitCode)
|
||||||
if (exitCode != ExitCode.OK) break
|
|
||||||
|
|
||||||
dirtySourcesSinceLastTimeFile.delete()
|
|
||||||
val generatedFiles = outputItemsCollector.outputs.map(SimpleOutputItem::toGeneratedFile)
|
val generatedFiles = outputItemsCollector.outputs.map(SimpleOutputItem::toGeneratedFile)
|
||||||
|
|
||||||
if (compilationMode is CompilationMode.Incremental) {
|
if (compilationMode is CompilationMode.Incremental) {
|
||||||
// todo: feels dirty, can this be refactored?
|
// todo: feels dirty, can this be refactored?
|
||||||
val dirtySourcesSet = dirtySources.toHashSet()
|
val dirtySourcesSet = dirtySources.toHashSet()
|
||||||
val additionalDirtyFiles = additionalDirtyFiles(caches, generatedFiles).filter { it !in dirtySourcesSet }
|
val additionalDirtyFiles = additionalDirtyFiles(caches, generatedFiles, services).filter { it !in dirtySourcesSet }
|
||||||
if (additionalDirtyFiles.isNotEmpty()) {
|
if (additionalDirtyFiles.isNotEmpty()) {
|
||||||
dirtySources.addAll(additionalDirtyFiles)
|
dirtySources.addAll(additionalDirtyFiles)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (exitCode != ExitCode.OK) break
|
||||||
|
|
||||||
|
dirtySourcesSinceLastTimeFile.delete()
|
||||||
|
|
||||||
caches.platformCache.updateComplementaryFiles(dirtySources, expectActualTracker)
|
caches.platformCache.updateComplementaryFiles(dirtySources, expectActualTracker)
|
||||||
caches.inputsCache.registerOutputForSourceFiles(generatedFiles)
|
caches.inputsCache.registerOutputForSourceFiles(generatedFiles)
|
||||||
|
|||||||
+66
-16
@@ -26,10 +26,7 @@ import org.jetbrains.kotlin.config.IncrementalCompilation
|
|||||||
import org.jetbrains.kotlin.config.Services
|
import org.jetbrains.kotlin.config.Services
|
||||||
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
|
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
|
||||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalDataProvider
|
import org.jetbrains.kotlin.incremental.js.*
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalDataProviderFromCache
|
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer
|
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumerImpl
|
|
||||||
import org.jetbrains.kotlin.incremental.multiproject.EmptyModulesApiHistory
|
import org.jetbrains.kotlin.incremental.multiproject.EmptyModulesApiHistory
|
||||||
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistory
|
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistory
|
||||||
import org.jetbrains.kotlin.library.metadata.KlibMetadataSerializerProtocol
|
import org.jetbrains.kotlin.library.metadata.KlibMetadataSerializerProtocol
|
||||||
@@ -41,7 +38,8 @@ fun makeJsIncrementally(
|
|||||||
sourceRoots: Iterable<File>,
|
sourceRoots: Iterable<File>,
|
||||||
args: K2JSCompilerArguments,
|
args: K2JSCompilerArguments,
|
||||||
messageCollector: MessageCollector = MessageCollector.NONE,
|
messageCollector: MessageCollector = MessageCollector.NONE,
|
||||||
reporter: ICReporter = EmptyICReporter
|
reporter: ICReporter = EmptyICReporter,
|
||||||
|
scopeExpansion: CompileScopeExpansionMode = CompileScopeExpansionMode.NEVER
|
||||||
) {
|
) {
|
||||||
val allKotlinFiles = sourceRoots.asSequence().flatMap { it.walk() }
|
val allKotlinFiles = sourceRoots.asSequence().flatMap { it.walk() }
|
||||||
.filter { it.isFile && it.extension.equals("kt", ignoreCase = true) }.toList()
|
.filter { it.isFile && it.extension.equals("kt", ignoreCase = true) }.toList()
|
||||||
@@ -51,7 +49,8 @@ fun makeJsIncrementally(
|
|||||||
val compiler = IncrementalJsCompilerRunner(
|
val compiler = IncrementalJsCompilerRunner(
|
||||||
cachesDir, reporter,
|
cachesDir, reporter,
|
||||||
buildHistoryFile = buildHistoryFile,
|
buildHistoryFile = buildHistoryFile,
|
||||||
modulesApiHistory = EmptyModulesApiHistory
|
modulesApiHistory = EmptyModulesApiHistory,
|
||||||
|
scopeExpansion = scopeExpansion
|
||||||
)
|
)
|
||||||
compiler.compile(allKotlinFiles, args, messageCollector, providedChangedFiles = null)
|
compiler.compile(allKotlinFiles, args, messageCollector, providedChangedFiles = null)
|
||||||
}
|
}
|
||||||
@@ -72,7 +71,8 @@ class IncrementalJsCompilerRunner(
|
|||||||
workingDir: File,
|
workingDir: File,
|
||||||
reporter: ICReporter,
|
reporter: ICReporter,
|
||||||
buildHistoryFile: File,
|
buildHistoryFile: File,
|
||||||
private val modulesApiHistory: ModulesApiHistory
|
private val modulesApiHistory: ModulesApiHistory,
|
||||||
|
private val scopeExpansion: CompileScopeExpansionMode = CompileScopeExpansionMode.NEVER
|
||||||
) : IncrementalCompilerRunner<K2JSCompilerArguments, IncrementalJsCachesManager>(
|
) : IncrementalCompilerRunner<K2JSCompilerArguments, IncrementalJsCachesManager>(
|
||||||
workingDir,
|
workingDir,
|
||||||
"caches-js",
|
"caches-js",
|
||||||
@@ -129,17 +129,19 @@ class IncrementalJsCompilerRunner(
|
|||||||
lookupTracker: LookupTracker,
|
lookupTracker: LookupTracker,
|
||||||
expectActualTracker: ExpectActualTracker,
|
expectActualTracker: ExpectActualTracker,
|
||||||
caches: IncrementalJsCachesManager,
|
caches: IncrementalJsCachesManager,
|
||||||
compilationMode: CompilationMode
|
dirtySources: Set<File>,
|
||||||
|
isIncremental: Boolean
|
||||||
): Services.Builder =
|
): Services.Builder =
|
||||||
super.makeServices(args, lookupTracker, expectActualTracker, caches, compilationMode).apply {
|
super.makeServices(args, lookupTracker, expectActualTracker, caches, dirtySources, isIncremental).apply {
|
||||||
register(IncrementalResultsConsumer::class.java, IncrementalResultsConsumerImpl())
|
if (isIncremental) {
|
||||||
|
if (scopeExpansion == CompileScopeExpansionMode.ALWAYS) {
|
||||||
if (compilationMode is CompilationMode.Incremental) {
|
val nextRoundChecker = IncrementalNextRoundCheckerImpl(caches, dirtySources)
|
||||||
register(
|
register(IncrementalNextRoundChecker::class.java, nextRoundChecker)
|
||||||
IncrementalDataProvider::class.java,
|
}
|
||||||
IncrementalDataProviderFromCache(caches.platformCache)
|
register(IncrementalDataProvider::class.java, IncrementalDataProviderFromCache(caches.platformCache))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
register(IncrementalResultsConsumer::class.java, IncrementalResultsConsumerImpl())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateCaches(
|
override fun updateCaches(
|
||||||
@@ -173,4 +175,52 @@ class IncrementalJsCompilerRunner(
|
|||||||
args.freeArgs = freeArgsBackup
|
args.freeArgs = freeArgsBackup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun additionalDirtyFiles(
|
||||||
|
caches: IncrementalJsCachesManager,
|
||||||
|
generatedFiles: List<GeneratedFile>,
|
||||||
|
services: Services
|
||||||
|
): Iterable<File> {
|
||||||
|
val additionalDirtyFiles: Set<File> =
|
||||||
|
when (scopeExpansion) {
|
||||||
|
CompileScopeExpansionMode.ALWAYS ->
|
||||||
|
(services[IncrementalNextRoundChecker::class.java] as IncrementalNextRoundCheckerImpl).newDirtySources
|
||||||
|
CompileScopeExpansionMode.NEVER ->
|
||||||
|
emptySet()
|
||||||
|
}
|
||||||
|
|
||||||
|
return additionalDirtyFiles + super.additionalDirtyFiles(caches, generatedFiles, services)
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class IncrementalNextRoundCheckerImpl(
|
||||||
|
private val caches: IncrementalJsCachesManager,
|
||||||
|
private val sourcesToCompile: Set<File>
|
||||||
|
) : IncrementalNextRoundChecker {
|
||||||
|
val newDirtySources = HashSet<File>()
|
||||||
|
|
||||||
|
private val emptyByteArray = ByteArray(0)
|
||||||
|
private val translatedFiles = HashMap<File, TranslationResultValue>()
|
||||||
|
|
||||||
|
override fun checkProtoChanges(sourceFile: File, packagePartMetadata: ByteArray) {
|
||||||
|
translatedFiles[sourceFile] = TranslationResultValue(packagePartMetadata, emptyByteArray, emptyByteArray)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun shouldGoToNextRound(): Boolean {
|
||||||
|
val changesCollector = ChangesCollector()
|
||||||
|
// todo: split compare and update (or cache comparing)
|
||||||
|
caches.platformCache.compare(translatedFiles, changesCollector)
|
||||||
|
val (dirtyLookupSymbols, dirtyClassFqNames) = changesCollector.getDirtyData(listOf(caches.platformCache), reporter)
|
||||||
|
// todo unify with main cycle
|
||||||
|
newDirtySources.addAll(mapLookupSymbolsToFiles(caches.lookupCache, dirtyLookupSymbols, reporter, excludes = sourcesToCompile))
|
||||||
|
newDirtySources.addAll(
|
||||||
|
mapClassesFqNamesToFiles(
|
||||||
|
listOf(caches.platformCache),
|
||||||
|
dirtyClassFqNames,
|
||||||
|
reporter,
|
||||||
|
excludes = sourcesToCompile
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return newDirtySources.isNotEmpty()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+5
-3
@@ -272,7 +272,8 @@ class IncrementalJvmCompilerRunner(
|
|||||||
|
|
||||||
override fun additionalDirtyFiles(
|
override fun additionalDirtyFiles(
|
||||||
caches: IncrementalJvmCachesManager,
|
caches: IncrementalJvmCachesManager,
|
||||||
generatedFiles: List<GeneratedFile>
|
generatedFiles: List<GeneratedFile>,
|
||||||
|
services: Services
|
||||||
): Iterable<File> {
|
): Iterable<File> {
|
||||||
val cache = caches.platformCache
|
val cache = caches.platformCache
|
||||||
val result = HashSet<File>()
|
val result = HashSet<File>()
|
||||||
@@ -318,9 +319,10 @@ class IncrementalJvmCompilerRunner(
|
|||||||
lookupTracker: LookupTracker,
|
lookupTracker: LookupTracker,
|
||||||
expectActualTracker: ExpectActualTracker,
|
expectActualTracker: ExpectActualTracker,
|
||||||
caches: IncrementalJvmCachesManager,
|
caches: IncrementalJvmCachesManager,
|
||||||
compilationMode: CompilationMode
|
dirtySources: Set<File>,
|
||||||
|
isIncremental: Boolean
|
||||||
): Services.Builder =
|
): Services.Builder =
|
||||||
super.makeServices(args, lookupTracker, expectActualTracker, caches, compilationMode).apply {
|
super.makeServices(args, lookupTracker, expectActualTracker, caches, dirtySources, isIncremental).apply {
|
||||||
val targetId = TargetId(args.moduleName!!, "java-production")
|
val targetId = TargetId(args.moduleName!!, "java-production")
|
||||||
val targetToCache = mapOf(targetId to caches.platformCache)
|
val targetToCache = mapOf(targetId to caches.platformCache)
|
||||||
val incrementalComponents = IncrementalCompilationComponentsImpl(targetToCache)
|
val incrementalComponents = IncrementalCompilationComponentsImpl(targetToCache)
|
||||||
|
|||||||
+7
-2
@@ -27,12 +27,15 @@ abstract class AbstractIncrementalJsCompilerRunnerTest : AbstractIncrementalComp
|
|||||||
override fun make(cacheDir: File, sourceRoots: Iterable<File>, args: K2JSCompilerArguments): TestCompilationResult {
|
override fun make(cacheDir: File, sourceRoots: Iterable<File>, args: K2JSCompilerArguments): TestCompilationResult {
|
||||||
val reporter = TestICReporter()
|
val reporter = TestICReporter()
|
||||||
val messageCollector = TestMessageCollector()
|
val messageCollector = TestMessageCollector()
|
||||||
makeJsIncrementally(cacheDir, sourceRoots, args, reporter = reporter, messageCollector = messageCollector)
|
makeJsIncrementally(cacheDir, sourceRoots, args, messageCollector, reporter, scopeExpansionMode)
|
||||||
return TestCompilationResult(reporter, messageCollector)
|
return TestCompilationResult(reporter, messageCollector)
|
||||||
}
|
}
|
||||||
|
|
||||||
override val buildLogFinder: BuildLogFinder
|
override val buildLogFinder: BuildLogFinder
|
||||||
get() = super.buildLogFinder.copy(isJsEnabled = true)
|
get() = super.buildLogFinder.copy(
|
||||||
|
isJsEnabled = true,
|
||||||
|
isScopeExpansionEnabled = scopeExpansionMode != CompileScopeExpansionMode.NEVER
|
||||||
|
)
|
||||||
|
|
||||||
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =
|
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =
|
||||||
K2JSCompilerArguments().apply {
|
K2JSCompilerArguments().apply {
|
||||||
@@ -40,4 +43,6 @@ abstract class AbstractIncrementalJsCompilerRunnerTest : AbstractIncrementalComp
|
|||||||
sourceMap = true
|
sourceMap = true
|
||||||
metaInfo = true
|
metaInfo = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected open val scopeExpansionMode = CompileScopeExpansionMode.NEVER
|
||||||
}
|
}
|
||||||
+4
@@ -17,4 +17,8 @@ abstract class AbstractIncrementalJsKlibCompilerRunnerTest : AbstractIncremental
|
|||||||
|
|
||||||
override val buildLogFinder: BuildLogFinder
|
override val buildLogFinder: BuildLogFinder
|
||||||
get() = super.buildLogFinder.copy(isJsIrEnabled = true)
|
get() = super.buildLogFinder.copy(isJsIrEnabled = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest : AbstractIncrementalJsKlibCompilerRunnerTest() {
|
||||||
|
override val scopeExpansionMode = CompileScopeExpansionMode.ALWAYS
|
||||||
}
|
}
|
||||||
+894
@@ -0,0 +1,894 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 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.incremental;
|
||||||
|
|
||||||
|
import com.intellij.testFramework.TestDataPath;
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||||
|
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||||
|
import org.jetbrains.kotlin.test.TargetBackend;
|
||||||
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public class IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest {
|
||||||
|
@TestMetadata("jps-plugin/testData/incremental/pureKotlin")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class PureKotlin extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("accessingFunctionsViaPackagePart")
|
||||||
|
public void testAccessingFunctionsViaPackagePart() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/accessingFunctionsViaPackagePart/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("accessingPropertiesViaField")
|
||||||
|
public void testAccessingPropertiesViaField() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/accessingPropertiesViaField/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addClass")
|
||||||
|
public void testAddClass() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/addClass/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addFileWithFunctionOverload")
|
||||||
|
public void testAddFileWithFunctionOverload() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/addFileWithFunctionOverload/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addMemberTypeAlias")
|
||||||
|
public void testAddMemberTypeAlias() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/addMemberTypeAlias/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addTopLevelTypeAlias")
|
||||||
|
public void testAddTopLevelTypeAlias() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/addTopLevelTypeAlias/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("allConstants")
|
||||||
|
public void testAllConstants() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/allConstants/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInPureKotlin() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotations")
|
||||||
|
public void testAnnotations() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/annotations/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("anonymousObjectChanged")
|
||||||
|
public void testAnonymousObjectChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/anonymousObjectChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("changeTypeImplicitlyWithCircularDependency")
|
||||||
|
public void testChangeTypeImplicitlyWithCircularDependency() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/changeTypeImplicitlyWithCircularDependency/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("changeWithRemovingUsage")
|
||||||
|
public void testChangeWithRemovingUsage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/changeWithRemovingUsage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classInlineFunctionChanged")
|
||||||
|
public void testClassInlineFunctionChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/classInlineFunctionChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classObjectConstantChanged")
|
||||||
|
public void testClassObjectConstantChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/classObjectConstantChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classRecreated")
|
||||||
|
public void testClassRecreated() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/classRecreated/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classRemoved")
|
||||||
|
public void testClassRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/classRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classSignatureChanged")
|
||||||
|
public void testClassSignatureChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/classSignatureChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classSignatureUnchanged")
|
||||||
|
public void testClassSignatureUnchanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/classSignatureUnchanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compilationErrorThenFixedOtherPackage")
|
||||||
|
public void testCompilationErrorThenFixedOtherPackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/compilationErrorThenFixedOtherPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compilationErrorThenFixedSamePackage")
|
||||||
|
public void testCompilationErrorThenFixedSamePackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/compilationErrorThenFixedSamePackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compilationErrorThenFixedWithPhantomPart")
|
||||||
|
public void testCompilationErrorThenFixedWithPhantomPart() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/compilationErrorThenFixedWithPhantomPart/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compilationErrorThenFixedWithPhantomPart2")
|
||||||
|
public void testCompilationErrorThenFixedWithPhantomPart2() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/compilationErrorThenFixedWithPhantomPart2/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compilationErrorThenFixedWithPhantomPart3")
|
||||||
|
public void testCompilationErrorThenFixedWithPhantomPart3() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/compilationErrorThenFixedWithPhantomPart3/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("constantRemoved")
|
||||||
|
public void testConstantRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/constantRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("constantValueChanged")
|
||||||
|
public void testConstantValueChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/constantValueChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("constantsUnchanged")
|
||||||
|
public void testConstantsUnchanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/constantsUnchanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultArgumentInConstructorAdded")
|
||||||
|
public void testDefaultArgumentInConstructorAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultArgumentInConstructorAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultArgumentInConstructorRemoved")
|
||||||
|
public void testDefaultArgumentInConstructorRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultArgumentInConstructorRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultValueAdded")
|
||||||
|
public void testDefaultValueAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultValueAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultValueChanged")
|
||||||
|
public void testDefaultValueChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultValueChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultValueInConstructorChanged")
|
||||||
|
public void testDefaultValueInConstructorChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultValueInConstructorChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultValueInConstructorRemoved")
|
||||||
|
public void testDefaultValueInConstructorRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultValueInConstructorRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultValueRemoved1")
|
||||||
|
public void testDefaultValueRemoved1() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultValueRemoved1/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("defaultValueRemoved2")
|
||||||
|
public void testDefaultValueRemoved2() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/defaultValueRemoved2/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("delegatedPropertyInlineExtensionAccessor")
|
||||||
|
public void testDelegatedPropertyInlineExtensionAccessor() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("delegatedPropertyInlineMethodAccessor")
|
||||||
|
public void testDelegatedPropertyInlineMethodAccessor() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("dependencyClassReferenced")
|
||||||
|
public void testDependencyClassReferenced() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/dependencyClassReferenced/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fileWithConstantRemoved")
|
||||||
|
public void testFileWithConstantRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/fileWithConstantRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fileWithInlineFunctionRemoved")
|
||||||
|
public void testFileWithInlineFunctionRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/fileWithInlineFunctionRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("filesExchangePackages")
|
||||||
|
public void testFilesExchangePackages() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/filesExchangePackages/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("funRedeclaration")
|
||||||
|
public void testFunRedeclaration() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/funRedeclaration/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("funVsConstructorOverloadConflict")
|
||||||
|
public void testFunVsConstructorOverloadConflict() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/funVsConstructorOverloadConflict/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionBecameInline")
|
||||||
|
public void testFunctionBecameInline() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/functionBecameInline/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionReferencingClass")
|
||||||
|
public void testFunctionReferencingClass() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/functionReferencingClass/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("independentClasses")
|
||||||
|
public void testIndependentClasses() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/independentClasses/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFunctionBecomesNonInline")
|
||||||
|
public void testInlineFunctionBecomesNonInline() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineFunctionBecomesNonInline/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFunctionUsageAdded")
|
||||||
|
public void testInlineFunctionUsageAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineFunctionUsageAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFunctionsCircularDependency")
|
||||||
|
public void testInlineFunctionsCircularDependency() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineFunctionsCircularDependency/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFunctionsUnchanged")
|
||||||
|
public void testInlineFunctionsUnchanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineFunctionsUnchanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineLinesChanged")
|
||||||
|
public void testInlineLinesChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineLinesChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineModifiedWithUsage")
|
||||||
|
public void testInlineModifiedWithUsage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineModifiedWithUsage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlinePrivateFunctionAdded")
|
||||||
|
public void testInlinePrivateFunctionAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlinePrivateFunctionAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlinePropertyInClass")
|
||||||
|
public void testInlinePropertyInClass() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlinePropertyInClass/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlinePropertyOnTopLevel")
|
||||||
|
public void testInlinePropertyOnTopLevel() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlinePropertyOnTopLevel/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineSuspendFunctionChanged")
|
||||||
|
public void testInlineSuspendFunctionChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineSuspendFunctionChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineTwoFunctionsOneChanged")
|
||||||
|
public void testInlineTwoFunctionsOneChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineTwoFunctionsOneChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineUsedWhereDeclared")
|
||||||
|
public void testInlineUsedWhereDeclared() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/inlineUsedWhereDeclared/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("internalClassChanged")
|
||||||
|
public void testInternalClassChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/internalClassChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("internalMemberInClassChanged")
|
||||||
|
public void testInternalMemberInClassChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/internalMemberInClassChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("internalTypealias")
|
||||||
|
public void testInternalTypealias() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/internalTypealias/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("internalTypealiasConstructor")
|
||||||
|
public void testInternalTypealiasConstructor() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/internalTypealiasConstructor/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("internalTypealiasObject")
|
||||||
|
public void testInternalTypealiasObject() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/internalTypealiasObject/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("localClassChanged")
|
||||||
|
public void testLocalClassChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/localClassChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("moveClass")
|
||||||
|
public void testMoveClass() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/moveClass/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("moveFileWithChangingPackage")
|
||||||
|
public void testMoveFileWithChangingPackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/moveFileWithChangingPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("moveFileWithoutChangingPackage")
|
||||||
|
public void testMoveFileWithoutChangingPackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/moveFileWithoutChangingPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("multiplePackagesModified")
|
||||||
|
public void testMultiplePackagesModified() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/multiplePackagesModified/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("objectConstantChanged")
|
||||||
|
public void testObjectConstantChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/objectConstantChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ourClassReferenced")
|
||||||
|
public void testOurClassReferenced() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/ourClassReferenced/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("overloadInlined")
|
||||||
|
public void testOverloadInlined() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/overloadInlined/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageConstantChanged")
|
||||||
|
public void testPackageConstantChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageConstantChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageFileAdded")
|
||||||
|
public void testPackageFileAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageFileAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageFileChangedPackage")
|
||||||
|
public void testPackageFileChangedPackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageFileChangedPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageFileChangedThenOtherRemoved")
|
||||||
|
public void testPackageFileChangedThenOtherRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageFileChangedThenOtherRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageFileRemoved")
|
||||||
|
public void testPackageFileRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageFileRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageFilesChangedInTurn")
|
||||||
|
public void testPackageFilesChangedInTurn() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageFilesChangedInTurn/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageInlineFunctionAccessingField")
|
||||||
|
public void testPackageInlineFunctionAccessingField() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageInlineFunctionAccessingField/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageInlineFunctionFromOurPackage")
|
||||||
|
public void testPackageInlineFunctionFromOurPackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageInlineFunctionFromOurPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packagePrivateOnlyChanged")
|
||||||
|
public void testPackagePrivateOnlyChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packagePrivateOnlyChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageRecreated")
|
||||||
|
public void testPackageRecreated() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageRecreated/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageRecreatedAfterRenaming")
|
||||||
|
public void testPackageRecreatedAfterRenaming() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageRecreatedAfterRenaming/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageRemoved")
|
||||||
|
public void testPackageRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateConstantsChanged")
|
||||||
|
public void testPrivateConstantsChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateMethodAdded")
|
||||||
|
public void testPrivateMethodAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateMethodAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateMethodDeleted")
|
||||||
|
public void testPrivateMethodDeleted() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateMethodDeleted/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateMethodSignatureChanged")
|
||||||
|
public void testPrivateMethodSignatureChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateMethodSignatureChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateSecondaryConstructorAdded")
|
||||||
|
public void testPrivateSecondaryConstructorAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateSecondaryConstructorAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateSecondaryConstructorDeleted")
|
||||||
|
public void testPrivateSecondaryConstructorDeleted() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateSecondaryConstructorDeleted/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateValAccessorChanged")
|
||||||
|
public void testPrivateValAccessorChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateValAccessorChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateValAdded")
|
||||||
|
public void testPrivateValAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateValAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateValDeleted")
|
||||||
|
public void testPrivateValDeleted() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateValDeleted/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateValSignatureChanged")
|
||||||
|
public void testPrivateValSignatureChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateValSignatureChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateVarAdded")
|
||||||
|
public void testPrivateVarAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateVarAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateVarDeleted")
|
||||||
|
public void testPrivateVarDeleted() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateVarDeleted/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateVarSignatureChanged")
|
||||||
|
public void testPrivateVarSignatureChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/privateVarSignatureChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyRedeclaration")
|
||||||
|
public void testPropertyRedeclaration() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/propertyRedeclaration/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("publicPropertyWithPrivateSetter")
|
||||||
|
public void testPublicPropertyWithPrivateSetter() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/publicPropertyWithPrivateSetter/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeAndRestoreCompanion")
|
||||||
|
public void testRemoveAndRestoreCompanion() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeAndRestoreCompanion/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeAndRestoreCompanionWithImplicitUsages")
|
||||||
|
public void testRemoveAndRestoreCompanionWithImplicitUsages() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeAndRestoreCompanionWithImplicitUsages/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeClass")
|
||||||
|
public void testRemoveClass() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeClass/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeClassInDefaultPackage")
|
||||||
|
public void testRemoveClassInDefaultPackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeClassInDefaultPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeFileWithFunctionOverload")
|
||||||
|
public void testRemoveFileWithFunctionOverload() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeFileWithFunctionOverload/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeMemberTypeAlias")
|
||||||
|
public void testRemoveMemberTypeAlias() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeMemberTypeAlias/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeTopLevelTypeAlias")
|
||||||
|
public void testRemoveTopLevelTypeAlias() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeTopLevelTypeAlias/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeUnusedFile")
|
||||||
|
public void testRemoveUnusedFile() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/removeUnusedFile/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("renameClass")
|
||||||
|
public void testRenameClass() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/renameClass/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("renameFileWithFunctionOverload")
|
||||||
|
public void testRenameFileWithFunctionOverload() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/renameFileWithFunctionOverload/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("returnTypeChanged")
|
||||||
|
public void testReturnTypeChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/returnTypeChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("secondaryConstructorInlined")
|
||||||
|
public void testSecondaryConstructorInlined() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/secondaryConstructorInlined/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simpleClassDependency")
|
||||||
|
public void testSimpleClassDependency() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/simpleClassDependency/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("soleFileChangesPackage")
|
||||||
|
public void testSoleFileChangesPackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/soleFileChangesPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("subpackage")
|
||||||
|
public void testSubpackage() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/subpackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendWithStateMachine")
|
||||||
|
public void testSuspendWithStateMachine() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/suspendWithStateMachine/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("topLevelFunctionSameSignature")
|
||||||
|
public void testTopLevelFunctionSameSignature() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/topLevelFunctionSameSignature/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("topLevelMembersInTwoFiles")
|
||||||
|
public void testTopLevelMembersInTwoFiles() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/topLevelMembersInTwoFiles/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("topLevelPrivateValUsageAdded")
|
||||||
|
public void testTopLevelPrivateValUsageAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/topLevelPrivateValUsageAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("traitClassObjectConstantChanged")
|
||||||
|
public void testTraitClassObjectConstantChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valAddCustomAccessor")
|
||||||
|
public void testValAddCustomAccessor() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/valAddCustomAccessor/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valRemoveCustomAccessor")
|
||||||
|
public void testValRemoveCustomAccessor() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/pureKotlin/valRemoveCustomAccessor/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("jps-plugin/testData/incremental/classHierarchyAffected")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class ClassHierarchyAffected extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInClassHierarchyAffected() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotationFlagRemoved")
|
||||||
|
public void testAnnotationFlagRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/annotationFlagRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotationListChanged")
|
||||||
|
public void testAnnotationListChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/annotationListChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("bridgeGenerated")
|
||||||
|
public void testBridgeGenerated() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/bridgeGenerated/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classBecameFinal")
|
||||||
|
public void testClassBecameFinal() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/classBecameFinal/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classBecameInterface")
|
||||||
|
public void testClassBecameInterface() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/classBecameInterface/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classBecamePrivate")
|
||||||
|
public void testClassBecamePrivate() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/classBecamePrivate/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classMovedIntoOtherClass")
|
||||||
|
public void testClassMovedIntoOtherClass() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/classMovedIntoOtherClass/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classRemoved")
|
||||||
|
public void testClassRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/classRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classRemovedAndRestored")
|
||||||
|
public void testClassRemovedAndRestored() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/classRemovedAndRestored/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionObjectInheritedMemberChanged")
|
||||||
|
public void testCompanionObjectInheritedMemberChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectInheritedMemberChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionObjectMemberChanged")
|
||||||
|
public void testCompanionObjectMemberChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectMemberChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionObjectNameChanged")
|
||||||
|
public void testCompanionObjectNameChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectNameChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionObjectToSimpleObject")
|
||||||
|
public void testCompanionObjectToSimpleObject() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectToSimpleObject/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("constructorVisibilityChanged")
|
||||||
|
public void testConstructorVisibilityChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/constructorVisibilityChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumEntryAdded")
|
||||||
|
public void testEnumEntryAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumEntryRemoved")
|
||||||
|
public void testEnumEntryRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/enumEntryRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumMemberChanged")
|
||||||
|
public void testEnumMemberChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/enumMemberChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("flagsAndMemberInDifferentClassesChanged")
|
||||||
|
public void testFlagsAndMemberInDifferentClassesChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInDifferentClassesChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("flagsAndMemberInSameClassChanged")
|
||||||
|
public void testFlagsAndMemberInSameClassChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInSameClassChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("implcitUpcast")
|
||||||
|
public void testImplcitUpcast() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/implcitUpcast/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inferredTypeArgumentChanged")
|
||||||
|
public void testInferredTypeArgumentChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/inferredTypeArgumentChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inferredTypeChanged")
|
||||||
|
public void testInferredTypeChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/inferredTypeChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("lambdaParameterAffected")
|
||||||
|
public void testLambdaParameterAffected() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/lambdaParameterAffected/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodAdded")
|
||||||
|
public void testMethodAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/methodAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodAnnotationAdded")
|
||||||
|
public void testMethodAnnotationAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/methodAnnotationAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodNullabilityChanged")
|
||||||
|
public void testMethodNullabilityChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/methodNullabilityChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodParameterWithDefaultValueAdded")
|
||||||
|
public void testMethodParameterWithDefaultValueAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/methodParameterWithDefaultValueAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodRemoved")
|
||||||
|
public void testMethodRemoved() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/methodRemoved/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("overrideExplicit")
|
||||||
|
public void testOverrideExplicit() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/overrideExplicit/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("overrideImplicit")
|
||||||
|
public void testOverrideImplicit() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/overrideImplicit/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyNullabilityChanged")
|
||||||
|
public void testPropertyNullabilityChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/propertyNullabilityChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("sealedClassImplAdded")
|
||||||
|
public void testSealedClassImplAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassImplAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("sealedClassIndirectImplAdded")
|
||||||
|
public void testSealedClassIndirectImplAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassIndirectImplAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("sealedClassNestedImplAdded")
|
||||||
|
public void testSealedClassNestedImplAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassNestedImplAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("secondaryConstructorAdded")
|
||||||
|
public void testSecondaryConstructorAdded() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/secondaryConstructorAdded/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("starProjectionUpperBoundChanged")
|
||||||
|
public void testStarProjectionUpperBoundChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/starProjectionUpperBoundChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("supertypesListChanged")
|
||||||
|
public void testSupertypesListChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/supertypesListChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeParameterListChanged")
|
||||||
|
public void testTypeParameterListChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/typeParameterListChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("varianceChanged")
|
||||||
|
public void testVarianceChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/classHierarchyAffected/varianceChanged/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("jps-plugin/testData/incremental/js")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Js extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInJs() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/js"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFunctionLocalDeclarationChanges")
|
||||||
|
public void testInlineFunctionLocalDeclarationChanges() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/js/inlineFunctionLocalDeclarationChanges/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("jps-plugin/testData/incremental/js/friendsModuleDisabled")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class FriendsModuleDisabled extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInFriendsModuleDisabled() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/js/friendsModuleDisabled"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("internalInlineFunctionIsChanged")
|
||||||
|
public void testInternalInlineFunctionIsChanged() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/js/friendsModuleDisabled/internalInlineFunctionIsChanged/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("jps-plugin/testData/incremental/js/friendsModuleDisabled/internalInlineFunctionIsChanged")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class InternalInlineFunctionIsChanged extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInInternalInlineFunctionIsChanged() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/js/friendsModuleDisabled/internalInlineFunctionIsChanged"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("jps-plugin/testData/incremental/js/inlineFunctionLocalDeclarationChanges")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class InlineFunctionLocalDeclarationChanges extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInInlineFunctionLocalDeclarationChanges() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/js/inlineFunctionLocalDeclarationChanges"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.ir.backend.js
|
|||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.openapi.vfs.VfsUtilCore
|
import com.intellij.openapi.vfs.VfsUtilCore
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
|
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
||||||
import org.jetbrains.kotlin.backend.common.LoggingContext
|
import org.jetbrains.kotlin.backend.common.LoggingContext
|
||||||
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
||||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||||
@@ -19,6 +20,8 @@ import org.jetbrains.kotlin.backend.common.serialization.metadata.KlibMetadataVe
|
|||||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||||
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
||||||
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
|
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
|
||||||
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||||
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||||
import org.jetbrains.kotlin.config.*
|
import org.jetbrains.kotlin.config.*
|
||||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||||
@@ -42,7 +45,8 @@ import org.jetbrains.kotlin.library.impl.buildKoltinLibrary
|
|||||||
import org.jetbrains.kotlin.library.impl.createKotlinLibrary
|
import org.jetbrains.kotlin.library.impl.createKotlinLibrary
|
||||||
import org.jetbrains.kotlin.library.resolver.KotlinLibraryResolveResult
|
import org.jetbrains.kotlin.library.resolver.KotlinLibraryResolveResult
|
||||||
import org.jetbrains.kotlin.library.resolver.TopologicalLibraryOrder
|
import org.jetbrains.kotlin.library.resolver.TopologicalLibraryOrder
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.metadata.ProtoBuf
|
||||||
|
import org.jetbrains.kotlin.progress.IncrementalNextRoundException
|
||||||
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
|
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
|
||||||
import org.jetbrains.kotlin.psi.KtFile
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
import org.jetbrains.kotlin.psi2ir.Psi2IrConfiguration
|
import org.jetbrains.kotlin.psi2ir.Psi2IrConfiguration
|
||||||
@@ -54,6 +58,8 @@ import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
|||||||
import org.jetbrains.kotlin.storage.StorageManager
|
import org.jetbrains.kotlin.storage.StorageManager
|
||||||
import org.jetbrains.kotlin.utils.DFS
|
import org.jetbrains.kotlin.utils.DFS
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
import org.jetbrains.kotlin.konan.file.File as KFile
|
import org.jetbrains.kotlin.konan.file.File as KFile
|
||||||
|
|
||||||
|
|
||||||
@@ -357,12 +363,16 @@ private class ModulesStructure(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val analysisResult = analyzerWithCompilerReport.analysisResult
|
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
||||||
|
|
||||||
|
val analysisResult = analyzerWithCompilerReport.analysisResult
|
||||||
|
if (IncrementalCompilation.isEnabledForJs()) {
|
||||||
|
/** can throw [IncrementalNextRoundException] */
|
||||||
|
compareMetadataAndGoToNextICRoundIfNeeded(analysisResult, compilerConfiguration, files)
|
||||||
|
}
|
||||||
if (analyzerWithCompilerReport.hasErrors() || analysisResult !is JsAnalysisResult)
|
if (analyzerWithCompilerReport.hasErrors() || analysisResult !is JsAnalysisResult)
|
||||||
throw JsIrCompilationError
|
throw JsIrCompilationError
|
||||||
|
|
||||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
|
||||||
TopDownAnalyzerFacadeForJSIR.checkForErrors(files, analysisResult.bindingContext)
|
TopDownAnalyzerFacadeForJSIR.checkForErrors(files, analysisResult.bindingContext)
|
||||||
|
|
||||||
return analysisResult
|
return analysisResult
|
||||||
@@ -424,24 +434,7 @@ fun serializeModuleIntoKlib(
|
|||||||
JsIrModuleSerializer(emptyLoggingContext, moduleFragment.irBuiltins, descriptorTable, skipExpects = !configuration.klibMpp, expectDescriptorToSymbol = expectDescriptorToSymbol).serializedIrModule(moduleFragment)
|
JsIrModuleSerializer(emptyLoggingContext, moduleFragment.irBuiltins, descriptorTable, skipExpects = !configuration.klibMpp, expectDescriptorToSymbol = expectDescriptorToSymbol).serializedIrModule(moduleFragment)
|
||||||
|
|
||||||
val moduleDescriptor = moduleFragment.descriptor
|
val moduleDescriptor = moduleFragment.descriptor
|
||||||
|
val metadataSerializer = KlibMetadataIncrementalSerializer(configuration, descriptorTable)
|
||||||
val metadataVersion = configuration.metadataVersion
|
|
||||||
val languageVersionSettings = configuration.languageVersionSettings
|
|
||||||
|
|
||||||
val metadataSerializer = KlibMetadataIncrementalSerializer(
|
|
||||||
languageVersionSettings,
|
|
||||||
metadataVersion,
|
|
||||||
descriptorTable,
|
|
||||||
skipExpects = !configuration.klibMpp
|
|
||||||
)
|
|
||||||
|
|
||||||
fun serializeScope(fqName: FqName, memberScope: Collection<DeclarationDescriptor>): ByteArray {
|
|
||||||
return metadataSerializer.serializePackageFragment(
|
|
||||||
moduleDescriptor,
|
|
||||||
memberScope,
|
|
||||||
fqName
|
|
||||||
).toByteArray()
|
|
||||||
}
|
|
||||||
|
|
||||||
val incrementalResultsConsumer = configuration.get(JSConfigurationKeys.INCREMENTAL_RESULTS_CONSUMER)
|
val incrementalResultsConsumer = configuration.get(JSConfigurationKeys.INCREMENTAL_RESULTS_CONSUMER)
|
||||||
val empty = ByteArray(0)
|
val empty = ByteArray(0)
|
||||||
@@ -464,9 +457,8 @@ fun serializeModuleIntoKlib(
|
|||||||
Ir: ${binaryFile.path}
|
Ir: ${binaryFile.path}
|
||||||
""".trimMargin()
|
""".trimMargin()
|
||||||
}
|
}
|
||||||
val memberScope = ktFile.declarations.map { getDescriptorForElement(bindingContext, it) }
|
val packageFragment = metadataSerializer.serializeScope(ktFile, bindingContext, moduleDescriptor)
|
||||||
val packageFragment = serializeScope(ktFile.packageFqName, memberScope)
|
val compiledKotlinFile = KotlinFileSerializedData(packageFragment.toByteArray(), binaryFile)
|
||||||
val compiledKotlinFile = KotlinFileSerializedData(packageFragment, binaryFile)
|
|
||||||
|
|
||||||
additionalFiles += compiledKotlinFile
|
additionalFiles += compiledKotlinFile
|
||||||
processCompiledFileData(VfsUtilCore.virtualToIoFile(ktFile.virtualFile), compiledKotlinFile)
|
processCompiledFileData(VfsUtilCore.virtualToIoFile(ktFile.virtualFile), compiledKotlinFile)
|
||||||
@@ -511,3 +503,55 @@ fun serializeModuleIntoKlib(
|
|||||||
versions = versions
|
versions = versions
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun KlibMetadataIncrementalSerializer.serializeScope(
|
||||||
|
ktFile: KtFile,
|
||||||
|
bindingContext: BindingContext,
|
||||||
|
moduleDescriptor: ModuleDescriptor
|
||||||
|
): ProtoBuf.PackageFragment {
|
||||||
|
val memberScope = ktFile.declarations.map { getDescriptorForElement(bindingContext, it) }
|
||||||
|
return serializePackageFragment(moduleDescriptor, memberScope, ktFile.packageFqName)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun compareMetadataAndGoToNextICRoundIfNeeded(
|
||||||
|
analysisResult: AnalysisResult,
|
||||||
|
config: CompilerConfiguration,
|
||||||
|
files: List<KtFile>
|
||||||
|
) {
|
||||||
|
val nextRoundChecker = config.get(JSConfigurationKeys.INCREMENTAL_NEXT_ROUND_CHECKER) ?: return
|
||||||
|
val bindingContext = analysisResult.bindingContext
|
||||||
|
val serializer = KlibMetadataIncrementalSerializer(config, FakeDescriptorTable())
|
||||||
|
for (ktFile in files) {
|
||||||
|
val packageFragment = serializer.serializeScope(ktFile, bindingContext, analysisResult.moduleDescriptor)
|
||||||
|
// to minimize a number of IC rounds, we should inspect all proto for changes first,
|
||||||
|
// then go to a next round if needed, with all new dirty files
|
||||||
|
nextRoundChecker.checkProtoChanges(VfsUtilCore.virtualToIoFile(ktFile.virtualFile), packageFragment.toByteArray())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextRoundChecker.shouldGoToNextRound()) throw IncrementalNextRoundException()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A hack to serialize metadata to compare it with cached proto before frontend errors are reported.
|
||||||
|
* DescriptorUniqId is not used during comparison, so fake IDs can be used to satisfy [KlibMetadataIncrementalSerializer] interface.
|
||||||
|
*/
|
||||||
|
private class FakeDescriptorTable : DescriptorTable {
|
||||||
|
private val descriptors = mutableMapOf<DeclarationDescriptor, Long>()
|
||||||
|
|
||||||
|
override fun put(descriptor: DeclarationDescriptor, uniqId: UniqId) {
|
||||||
|
throw NotImplementedError("FakeDescriptorTable#put is not expected to be called!")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun get(descriptor: DeclarationDescriptor): Long =
|
||||||
|
descriptors.getOrPut(descriptor) { descriptors.size.toLong() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun KlibMetadataIncrementalSerializer(
|
||||||
|
configuration: CompilerConfiguration,
|
||||||
|
descriptorTable: DescriptorTable
|
||||||
|
) = KlibMetadataIncrementalSerializer(
|
||||||
|
languageVersionSettings = configuration.languageVersionSettings,
|
||||||
|
metadataVersion = configuration.metadataVersion,
|
||||||
|
descriptorTable = descriptorTable,
|
||||||
|
skipExpects = !configuration.klibMpp
|
||||||
|
)
|
||||||
@@ -19,7 +19,9 @@ package org.jetbrains.kotlin.progress
|
|||||||
import com.intellij.openapi.progress.ProcessCanceledException
|
import com.intellij.openapi.progress.ProcessCanceledException
|
||||||
import com.intellij.openapi.progress.ProgressIndicatorProvider
|
import com.intellij.openapi.progress.ProgressIndicatorProvider
|
||||||
|
|
||||||
class CompilationCanceledException : ProcessCanceledException()
|
open class CompilationCanceledException : ProcessCanceledException()
|
||||||
|
|
||||||
|
class IncrementalNextRoundException : CompilationCanceledException()
|
||||||
|
|
||||||
interface CompilationCanceledStatus {
|
interface CompilationCanceledStatus {
|
||||||
fun checkCanceled(): Unit
|
fun checkCanceled(): Unit
|
||||||
|
|||||||
@@ -1230,6 +1230,12 @@ fun main(args: Array<String>) {
|
|||||||
model("incremental/js", extension = null, excludeParentDirs = true)
|
model("incremental/js", extension = null, excludeParentDirs = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testClass<AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest> {
|
||||||
|
model("incremental/pureKotlin", extension = null, recursive = false)
|
||||||
|
model("incremental/classHierarchyAffected", extension = null, recursive = false)
|
||||||
|
model("incremental/js", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
|
||||||
testClass<AbstractIncrementalJsCompilerRunnerWithFriendModulesDisabledTest> {
|
testClass<AbstractIncrementalJsCompilerRunnerWithFriendModulesDisabledTest> {
|
||||||
model("incremental/js/friendsModuleDisabled", extension = null, recursive = false)
|
model("incremental/js/friendsModuleDisabled", extension = null, recursive = false)
|
||||||
}
|
}
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/Enum.kt
|
||||||
|
src/getRandomEnumEntry.kt
|
||||||
|
src/use.kt
|
||||||
|
src/useEnumImplicitly.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ABORT
|
||||||
|
------------------------------------------
|
||||||
|
COMPILATION FAILED
|
||||||
|
Unresolved reference: C
|
||||||
|
|
||||||
|
================ Step #2 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/Enum.kt
|
||||||
|
src/getRandomEnumEntry.kt
|
||||||
|
src/use.kt
|
||||||
|
src/useEnumImplicitly.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/A.kt
|
||||||
|
src/AChild.kt
|
||||||
|
src/AConstructorFunction.kt
|
||||||
|
src/createAFromInt.kt
|
||||||
|
src/createAFromString.kt
|
||||||
|
src/useA.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ABORT
|
||||||
|
------------------------------------------
|
||||||
|
COMPILATION FAILED
|
||||||
|
Conflicting overloads: public constructor A(x: String) defined in A, public fun A(x: String): A defined in root package
|
||||||
|
|
||||||
|
================ Step #2 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/A.kt
|
||||||
|
src/AChild.kt
|
||||||
|
src/createAFromInt.kt
|
||||||
|
src/createAFromString.kt
|
||||||
|
src/useA.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/fun1.kt
|
||||||
|
src/fun2.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ABORT
|
||||||
|
------------------------------------------
|
||||||
|
COMPILATION FAILED
|
||||||
|
Conflicting overloads: public fun function(): Unit defined in test in file fun2.kt, public fun function(): Unit defined in test
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun dummy() {}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/fun1.kt
|
||||||
|
src/fun2.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ABORT
|
||||||
|
------------------------------------------
|
||||||
|
COMPILATION FAILED
|
||||||
|
Conflicting overloads: public constructor function() defined in test.function, public fun function(): Unit defined in test
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun dummy() {}
|
||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/prop1.kt
|
||||||
|
src/prop2.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ABORT
|
||||||
|
------------------------------------------
|
||||||
|
COMPILATION FAILED
|
||||||
|
Conflicting declarations: public val prop1: Int, public val prop1: Int
|
||||||
@@ -10,4 +10,4 @@ End of files
|
|||||||
Exit code: ABORT
|
Exit code: ABORT
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
COMPILATION FAILED
|
COMPILATION FAILED
|
||||||
Conflicting declarations: public val property: Int, public val property: Int
|
Conflicting declarations: public val prop1: Int, public val prop1: Int
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun dummy() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
val property = 1
|
val prop1 = 1
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
fun dummy() {
|
val prop2 = 2
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+2
-5
@@ -1,7 +1,4 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
fun dummy() {
|
val prop1 = 1
|
||||||
|
val prop2 = 2
|
||||||
}
|
|
||||||
|
|
||||||
val property = 1
|
|
||||||
+6
-1
@@ -54,6 +54,11 @@ interface IncrementalResultsConsumer {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IncrementalNextRoundChecker {
|
||||||
|
fun checkProtoChanges(sourceFile: File, packagePartMetadata: ByteArray)
|
||||||
|
fun shouldGoToNextRound(): Boolean
|
||||||
|
}
|
||||||
|
|
||||||
class JsInlineFunctionHash(val sourceFilePath: String, val fqName: String, val inlineFunctionMd5Hash: Long): Serializable
|
class JsInlineFunctionHash(val sourceFilePath: String, val fqName: String, val inlineFunctionMd5Hash: Long): Serializable
|
||||||
|
|
||||||
class FunctionWithSourceInfo(val expression: Any, val line: Int, val column: Int) {
|
class FunctionWithSourceInfo(val expression: Any, val line: Int, val column: Int) {
|
||||||
@@ -61,7 +66,7 @@ class FunctionWithSourceInfo(val expression: Any, val line: Int, val column: Int
|
|||||||
get() = "($line:$column)$expression".toByteArray().md5()
|
get() = "($line:$column)$expression".toByteArray().md5()
|
||||||
}
|
}
|
||||||
|
|
||||||
class IncrementalResultsConsumerImpl : IncrementalResultsConsumer {
|
open class IncrementalResultsConsumerImpl : IncrementalResultsConsumer {
|
||||||
lateinit var headerMetadata: ByteArray
|
lateinit var headerMetadata: ByteArray
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.js.config;
|
package org.jetbrains.kotlin.js.config;
|
||||||
|
|
||||||
import org.jetbrains.kotlin.config.CompilerConfigurationKey;
|
import org.jetbrains.kotlin.config.CompilerConfigurationKey;
|
||||||
|
import org.jetbrains.kotlin.incremental.js.IncrementalNextRoundChecker;
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalDataProvider;
|
import org.jetbrains.kotlin.incremental.js.IncrementalDataProvider;
|
||||||
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer;
|
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer;
|
||||||
import org.jetbrains.kotlin.serialization.js.ModuleKind;
|
import org.jetbrains.kotlin.serialization.js.ModuleKind;
|
||||||
@@ -65,6 +66,9 @@ public class JSConfigurationKeys {
|
|||||||
public static final CompilerConfigurationKey<IncrementalResultsConsumer> INCREMENTAL_RESULTS_CONSUMER =
|
public static final CompilerConfigurationKey<IncrementalResultsConsumer> INCREMENTAL_RESULTS_CONSUMER =
|
||||||
CompilerConfigurationKey.create("incremental results consumer");
|
CompilerConfigurationKey.create("incremental results consumer");
|
||||||
|
|
||||||
|
public static final CompilerConfigurationKey<IncrementalNextRoundChecker> INCREMENTAL_NEXT_ROUND_CHECKER =
|
||||||
|
CompilerConfigurationKey.create("incremental compilation next round checker");
|
||||||
|
|
||||||
public static final CompilerConfigurationKey<Boolean> FRIEND_PATHS_DISABLED =
|
public static final CompilerConfigurationKey<Boolean> FRIEND_PATHS_DISABLED =
|
||||||
CompilerConfigurationKey.create("disable support for friend paths");
|
CompilerConfigurationKey.create("disable support for friend paths");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user