Compare commits

..

2 Commits

Author SHA1 Message Date
Ilya Gorbunov
8b3380dec0 ~ refactor test a bit 2020-12-04 12:06:50 +03:00
Ilya Gorbunov
fd70c33cc3 Revert using regex Pattern in String.replace
Use String.indexOf(..., ignoreCase) instead in all branches to preserve
compatibility with behavior before 1.4.20 that used String.split which
essentially relied on that String.indexOf
2020-12-04 11:52:23 +03:00
81 changed files with 162 additions and 2213 deletions

View File

@@ -23,13 +23,11 @@ data class BuildLogFinder(
private val isGradleEnabled: Boolean = false,
private val isJsEnabled: Boolean = false,
private val isJsIrEnabled: Boolean = false, // TODO rename as it is used for metadata-only test
private val isScopeExpansionEnabled: Boolean = false,
private val isKlibEnabled: Boolean = false
private val isScopeExpansionEnabled: Boolean = false
) {
companion object {
private const val JS_LOG = "js-build.log"
private const val JS_IR_LOG = "js-ir-build.log"
private const val KLIB_LOG = "klib-build.log"
private const val SCOPE_EXPANDING_LOG = "build-with-scope-expansion.log"
private const val GRADLE_LOG = "gradle-build.log"
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
@@ -46,7 +44,6 @@ data class BuildLogFinder(
val matchedName = when {
isScopeExpansionEnabled && SCOPE_EXPANDING_LOG in files -> SCOPE_EXPANDING_LOG
isJsIrEnabled && JS_IR_LOG in files -> JS_IR_LOG
isKlibEnabled && KLIB_LOG in files -> KLIB_LOG
isJsEnabled && JS_LOG in files -> JS_LOG
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isJsEnabled && JS_JPS_LOG in files -> JS_JPS_LOG

View File

@@ -33,13 +33,6 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
)
var libraries: String? by NullableStringFreezableVar(null)
@Argument(
value = "-Xrepositories",
valueDescription = "<path>",
description = "Paths to additional places where libraries could be found"
)
var repositries: String? by NullableStringFreezableVar(null)
@GradleOption(DefaultValues.BooleanFalseDefault::class)
@Argument(value = "-source-map", description = "Generate source map")
var sourceMap: Boolean by FreezableVar(false)

View File

@@ -134,7 +134,7 @@ fun main(args: Array<String>) {
}
val resolvedLibraries = jsResolveLibraries(
dependencies, emptyList(), messageCollectorLogger(MessageCollector.NONE)
dependencies, messageCollectorLogger(MessageCollector.NONE)
)
buildKLib(moduleName, listOfKtFilesFrom(inputFiles), outputPath, resolvedLibraries, listOfKtFilesFrom(commonSources))

View File

@@ -39,7 +39,6 @@ import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer
import org.jetbrains.kotlin.ir.backend.js.*
import org.jetbrains.kotlin.ir.declarations.persistent.PersistentIrFactory
import org.jetbrains.kotlin.js.config.*
import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.psi.KtFile
@@ -114,11 +113,9 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
val libraries: List<String> = configureLibraries(arguments.libraries) + listOfNotNull(arguments.includes)
val friendLibraries: List<String> = configureLibraries(arguments.friendModules)
val repositories: List<String> = configureLibraries(arguments.repositries)
configuration.put(JSConfigurationKeys.LIBRARIES, libraries)
configuration.put(JSConfigurationKeys.TRANSITIVE_LIBRARIES, libraries)
configuration.put(JSConfigurationKeys.REPOSITORIES, repositories)
val commonSourcesArray = arguments.commonSources
val commonSources = commonSourcesArray?.toSet() ?: emptySet()
@@ -178,7 +175,6 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
val resolvedLibraries = jsResolveLibraries(
libraries,
configuration[JSConfigurationKeys.REPOSITORIES] ?: emptyList(),
messageCollectorLogger(configuration[CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY] ?: error("Could not find message collector"))
)
@@ -188,9 +184,11 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
}
if (arguments.irProduceKlibDir || arguments.irProduceKlibFile) {
if (arguments.irProduceKlibFile) {
require(outputFile.extension == KLIB_FILE_EXTENSION) { "Please set up .klib file as output" }
}
val outputKlibPath =
if (arguments.irProduceKlibDir)
File(outputFilePath).parent
else
outputFilePath
try {
generateKLib(
@@ -201,7 +199,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
allDependencies = resolvedLibraries,
friendDependencies = friendDependencies,
irFactory = PersistentIrFactory,
outputKlibPath = outputFile.path,
outputKlibPath = outputKlibPath,
nopack = arguments.irProduceKlibDir
)
} catch (e: JsIrCompilationError) {

View File

@@ -12957,11 +12957,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/inlineClasses/unsignedLiteralsWithoutArtifactOnClasspath.kt");
}
@TestMetadata("varPropertyWithInlineClassReceiver.kt")
public void testVarPropertyWithInlineClassReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/varPropertyWithInlineClassReceiver.kt");
}
@TestMetadata("varargsOnParametersOfInlineClassType.kt")
public void testVarargsOnParametersOfInlineClassType() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.kt");

View File

@@ -347,7 +347,7 @@ public interface Errors {
DiagnosticFactory0<PsiElement> NON_PRIVATE_CONSTRUCTOR_IN_ENUM = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> NON_PRIVATE_CONSTRUCTOR_IN_SEALED = DiagnosticFactory0.create(ERROR);
// Inline and value classes
// Inline classes
DiagnosticFactory0<PsiElement> INLINE_CLASS_NOT_TOP_LEVEL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> INLINE_CLASS_NOT_FINAL = DiagnosticFactory0.create(ERROR);
@@ -355,7 +355,6 @@ public interface Errors {
DiagnosticFactory0<KtElement> INLINE_CLASS_CONSTRUCTOR_WRONG_PARAMETERS_SIZE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtParameter> INLINE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtProperty> PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory0<PsiElement> RESERVED_VAR_PROPERTY_OF_VALUE_CLASS = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0<PsiElement> DELEGATED_PROPERTY_INSIDE_INLINE_CLASS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1<KtTypeReference, KotlinType> INLINE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0<PsiElement> INLINE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION = DiagnosticFactory0.create(ERROR);

View File

@@ -710,7 +710,6 @@ public class DefaultErrorMessages {
MAP.put(INLINE_CLASS_CONSTRUCTOR_WRONG_PARAMETERS_SIZE, "Inline class must have exactly one primary constructor parameter");
MAP.put(INLINE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER, "Value class primary constructor must have only final read-only (val) property parameter");
MAP.put(PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS, "Inline class cannot have properties with backing fields");
MAP.put(RESERVED_VAR_PROPERTY_OF_VALUE_CLASS, "'var' properties with value class receivers are reserved for future use");
MAP.put(DELEGATED_PROPERTY_INSIDE_INLINE_CLASS, "Inline class cannot have delegated properties");
MAP.put(INLINE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE, "Inline class cannot have value parameter of type ''{0}''", RENDER_TYPE);
MAP.put(INLINE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION, "Inline class cannot implement an interface by delegation");

View File

@@ -27,8 +27,8 @@ private val DEFAULT_DECLARATION_CHECKERS = listOf(
KClassWithIncorrectTypeArgumentChecker,
SuspendLimitationsChecker,
InlineClassDeclarationChecker,
PropertiesWithBackingFieldsInsideInlineClass(),
InnerClassInsideInlineClass(),
PropertiesWithInlineClassAsReceiver(),
AnnotationClassTargetAndRetentionChecker(),
ReservedMembersAndConstructsForInlineClass(),
ResultClassInReturnTypeChecker(),

View File

@@ -107,27 +107,19 @@ object InlineClassDeclarationChecker : DeclarationChecker {
}
}
class PropertiesWithInlineClassAsReceiver : DeclarationChecker {
class PropertiesWithBackingFieldsInsideInlineClass : DeclarationChecker {
override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {
if (declaration !is KtProperty) return
if (descriptor !is PropertyDescriptor) return
if (descriptor.containingDeclaration.isInlineClass()) {
if (context.trace.get(BindingContext.BACKING_FIELD_REQUIRED, descriptor) == true) {
context.trace.report(Errors.PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS.on(declaration))
}
if (!descriptor.containingDeclaration.isInlineClass()) return
declaration.delegate?.let {
context.trace.report(Errors.DELEGATED_PROPERTY_INSIDE_INLINE_CLASS.on(it))
}
if (context.trace.get(BindingContext.BACKING_FIELD_REQUIRED, descriptor) == true) {
context.trace.report(Errors.PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS.on(declaration))
}
if (!descriptor.isVar) return
if (descriptor.containingDeclaration.isInlineClass() ||
descriptor.extensionReceiverParameter?.type?.isInlineClassType() == true
) {
context.trace.report(Errors.RESERVED_VAR_PROPERTY_OF_VALUE_CLASS.on(declaration.valOrVarKeyword))
declaration.delegate?.let {
context.trace.report(Errors.DELEGATED_PROPERTY_INSIDE_INLINE_CLASS.on(it))
}
}
}

View File

@@ -22,7 +22,6 @@ import java.io.Serializable
sealed class ChangedFiles : Serializable {
class Known(val modified: List<File>, val removed: List<File>) : ChangedFiles()
class Unknown : ChangedFiles()
class Dependencies(val modified: List<File>, val removed: List<File>) : ChangedFiles()
companion object {
const val serialVersionUID: Long = 0

View File

@@ -99,18 +99,7 @@ abstract class IncrementalCompilerRunner<
}
return try {
val changedFiles = when (providedChangedFiles) {
is ChangedFiles.Dependencies -> {
val changedSources = caches.inputsCache.sourceSnapshotMap.compareAndUpdate(allSourceFiles)
ChangedFiles.Known(
providedChangedFiles.modified + changedSources.modified,
providedChangedFiles.removed + changedSources.removed
)
}
null -> caches.inputsCache.sourceSnapshotMap.compareAndUpdate(allSourceFiles)
else -> providedChangedFiles
}
val changedFiles = providedChangedFiles ?: caches.inputsCache.sourceSnapshotMap.compareAndUpdate(allSourceFiles)
val compilationMode = sourcesToCompile(caches, changedFiles, args, messageCollector)
val exitCode = when (compilationMode) {
@@ -169,7 +158,6 @@ abstract class IncrementalCompilerRunner<
when (changedFiles) {
is ChangedFiles.Known -> calculateSourcesToCompile(caches, changedFiles, args, messageCollector)
is ChangedFiles.Unknown -> CompilationMode.Rebuild(BuildAttribute.UNKNOWN_CHANGES_IN_GRADLE_INPUTS)
is ChangedFiles.Dependencies -> error("Unexpected ChangedFiles type (ChangedFiles.Dependencies)")
}
private fun calculateSourcesToCompile(

View File

@@ -41,25 +41,23 @@ fun makeJsIncrementally(
cachesDir: File,
sourceRoots: Iterable<File>,
args: K2JSCompilerArguments,
buildHistoryFile: File,
messageCollector: MessageCollector = MessageCollector.NONE,
reporter: ICReporter = EmptyICReporter,
scopeExpansion: CompileScopeExpansionMode = CompileScopeExpansionMode.NEVER,
modulesApiHistory: ModulesApiHistory = EmptyModulesApiHistory,
providedChangedFiles: ChangedFiles? = null
scopeExpansion: CompileScopeExpansionMode = CompileScopeExpansionMode.NEVER
) {
val allKotlinFiles = sourceRoots.asSequence().flatMap { it.walk() }
.filter { it.isFile && it.extension.equals("kt", ignoreCase = true) }.toList()
val buildHistoryFile = File(cachesDir, "build-history.bin")
val buildReporter = BuildReporter(icReporter = reporter, buildMetricsReporter = DoNothingBuildMetricsReporter)
withJsIC {
val compiler = IncrementalJsCompilerRunner(
cachesDir, buildReporter,
buildHistoryFile = buildHistoryFile,
modulesApiHistory = modulesApiHistory,
modulesApiHistory = EmptyModulesApiHistory,
scopeExpansion = scopeExpansion
)
compiler.compile(allKotlinFiles, args, messageCollector, providedChangedFiles)
compiler.compile(allKotlinFiles, args, messageCollector, providedChangedFiles = null)
}
}

View File

@@ -41,11 +41,6 @@ abstract class ModulesApiHistoryBase(protected val modulesInfo: IncrementalModul
extension.equals("jar", ignoreCase = true) -> {
jarFiles.add(file)
}
extension.equals("klib", ignoreCase = true) -> {
// TODO: shouldn't jars and klibs be tracked separately?
// TODO: what to do with `in-directory` klib?
jarFiles.add(file)
}
}
}

View File

@@ -1,260 +0,0 @@
/*
* Copyright 2010-2020 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 org.jetbrains.kotlin.build.report.ICReporter
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistory
import org.jetbrains.kotlin.incremental.utils.TestCompilationResult
import org.jetbrains.kotlin.incremental.utils.TestICReporter
import org.jetbrains.kotlin.incremental.utils.TestMessageCollector
import org.jetbrains.kotlin.utils.DFS
import java.io.File
import java.util.regex.Pattern
abstract class AbstractIncrementalMultiModuleCompilerRunnerTest<Args : CommonCompilerArguments, ApiHistory : ModulesApiHistory> :
AbstractIncrementalCompilerRunnerTestBase<Args>() {
private class ModuleDependency(val moduleName: String, val flags: Set<String>)
private class ModuleBuildConfiguration(val srcDir: File, val dependencies: List<ModuleDependency>)
protected val repository: File by lazy { File(workingDir, "repository") }
private val modulesInfo: MutableMap<String, ModuleBuildConfiguration> = mutableMapOf()
private val modulesOrder: MutableList<String> = mutableListOf()
private val dirToModule = mutableMapOf<File, IncrementalModuleEntry>()
private val nameToModules = mutableMapOf<String, MutableSet<IncrementalModuleEntry>>()
private val jarToClassListFile = mutableMapOf<File, File>()
private val jarToModule = mutableMapOf<File, IncrementalModuleEntry>()
protected val incrementalModuleInfo: IncrementalModuleInfo by lazy {
IncrementalModuleInfo(workingDir, dirToModule, nameToModules, jarToClassListFile, jarToModule)
}
protected abstract val modulesApiHistory: ApiHistory
override val moduleNames: Collection<String>? get() = modulesOrder
protected abstract val scopeExpansionMode: CompileScopeExpansionMode
override fun resetTest(testDir: File, newOutDir: File, newCacheDir: File) {
repository.deleteRecursively()
repository.mkdirs()
dirToModule.clear()
nameToModules.clear()
jarToModule.clear()
modulesOrder.forEach { setupModuleApiHistory(it, newOutDir, newCacheDir) }
}
override fun setupTest(testDir: File, srcDir: File, cacheDir: File, outDir: File): List<File> {
repository.mkdirs()
val ktFiles = srcDir.getFiles().filter { it.extension == "kt" }
val results = mutableMapOf<String, MutableList<Pair<File, String>>>()
ktFiles.forEach {
modulePattern.matcher(it.name).let { match ->
match.find()
val moduleName = match.group(1)
val fileName = match.group(2)
val sources = results.getOrPut(moduleName) { mutableListOf() }
sources.add(it to fileName)
}
}
val dependencyGraph = parseDependencies(testDir)
DFS.topologicalOrder(dependencyGraph.keys) { m ->
(dependencyGraph[m] ?: error("Expected dependencies for module $m")).map { it.moduleName }
}.reversed().mapTo(modulesOrder) { it }
for ((moduleName, fileEntries) in results) {
val moduleDir = File(workingDir, moduleName).apply { mkdirs() }
val moduleSrcDir = File(moduleDir, "src")
val moduleDependencies = dependencyGraph[moduleName] ?: error("Cannot find dependency for module $moduleName")
for ((oldFile, newName) in fileEntries) {
val newFile = File(moduleSrcDir, newName)
oldFile.copyTo(newFile)
}
modulesInfo[moduleName] = ModuleBuildConfiguration(moduleSrcDir, moduleDependencies)
setupModuleApiHistory(moduleName, outDir, cacheDir)
}
return listOf(srcDir)
}
protected open fun setupModuleApiHistory(moduleName: String, outDir: File, cacheDir: File) {
val depArtifactFile = File(repository, moduleName.asArtifactFileName())
val moduleBuildDir = File(outDir, moduleName)
val moduleCacheDir = File(cacheDir, moduleName)
val moduleBuildHistoryFile = buildHistoryFile(moduleCacheDir)
val moduleEntry = IncrementalModuleEntry(workingDir.absolutePath, moduleName, outDir, moduleBuildHistoryFile)
dirToModule[moduleBuildDir] = moduleEntry
nameToModules.getOrPut(moduleName) { mutableSetOf() }.add(moduleEntry)
jarToModule[depArtifactFile] = moduleEntry
}
companion object {
private val modulePattern = Pattern.compile("^(module\\d+)_(\\w+\\.kt)$")
private fun File.getFiles(): List<File> {
return if (isDirectory) listFiles()?.flatMap { it.getFiles() } ?: emptyList()
else listOf(this)
}
private fun parseDependencies(testDir: File): Map<String, List<ModuleDependency>> {
val actualModulesTxtFile = File(testDir, "dependencies.txt")
if (!actualModulesTxtFile.exists()) {
error("${actualModulesTxtFile.path} is expected")
}
val result = mutableMapOf<String, MutableList<ModuleDependency>>()
val lines = actualModulesTxtFile.readLines()
lines.map { it.split("->") }.forEach {
assert(it.size == 2)
val moduleName = it[0]
val dependencyPart = it[1]
val dependencies = result.getOrPut(moduleName) { mutableListOf() }
if (dependencyPart.isNotBlank()) {
val idx = dependencyPart.indexOf('[')
val dependency = if (idx >= 0) {
// skip annotations
val depModuleName = dependencyPart.substring(0, idx)
val flagsString = dependencyPart.substring(idx + 1, dependencyPart.length - 1)
val flags = flagsString.split(",").map { s -> s.trim() }.filter { s -> s.isNotEmpty() }.toSet()
ModuleDependency(depModuleName, flags)
} else ModuleDependency(dependencyPart, emptySet())
dependencies.add(dependency)
}
}
return result
}
private const val EXPORTED = "exported"
}
protected abstract fun makeForSingleModule(
moduleCacheDir: File,
sourceRoots: Iterable<File>,
args: Args,
moduleBuildHistoryFile: File,
messageCollector: MessageCollector,
reporter: ICReporter,
scopeExpansion: CompileScopeExpansionMode,
modulesApiHistory: ApiHistory,
providedChangedFiles: ChangedFiles?
)
private fun collectEffectiveDependencies(moduleName: String): List<String> {
val result = mutableSetOf<String>()
val moduleInfo = modulesInfo[moduleName] ?: error("Cannot find module info for $moduleName")
for (dep in moduleInfo.dependencies) {
val depName = dep.moduleName
result.add(depName)
val depInfo = modulesInfo[depName] ?: error("Cannot find module info for dependency $moduleName -> $depName")
for (depdep in depInfo.dependencies) {
if (EXPORTED in depdep.flags) {
result.add(depdep.moduleName)
}
}
}
return result.toList()
}
protected abstract fun Args.updateForSingleModule(moduleDependencies: List<String>, outFile: File)
protected abstract fun String.asOutputFileName(): String
protected abstract fun String.asArtifactFileName(): String
protected abstract fun transformToDependency(moduleName: String, rawArtifact: File): File
override fun make(
cacheDir: File,
outDir: File,
sourceRoots: Iterable<File>,
args: Args
): TestCompilationResult {
val reporter = TestICReporter()
val messageCollector = TestMessageCollector()
val modifiedLibraries = mutableListOf<Pair<String, File>>()
val deletedLibraries = mutableListOf<Pair<String, File>>()
var compilationIsEnabled = true
val isInitial = repository.list()?.isEmpty() ?: true
for (module in modulesOrder) {
val moduleDependencies = collectEffectiveDependencies(module)
val moduleModifiedDependencies = modifiedLibraries.filter { it.first in moduleDependencies }.map { it.second }
val moduleDeletedDependencies = deletedLibraries.filter { it.first in moduleDependencies }.map { it.second }
val changedDepsFiles = if (isInitial) null else ChangedFiles.Dependencies(moduleModifiedDependencies, moduleDeletedDependencies)
val moduleOutDir = File(outDir, module)
val moduleCacheDir = File(cacheDir, module)
val moduleBuildHistory = buildHistoryFile(moduleCacheDir)
val moduleBuildInfo = modulesInfo[module] ?: error("Cannot find config for $module")
val sources = moduleBuildInfo.srcDir.getFiles()
val outputFile = File(moduleOutDir, module.asOutputFileName())
if (compilationIsEnabled) {
args.updateForSingleModule(moduleDependencies, outputFile)
makeForSingleModule(
moduleCacheDir,
sources,
args,
moduleBuildHistory,
messageCollector,
reporter,
scopeExpansionMode,
modulesApiHistory,
changedDepsFiles
)
}
val dependencyFile = File(repository, module.asArtifactFileName())
val oldMD5 = if (dependencyFile.exists()) {
val bytes = dependencyFile.readBytes()
dependencyFile.delete()
bytes.md5()
} else 0
if (!messageCollector.hasErrors()) {
transformToDependency(module, outputFile)
val newMD5 = dependencyFile.readBytes().md5()
if (oldMD5 != newMD5) {
modifiedLibraries.add(module to dependencyFile)
}
} else {
compilationIsEnabled = false
}
}
return TestCompilationResult(reporter, messageCollector)
}
}

View File

@@ -28,13 +28,6 @@ import java.io.File
abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerArguments> : TestWithWorkingDir() {
protected abstract fun createCompilerArguments(destinationDir: File, testDir: File): Args
protected open val moduleNames: Collection<String>? get() = null
protected open fun setupTest(testDir: File, srcDir: File, cacheDir: File, outDir: File): List<File> =
listOf(srcDir)
protected open fun resetTest(testDir: File, newOutDir: File, newCacheDir: File) {}
fun doTest(path: String) {
val testDir = File(path)
@@ -46,10 +39,9 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
val outDir = File(workingDir, "out").apply { mkdirs() }
val mapWorkingToOriginalFile = HashMap(copyTestSources(testDir, srcDir, filePrefix = ""))
val sourceRoots = setupTest(testDir, srcDir, cacheDir, outDir)
val (_, _, errors) = initialMake(cacheDir, outDir, sourceRoots, createCompilerArguments(outDir, testDir))
val sourceRoots = listOf(srcDir)
val args = createCompilerArguments(outDir, testDir)
val (_, _, errors) = initialMake(cacheDir, sourceRoots, args)
check(errors.isEmpty()) { "Initial build failed: \n${errors.joinToString("\n")}" }
// modifications
@@ -57,7 +49,7 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
val buildLogSteps = parseTestBuildLog(buildLogFile)
val modifications = getModificationsToPerform(
testDir,
moduleNames = moduleNames,
moduleNames = null,
allowNoFilesWithSuffixInTestData = false,
touchPolicy = TouchPolicy.CHECKSUM
)
@@ -77,7 +69,7 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
var step = 1
for ((modificationStep, buildLogStep) in modifications.zip(buildLogSteps)) {
modificationStep.forEach { it.perform(workingDir, mapWorkingToOriginalFile) }
val (_, compiledSources, compileErrors) = incrementalMake(cacheDir, outDir, sourceRoots, createCompilerArguments(outDir, testDir))
val (_, compiledSources, compileErrors) = incrementalMake(cacheDir, sourceRoots, args)
expectedSB.appendLine(stepLogAsString(step, buildLogStep.compiledKotlinFiles, buildLogStep.compileErrors))
expectedSBWithoutErrors.appendLine(
@@ -106,9 +98,9 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
}
// these functions are needed only to simplify debugging of IC tests
private fun initialMake(cacheDir: File, outDir: File, sourceRoots: List<File>, args: Args) = make(cacheDir, outDir, sourceRoots, args)
private fun initialMake(cacheDir: File, sourceRoots: List<File>, args: Args) = make(cacheDir, sourceRoots, args)
private fun incrementalMake(cacheDir: File, outDir: File, sourceRoots: List<File>, args: Args) = make(cacheDir, outDir, sourceRoots, args)
private fun incrementalMake(cacheDir: File, sourceRoots: List<File>, args: Args) = make(cacheDir, sourceRoots, args)
protected open fun rebuildAndCompareOutput(
sourceRoots: List<File>,
@@ -119,9 +111,7 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
// todo: also compare caches
val rebuildOutDir = File(workingDir, "rebuild-out").apply { mkdirs() }
val rebuildCacheDir = File(workingDir, "rebuild-cache").apply { mkdirs() }
resetTest(testDir, rebuildOutDir, rebuildCacheDir)
val rebuildResult = make(rebuildCacheDir, rebuildOutDir, sourceRoots, createCompilerArguments(rebuildOutDir, testDir))
val rebuildResult = make(rebuildCacheDir, sourceRoots, createCompilerArguments(rebuildOutDir, testDir))
val rebuildExpectedToSucceed = buildLogSteps.last().compileSucceeded
val rebuildSucceeded = rebuildResult.exitCode == ExitCode.OK
@@ -135,7 +125,7 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
protected open val buildLogFinder: BuildLogFinder
get() = BuildLogFinder(isGradleEnabled = true)
protected abstract fun make(cacheDir: File, outDir: File, sourceRoots: Iterable<File>, args: Args): TestCompilationResult
protected abstract fun make(cacheDir: File, sourceRoots: Iterable<File>, args: Args): TestCompilationResult
private fun stepLogAsString(step: Int, ktSources: Iterable<String>, errors: Collection<String>, includeErrors: Boolean = true): String {
val sb = StringBuilder()
@@ -169,8 +159,5 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
protected val kotlinStdlibJvm: File = File(distKotlincLib, "kotlin-stdlib.jar").also {
KtUsefulTestCase.assertExists(it)
}
@JvmStatic
protected fun buildHistoryFile(cacheDir: File): File = File(cacheDir, "build-history.bin")
}
}

View File

@@ -24,10 +24,10 @@ import org.jetbrains.kotlin.incremental.utils.TestMessageCollector
import java.io.File
abstract class AbstractIncrementalJsCompilerRunnerTest : AbstractIncrementalCompilerRunnerTestBase<K2JSCompilerArguments>() {
override fun make(cacheDir: File, outDir: File, sourceRoots: Iterable<File>, args: K2JSCompilerArguments): TestCompilationResult {
override fun make(cacheDir: File, sourceRoots: Iterable<File>, args: K2JSCompilerArguments): TestCompilationResult {
val reporter = TestICReporter()
val messageCollector = TestMessageCollector()
makeJsIncrementally(cacheDir, sourceRoots, args, buildHistoryFile(cacheDir), messageCollector, reporter, scopeExpansionMode)
makeJsIncrementally(cacheDir, sourceRoots, args, messageCollector, reporter, scopeExpansionMode)
return TestCompilationResult(reporter, messageCollector)
}

View File

@@ -2,22 +2,21 @@ package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION
import java.io.File
abstract class AbstractIncrementalJsKlibCompilerRunnerTest : AbstractIncrementalJsCompilerRunnerTest() {
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =
K2JSCompilerArguments().apply {
libraries = "build/js-ir-runtime/full-runtime.klib"
outputFile = File(destinationDir, "${testDir.name}.$KLIB_FILE_EXTENSION").path
sourceMap = false
irProduceKlibDir = false
irProduceKlibFile = true
outputFile = File(destinationDir, "${testDir.name}.klib").path
sourceMap = true
// Don't zip klib content since date on files affect the md5 checksum we compute to check whether output files identical
irProduceKlibDir = true
irOnly = true
}
override val buildLogFinder: BuildLogFinder
get() = super.buildLogFinder.copy(isJsIrEnabled = true, isKlibEnabled = true)
get() = super.buildLogFinder.copy(isJsIrEnabled = true)
}
abstract class AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest : AbstractIncrementalJsKlibCompilerRunnerTest() {

View File

@@ -27,7 +27,7 @@ import java.io.File
import javax.tools.ToolProvider
abstract class AbstractIncrementalJvmCompilerRunnerTest : AbstractIncrementalCompilerRunnerTestBase<K2JVMCompilerArguments>() {
override fun make(cacheDir: File, outDir: File, sourceRoots: Iterable<File>, args: K2JVMCompilerArguments): TestCompilationResult {
override fun make(cacheDir: File, sourceRoots: Iterable<File>, args: K2JVMCompilerArguments): TestCompilationResult {
val reporter = TestICReporter()
val messageCollector = TestMessageCollector()
makeIncrementally(cacheDir, sourceRoots, args, reporter = reporter, messageCollector = messageCollector)

View File

@@ -1,102 +0,0 @@
/*
* Copyright 2010-2020 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 org.jetbrains.kotlin.build.report.ICReporter
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistoryJs
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
import java.io.File
import java.io.FileOutputStream
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
abstract class AbstractIncrementalMultiModuleJsCompilerRunnerTest :
AbstractIncrementalMultiModuleCompilerRunnerTest<K2JSCompilerArguments, ModulesApiHistoryJs>() {
override val buildLogFinder: BuildLogFinder
get() = super.buildLogFinder.copy(
isJsEnabled = true,
isScopeExpansionEnabled = scopeExpansionMode != CompileScopeExpansionMode.NEVER
)
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =
K2JSCompilerArguments().apply {
sourceMap = true
metaInfo = true
}
override fun makeForSingleModule(
moduleCacheDir: File,
sourceRoots: Iterable<File>,
args: K2JSCompilerArguments,
moduleBuildHistoryFile: File,
messageCollector: MessageCollector,
reporter: ICReporter,
scopeExpansion: CompileScopeExpansionMode,
modulesApiHistory: ModulesApiHistoryJs,
providedChangedFiles: ChangedFiles?
) {
makeJsIncrementally(
moduleCacheDir,
sourceRoots,
args,
moduleBuildHistoryFile,
messageCollector,
reporter,
scopeExpansionMode,
modulesApiHistory,
providedChangedFiles
)
}
override fun K2JSCompilerArguments.updateForSingleModule(moduleDependencies: List<String>, outFile: File) {
val dependencies = moduleDependencies.joinToString(File.pathSeparator) {
File(repository, it.asArtifactFileName()).absolutePath
}
libraries = dependencies
outputFile = outFile.path
}
override fun transformToDependency(moduleName: String, rawArtifact: File): File {
val rawDir = rawArtifact.parentFile
val artifactFile = File(repository, moduleName.asArtifactFileName())
val zipOut = ZipOutputStream(FileOutputStream(artifactFile))
fun walkFiles(dir: File) {
dir.listFiles()?.let { files ->
files.forEach { file ->
if (file.isDirectory) walkFiles(file)
else {
val relativePath = file.relativeTo(rawDir).path
val zipEntry = ZipEntry(relativePath)
zipEntry.time = 0
zipOut.putNextEntry(zipEntry)
file.readBytes().let { bytes ->
zipOut.write(bytes, 0, bytes.size)
}
zipOut.closeEntry()
}
}
}
}
walkFiles(rawDir)
zipOut.close()
return artifactFile
}
override val modulesApiHistory: ModulesApiHistoryJs by lazy { ModulesApiHistoryJs(incrementalModuleInfo) }
override fun String.asOutputFileName(): String = "$this.js"
override fun String.asArtifactFileName(): String = "$this.jar"
override val scopeExpansionMode = CompileScopeExpansionMode.NEVER
}

View File

@@ -1,92 +0,0 @@
/*
* Copyright 2010-2020 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 org.jetbrains.kotlin.build.report.ICReporter
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistoryJs
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION
import java.io.File
abstract class AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest :
AbstractIncrementalMultiModuleCompilerRunnerTest<K2JSCompilerArguments, ModulesApiHistoryJs>() {
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =
K2JSCompilerArguments().apply {
libraries = STDLIB_DEPENDENCY
outputFile = File(destinationDir, "${testDir.name}.$KLIB_FILE_EXTENSION").path
sourceMap = false
irProduceKlibDir = false
irProduceKlibFile = true
irOnly = true
repositries = repository.absolutePath
}
override val buildLogFinder: BuildLogFinder
get() = super.buildLogFinder.copy(isJsIrEnabled = true, isKlibEnabled = true)
override fun makeForSingleModule(
moduleCacheDir: File,
sourceRoots: Iterable<File>,
args: K2JSCompilerArguments,
moduleBuildHistoryFile: File,
messageCollector: MessageCollector,
reporter: ICReporter,
scopeExpansion: CompileScopeExpansionMode,
modulesApiHistory: ModulesApiHistoryJs,
providedChangedFiles: ChangedFiles?
) {
makeJsIncrementally(
moduleCacheDir,
sourceRoots,
args,
moduleBuildHistoryFile,
messageCollector,
reporter,
scopeExpansionMode,
modulesApiHistory,
providedChangedFiles
)
}
override val modulesApiHistory: ModulesApiHistoryJs by lazy {
ModulesApiHistoryJs(incrementalModuleInfo)
}
override val scopeExpansionMode: CompileScopeExpansionMode get() = CompileScopeExpansionMode.NEVER
override fun String.asOutputFileName(): String = klib
override fun String.asArtifactFileName(): String = klib
override fun transformToDependency(moduleName: String, rawArtifact: File): File {
val dependencyFile = File(repository, moduleName.klib)
rawArtifact.copyTo(dependencyFile)
return dependencyFile
}
override fun K2JSCompilerArguments.updateForSingleModule(moduleDependencies: List<String>, outFile: File) {
val additionalDeps = moduleDependencies.joinToString(File.pathSeparator) {
File(repository, it.klib).absolutePath
}
val sb = StringBuilder(STDLIB_DEPENDENCY)
if (additionalDeps.isNotBlank()) {
sb.append(File.pathSeparator)
sb.append(additionalDeps)
}
libraries = sb.toString()
outputFile = outFile.path
}
companion object {
private val String.klib: String get() = "$this.$KLIB_FILE_EXTENSION"
private const val STDLIB_DEPENDENCY = "build/js-ir-runtime/full-runtime.klib"
}
}

View File

@@ -440,16 +440,6 @@ public class IncrementalJsCompilerRunnerTestGenerated extends AbstractIncrementa
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("parameterWithDefaultValueAdded")
public void testParameterWithDefaultValueAdded() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueAdded/");
}
@TestMetadata("parameterWithDefaultValueRemoved")
public void testParameterWithDefaultValueRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueRemoved/");
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");

View File

@@ -440,16 +440,6 @@ public class IncrementalJsCompilerRunnerWithMetadataOnlyTestGenerated extends Ab
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("parameterWithDefaultValueAdded")
public void testParameterWithDefaultValueAdded() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueAdded/");
}
@TestMetadata("parameterWithDefaultValueRemoved")
public void testParameterWithDefaultValueRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueRemoved/");
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");

View File

@@ -442,16 +442,6 @@ public class IncrementalJsKlibCompilerRunnerTestGenerated extends AbstractIncrem
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("parameterWithDefaultValueAdded")
public void testParameterWithDefaultValueAdded() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueAdded/");
}
@TestMetadata("parameterWithDefaultValueRemoved")
public void testParameterWithDefaultValueRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueRemoved/");
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");

View File

@@ -440,16 +440,6 @@ public class IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated exte
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("parameterWithDefaultValueAdded")
public void testParameterWithDefaultValueAdded() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueAdded/");
}
@TestMetadata("parameterWithDefaultValueRemoved")
public void testParameterWithDefaultValueRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueRemoved/");
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");

View File

@@ -441,16 +441,6 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("parameterWithDefaultValueAdded")
public void testParameterWithDefaultValueAdded() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueAdded/");
}
@TestMetadata("parameterWithDefaultValueRemoved")
public void testParameterWithDefaultValueRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueRemoved/");
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");

View File

@@ -1,462 +0,0 @@
/*
* Copyright 2010-2020 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.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")
@TestMetadata("jps-plugin/testData/incremental/multiModule/common")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class IncrementalMultiModuleJsCompilerRunnerTestGenerated extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInCommon() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common"), Pattern.compile("^([^\\.]+)$"), null, true);
}
@TestMetadata("classAdded")
public void testClassAdded() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/classAdded/");
}
@TestMetadata("classRemoved")
public void testClassRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/classRemoved/");
}
@TestMetadata("constantValueChanged")
public void testConstantValueChanged() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/constantValueChanged/");
}
@TestMetadata("copyFileToAnotherModule")
public void testCopyFileToAnotherModule() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule/");
}
@TestMetadata("defaultArgumentInConstructorRemoved")
public void testDefaultArgumentInConstructorRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved/");
}
@TestMetadata("defaultParameterAdded")
public void testDefaultParameterAdded() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded/");
}
@TestMetadata("defaultParameterAddedForTopLevelFun")
public void testDefaultParameterAddedForTopLevelFun() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun/");
}
@TestMetadata("defaultParameterRemoved")
public void testDefaultParameterRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved/");
}
@TestMetadata("defaultParameterRemovedForTopLevelFun")
public void testDefaultParameterRemovedForTopLevelFun() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun/");
}
@TestMetadata("defaultValueInConstructorRemoved")
public void testDefaultValueInConstructorRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved/");
}
@TestMetadata("duplicatedClass")
public void testDuplicatedClass() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/duplicatedClass/");
}
@TestMetadata("exportedDependency")
public void testExportedDependency() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/exportedDependency/");
}
@TestMetadata("functionFromDifferentPackageChanged")
public void testFunctionFromDifferentPackageChanged() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged/");
}
@TestMetadata("inlineFunctionInlined")
public void testInlineFunctionInlined() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined/");
}
@TestMetadata("inlineFunctionTwoPackageParts")
public void testInlineFunctionTwoPackageParts() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts/");
}
@TestMetadata("moveFileToAnotherModule")
public void testMoveFileToAnotherModule() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule/");
}
@TestMetadata("simple")
public void testSimple() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simple/");
}
@TestMetadata("simpleDependency")
public void testSimpleDependency() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependency/");
}
@TestMetadata("simpleDependencyErrorOnAccessToInternal1")
public void testSimpleDependencyErrorOnAccessToInternal1() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1/");
}
@TestMetadata("simpleDependencyErrorOnAccessToInternal2")
public void testSimpleDependencyErrorOnAccessToInternal2() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2/");
}
@TestMetadata("simpleDependencyUnchanged")
public void testSimpleDependencyUnchanged() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged/");
}
@TestMetadata("transitiveDependency")
public void testTransitiveDependency() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/transitiveDependency/");
}
@TestMetadata("transitiveInlining")
public void testTransitiveInlining() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/transitiveInlining/");
}
@TestMetadata("twoDependants")
public void testTwoDependants() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/twoDependants/");
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/classAdded")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassAdded extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInClassAdded() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classAdded"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/classRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassRemoved extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInClassRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/constantValueChanged")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ConstantValueChanged extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInConstantValueChanged() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/constantValueChanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class CopyFileToAnotherModule extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInCopyFileToAnotherModule() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultArgumentInConstructorRemoved extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultArgumentInConstructorRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterAdded extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterAdded() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterAddedForTopLevelFun extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterAddedForTopLevelFun() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterRemoved extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterRemovedForTopLevelFun extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterRemovedForTopLevelFun() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultValueInConstructorRemoved extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultValueInConstructorRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/duplicatedClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DuplicatedClass extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDuplicatedClass() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/duplicatedClass"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/exportedDependency")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ExportedDependency extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInExportedDependency() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/exportedDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class FunctionFromDifferentPackageChanged extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInFunctionFromDifferentPackageChanged() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineFunctionInlined extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInInlineFunctionInlined() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineFunctionTwoPackageParts extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInInlineFunctionTwoPackageParts() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class MoveFileToAnotherModule extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInMoveFileToAnotherModule() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simple")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Simple extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimple() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simple"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependency")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependency extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependency() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyErrorOnAccessToInternal1 extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal1() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyErrorOnAccessToInternal2 extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal2() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyUnchanged extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyUnchanged() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/transitiveDependency")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TransitiveDependency extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTransitiveDependency() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/transitiveInlining")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TransitiveInlining extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTransitiveInlining() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveInlining"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/twoDependants")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TwoDependants extends AbstractIncrementalMultiModuleJsCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTwoDependants() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/twoDependants"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
}

View File

@@ -1,488 +0,0 @@
/*
* Copyright 2010-2020 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.MuteExtraSuffix;
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")
@TestMetadata("jps-plugin/testData/incremental/multiModule/common")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public class IncrementalMultiModuleJsKlibCompilerRunnerTestGenerated extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInCommon() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common"), Pattern.compile("^([^\\.]+)$"), null, true);
}
@TestMetadata("classAdded")
public void testClassAdded() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/classAdded/");
}
@TestMetadata("classRemoved")
public void testClassRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/classRemoved/");
}
@TestMetadata("constantValueChanged")
public void testConstantValueChanged() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/constantValueChanged/");
}
@TestMetadata("copyFileToAnotherModule")
public void testCopyFileToAnotherModule() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule/");
}
@TestMetadata("defaultArgumentInConstructorRemoved")
public void testDefaultArgumentInConstructorRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved/");
}
@TestMetadata("defaultParameterAdded")
public void testDefaultParameterAdded() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded/");
}
@TestMetadata("defaultParameterAddedForTopLevelFun")
public void testDefaultParameterAddedForTopLevelFun() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun/");
}
@TestMetadata("defaultParameterRemoved")
public void testDefaultParameterRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved/");
}
@TestMetadata("defaultParameterRemovedForTopLevelFun")
public void testDefaultParameterRemovedForTopLevelFun() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun/");
}
@TestMetadata("defaultValueInConstructorRemoved")
public void testDefaultValueInConstructorRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved/");
}
@TestMetadata("duplicatedClass")
public void testDuplicatedClass() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/duplicatedClass/");
}
@TestMetadata("exportedDependency")
public void testExportedDependency() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/exportedDependency/");
}
@TestMetadata("functionFromDifferentPackageChanged")
public void testFunctionFromDifferentPackageChanged() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged/");
}
@TestMetadata("inlineFunctionInlined")
public void testInlineFunctionInlined() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined/");
}
@TestMetadata("inlineFunctionTwoPackageParts")
public void testInlineFunctionTwoPackageParts() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts/");
}
@TestMetadata("moveFileToAnotherModule")
public void testMoveFileToAnotherModule() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule/");
}
@TestMetadata("simple")
public void testSimple() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simple/");
}
@TestMetadata("simpleDependency")
public void testSimpleDependency() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependency/");
}
@TestMetadata("simpleDependencyErrorOnAccessToInternal1")
public void testSimpleDependencyErrorOnAccessToInternal1() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1/");
}
@TestMetadata("simpleDependencyErrorOnAccessToInternal2")
public void testSimpleDependencyErrorOnAccessToInternal2() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2/");
}
@TestMetadata("simpleDependencyUnchanged")
public void testSimpleDependencyUnchanged() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged/");
}
@TestMetadata("transitiveDependency")
public void testTransitiveDependency() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/transitiveDependency/");
}
@TestMetadata("transitiveInlining")
public void testTransitiveInlining() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/transitiveInlining/");
}
@TestMetadata("twoDependants")
public void testTwoDependants() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/common/twoDependants/");
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/classAdded")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassAdded extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInClassAdded() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classAdded"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/classRemoved")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassRemoved extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInClassRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/constantValueChanged")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class ConstantValueChanged extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInConstantValueChanged() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/constantValueChanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class CopyFileToAnotherModule extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInCopyFileToAnotherModule() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultArgumentInConstructorRemoved extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultArgumentInConstructorRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterAdded extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterAdded() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterAddedForTopLevelFun extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterAddedForTopLevelFun() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterRemoved extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterRemovedForTopLevelFun extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterRemovedForTopLevelFun() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultValueInConstructorRemoved extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultValueInConstructorRemoved() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/duplicatedClass")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class DuplicatedClass extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDuplicatedClass() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/duplicatedClass"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/exportedDependency")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class ExportedDependency extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInExportedDependency() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/exportedDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class FunctionFromDifferentPackageChanged extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInFunctionFromDifferentPackageChanged() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineFunctionInlined extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInInlineFunctionInlined() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineFunctionTwoPackageParts extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInInlineFunctionTwoPackageParts() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class MoveFileToAnotherModule extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInMoveFileToAnotherModule() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simple")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class Simple extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimple() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simple"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependency")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependency extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependency() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyErrorOnAccessToInternal1 extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal1() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyErrorOnAccessToInternal2 extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal2() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyUnchanged extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyUnchanged() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/transitiveDependency")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class TransitiveDependency extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTransitiveDependency() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/transitiveInlining")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class TransitiveInlining extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTransitiveInlining() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveInlining"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/common/twoDependants")
@TestDataPath("$PROJECT_ROOT")
@MuteExtraSuffix(".jsklib")
@RunWith(JUnit3RunnerWithInners.class)
public static class TwoDependants extends AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTwoDependants() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/twoDependants"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
}

View File

@@ -441,16 +441,6 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("parameterWithDefaultValueAdded")
public void testParameterWithDefaultValueAdded() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueAdded/");
}
@TestMetadata("parameterWithDefaultValueRemoved")
public void testParameterWithDefaultValueRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueRemoved/");
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");

View File

@@ -37,12 +37,12 @@ class JsLibraryResolver(
}
// TODO: This is a temporary set of library resolver policies for js compiler.
fun jsResolveLibraries(libraries: List<String>, repositories: Collection<String>, logger: Logger): KotlinLibraryResolveResult {
fun jsResolveLibraries(libraries: List<String>, logger: Logger): KotlinLibraryResolveResult {
val unresolvedLibraries = libraries.map { UnresolvedLibrary(it, null) }
val libraryAbsolutePaths = libraries.map { File(it).absolutePath }
// Configure the resolver to only work with absolute paths for now.
val libraryResolver = JsLibraryResolver(
repositories = repositories.toList(),
repositories = emptyList(),
directLibs = libraryAbsolutePaths,
distributionKlib = null,
localKotlinDir = null,

View File

@@ -52,6 +52,7 @@ import org.jetbrains.kotlin.library.*
import org.jetbrains.kotlin.library.impl.BuiltInsPlatform
import org.jetbrains.kotlin.library.impl.buildKotlinLibrary
import org.jetbrains.kotlin.library.resolver.KotlinLibraryResolveResult
import org.jetbrains.kotlin.library.resolver.TopologicalLibraryOrder
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.progress.IncrementalNextRoundException
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
@@ -379,10 +380,15 @@ private class ModulesStructure(
private val friendDependencies: List<KotlinLibrary>
) {
val moduleDependencies: Map<KotlinLibrary, List<KotlinLibrary>> = run {
val transitives = allDependencies.getFullResolvedList()
transitives.associate { klib ->
klib.library to klib.resolvedDependencies.map { d -> d.library }
}.toMap()
val result = mutableMapOf<KotlinLibrary, List<KotlinLibrary>>()
allDependencies.forEach { klib, _ ->
val dependencies = allDependencies.filterRoots {
it.library == klib
}.getFullList(TopologicalLibraryOrder)
result.put(klib, dependencies.minus(klib))
}
result
}
val builtInsDep = allDependencies.getFullList().find { it.isBuiltIns }

View File

@@ -21,7 +21,6 @@ where advanced options include:
-Xir-property-lazy-initialization
Perform lazy initialization for properties
-Xmetadata-only Generate *.meta.js and *.kjsm files only
-Xrepositories=<path> Paths to additional places where libraries could be found
-Xtyped-arrays Translate primitive arrays to JS typed arrays
-Xwasm Use experimental WebAssembly compiler backend
-Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info

View File

@@ -21,8 +21,8 @@ object VarObject {
inline class Z(val data: Int) {
val testVal <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by Val()<!>
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> testVar <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by Var()<!>
var testVar <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by Var()<!>
val testValBySingleton <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by ValObject<!>
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> testVarBySingleton <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by VarObject<!>
var testVarBySingleton <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by VarObject<!>
}

View File

@@ -15,11 +15,11 @@ inline class Foo(val x: Int) : A, B {
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>val a1<!> = 0
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> a2: Int
var a2: Int
get() = 1
set(value) {}
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!><!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> a3: Int<!> = 0
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>var a3: Int<!> = 0
get() = 1
set(value) {
field = value
@@ -30,5 +30,5 @@ inline class Foo(val x: Int) : A, B {
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>override val badSize: Int<!> = 0
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>lateinit <!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> lateinitProperty: String<!>
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>lateinit var lateinitProperty: String<!>
}

View File

@@ -1,12 +0,0 @@
// !LANGUAGE: +InlineClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class IC(val a: Any) {
var member: Any
get() = a
set(value) {}
}
var IC.extension: Any
get() = a
set(value) {}

View File

@@ -1,12 +0,0 @@
// !LANGUAGE: +InlineClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class IC(val a: Any) {
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> member: Any
get() = a
set(value) {}
}
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> IC.extension: Any
get() = a
set(value) {}

View File

@@ -1,12 +0,0 @@
package
public var IC.extension: kotlin.Any
public final inline class IC {
public constructor IC(/*0*/ a: kotlin.Any)
public final val a: kotlin.Any
public final var member: kotlin.Any
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}

View File

@@ -26,8 +26,8 @@ object VarObject {
@JvmInline
value class Z(val data: Int) {
val testVal <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by Val()<!>
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> testVar <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by Var()<!>
var testVar <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by Var()<!>
val testValBySingleton <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by ValObject<!>
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> testVarBySingleton <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by VarObject<!>
var testVarBySingleton <!DELEGATED_PROPERTY_INSIDE_INLINE_CLASS!>by VarObject<!>
}

View File

@@ -20,11 +20,11 @@ value class Foo(val x: Int) : A, B {
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>val a1<!> = 0
<!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> a2: Int
var a2: Int
get() = 1
set(value) {}
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!><!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> a3: Int<!> = 0
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>var a3: Int<!> = 0
get() = 1
set(value) {
field = value
@@ -35,5 +35,5 @@ value class Foo(val x: Int) : A, B {
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>override val badSize: Int<!> = 0
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>lateinit <!RESERVED_VAR_PROPERTY_OF_VALUE_CLASS!>var<!> lateinitProperty: String<!>
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS!>lateinit var lateinitProperty: String<!>
}

View File

@@ -27,7 +27,7 @@ abstract class AbstractCompileKotlinAgainstKlibTest : AbstractBlackBoxCodegenTes
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
outputDir = javaSourcesOutputDirectory
klibName = Paths.get(outputDir.toString(), wholeFile.name.toString().replace(".kt", ".klib")).toString()
klibName = Paths.get(outputDir.toString(), wholeFile.name.toString().removeSuffix(".kt")).toString()
val classpath: MutableList<File> = ArrayList()
classpath.add(KotlinTestUtils.getAnnotationsJar())

View File

@@ -23,7 +23,6 @@ import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
import org.jetbrains.kotlin.konan.util.KlibMetadataFactories
import org.jetbrains.kotlin.library.*
import org.jetbrains.kotlin.library.impl.BuiltInsPlatform
import org.jetbrains.kotlin.library.impl.KotlinLibraryLayoutForWriter
import org.jetbrains.kotlin.library.impl.KotlinLibraryWriterImpl
import org.jetbrains.kotlin.library.metadata.NativeTypeTransformer
import org.jetbrains.kotlin.library.metadata.NullFlexibleTypeDeserializer
@@ -79,10 +78,8 @@ object KlibTestUtil {
val serializedMetadata = serializer.serializeModule(module)
val unzippedDir = org.jetbrains.kotlin.konan.file.createTempDir(libraryName)
val layout = KotlinLibraryLayoutForWriter(KFile(klibFile.path), unzippedDir)
val library = KotlinLibraryWriterImpl(
libDir = KFile(klibFile.path.removeSuffix(KLIB_FILE_EXTENSION_WITH_DOT)),
moduleName = libraryName,
versions = KotlinLibraryVersioning(
libraryVersion = null,
@@ -94,8 +91,7 @@ object KlibTestUtil {
builtInsPlatform = BuiltInsPlatform.COMMON,
nativeTargets = emptyList(),
nopack = false,
shortName = libraryName,
layout = layout
shortName = libraryName
)
library.addMetadata(serializedMetadata)

View File

@@ -12964,11 +12964,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/inlineClasses/unsignedLiteralsWithoutArtifactOnClasspath.kt");
}
@TestMetadata("varPropertyWithInlineClassReceiver.kt")
public void testVarPropertyWithInlineClassReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/varPropertyWithInlineClassReceiver.kt");
}
@TestMetadata("varargsOnParametersOfInlineClassType.kt")
public void testVarargsOnParametersOfInlineClassType() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.kt");

View File

@@ -12959,11 +12959,6 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/inlineClasses/unsignedLiteralsWithoutArtifactOnClasspath.kt");
}
@TestMetadata("varPropertyWithInlineClassReceiver.kt")
public void testVarPropertyWithInlineClassReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/varPropertyWithInlineClassReceiver.kt");
}
@TestMetadata("varargsOnParametersOfInlineClassType.kt")
public void testVarargsOnParametersOfInlineClassType() throws Exception {
runTest("compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.kt");

View File

@@ -10,6 +10,7 @@ import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.RandomAccessFile
import java.lang.Exception
import java.nio.MappedByteBuffer
import java.nio.channels.FileChannel
import java.nio.file.*
@@ -230,9 +231,3 @@ inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
}
}
}
fun File.walk(_onFile: (File) -> Boolean) {
if (_onFile(this)) {
if (isDirectory) listFiles.forEach { it.walk(_onFile) }
}
}

View File

@@ -23,8 +23,7 @@ interface KotlinLibraryResolveResult {
fun filterRoots(predicate: (KotlinResolvedLibrary) -> Boolean): KotlinLibraryResolveResult
fun getFullList(order: LibraryOrder? = null): List<KotlinLibrary> = getFullResolvedList(order).map { it.library }
fun getFullResolvedList(order: LibraryOrder? = null): List<KotlinResolvedLibrary>
fun getFullList(order: LibraryOrder? = null): List<KotlinLibrary>
fun forEach(action: (KotlinLibrary, PackageAccessHandler) -> Unit)
}

View File

@@ -143,30 +143,30 @@ class KotlinLibraryResolverResultImpl(
private val roots: List<KotlinResolvedLibrary>
): KotlinLibraryResolveResult {
private val all: List<KotlinResolvedLibrary>
by lazy {
val result = mutableSetOf<KotlinResolvedLibrary>().also { it.addAll(roots) }
private val all: List<KotlinResolvedLibrary> by lazy {
val result = mutableSetOf<KotlinResolvedLibrary>().also { it.addAll(roots) }
var newDependencies = result.toList()
do {
newDependencies = newDependencies
.map { it.resolvedDependencies }.flatten()
var newDependencies = result.toList()
do {
newDependencies = newDependencies
.map { it -> it.resolvedDependencies }.flatten()
.filter { it !in result }
result.addAll(newDependencies)
} while (newDependencies.isNotEmpty())
result.addAll(newDependencies)
} while (newDependencies.isNotEmpty())
// return result.toList()
result.toList()
}
result.toList()
}
override fun filterRoots(predicate: (KotlinResolvedLibrary) -> Boolean) =
KotlinLibraryResolverResultImpl(roots.filter(predicate))
override fun getFullResolvedList(order: LibraryOrder?) = (order?.invoke(all) ?: all)
override fun getFullList(order: LibraryOrder?) = (order?.invoke(all) ?: all).asPlain()
override fun forEach(action: (KotlinLibrary, PackageAccessHandler) -> Unit) {
all.forEach { action(it.library, it) }
}
private fun List<KotlinResolvedLibrary>.asPlain() = map { it.library }
override fun toString() = "roots=$roots, all=$all"
}

View File

@@ -29,7 +29,7 @@ const val KLIB_PROPERTY_NATIVE_TARGETS = "native_targets"
interface BaseKotlinLibrary {
val libraryName: String
val libraryFile: File
val componentList: List<File>
val componentList: List<String>
val versions: KotlinLibraryVersioning
// Whether this library is default (provided by distribution)?
val isDefault: Boolean

View File

@@ -26,18 +26,18 @@ const val KLIB_IR_FOLDER_NAME = "ir"
* This scheme describes the Kotlin/Native Library (KLIB) layout.
*/
interface KotlinLibraryLayout {
val libFile: File
val libDir: File
val libraryName: String
get() = libFile.path
get() = libDir.path
val component: String?
val componentDir: File
get() = File(libFile, component!!)
get() = File(libDir, component!!)
val manifestFile
get() = File(componentDir, KLIB_MANIFEST_FILE_NAME)
val resourcesDir
get() = File(componentDir, "resources")
val pre_1_4_manifest: File
get() = File(libFile, KLIB_MANIFEST_FILE_NAME)
get() = File(libDir, KLIB_MANIFEST_FILE_NAME)
}
interface MetadataKotlinLibraryLayout : KotlinLibraryLayout {

View File

@@ -4,10 +4,7 @@ import org.jetbrains.kotlin.konan.CompilerVersion
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.library.impl.createKotlinLibraryComponents
import org.jetbrains.kotlin.library.impl.isPre_1_4_Library
import org.jetbrains.kotlin.util.Logger
import org.jetbrains.kotlin.util.WithLogger
import org.jetbrains.kotlin.util.removeSuffixIfPresent
import org.jetbrains.kotlin.util.suffixIfNot
import org.jetbrains.kotlin.util.*
import java.nio.file.InvalidPathException
import java.nio.file.Paths
@@ -146,7 +143,7 @@ abstract class KotlinLibrarySearchPathResolver<L : KotlinLibrary>(
.filterNotNull()
matching.firstOrNull() ?: run {
logger.fatal("Could not find \"$givenPath\" in ${searchRoots.map { it.absolutePath }}")
logger.fatal("Could not find \"$givenPath\" in ${searchRoots.map { it.absolutePath }}.")
}
} catch (e: Throwable) {
logger.error("Failed to resolve Kotlin library: $givenPath")
@@ -155,7 +152,7 @@ abstract class KotlinLibrarySearchPathResolver<L : KotlinLibrary>(
}
}
override fun libraryMatch(candidate: L, unresolved: UnresolvedLibrary): Boolean = true
override fun libraryMatch(candidate: L, unresolved: UnresolvedLibrary) = true
override fun resolve(givenPath: String) = resolve(UnresolvedLibrary(givenPath, null), false)

View File

@@ -17,9 +17,9 @@
package org.jetbrains.kotlin.library.impl
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.library.*
import org.jetbrains.kotlin.konan.properties.Properties
import org.jetbrains.kotlin.konan.properties.loadProperties
import org.jetbrains.kotlin.library.*
open class BaseKotlinLibraryImpl(
val access: BaseLibraryAccess<KotlinLibraryLayout>,
@@ -28,33 +28,15 @@ open class BaseKotlinLibraryImpl(
override val libraryFile get() = access.klib
override val libraryName: String by lazy { access.inPlace { it.libraryName } }
override val componentList: List<File> by lazy {
mutableListOf<File>().apply {
access.inPlace {
it.libFile.walk_workaround { f ->
if (f.isDirectory) {
val names = f.listFiles.map { sf -> sf.name }
if (KLIB_MANIFEST_FILE_NAME in names) {
add(f)
return@walk_workaround false
}
}
true
}
}
override val componentList: List<String> by lazy {
access.inPlace {
it.libDir.listFiles
.filter { it.isDirectory }
.filter { it.listFiles.map { it.name }.contains(KLIB_MANIFEST_FILE_NAME) }
.map { it.name }
}
}
// TODO: once bootstrap in K/N is updated drop it and replace with `walk`
private fun File.walk_workaround(_onFile: (File) -> Boolean) {
if (_onFile(this)) {
if (isDirectory) listFiles.forEach { it.walk_workaround(_onFile) }
}
}
fun fileList(): Collection<File> = access.inPlace { it.libFile.listFiles }
override fun toString() = "$libraryName[default=$isDefault]"
override val has_pre_1_4_manifest: Boolean by lazy {
@@ -247,11 +229,7 @@ open class KotlinLibraryImpl(
) : KotlinLibrary,
BaseKotlinLibrary by base,
MetadataLibrary by metadata,
IrLibrary by ir {
override fun toString(): String {
return "[Klib: ${base.libraryFile.name}, file: ${base.libraryFile.path}]"
}
}
IrLibrary by ir
fun createKotlinLibrary(
libraryFile: File,
@@ -277,7 +255,7 @@ fun createKotlinLibraryComponents(
val baseAccess = BaseLibraryAccess<KotlinLibraryLayout>(libraryFile, null)
val base = BaseKotlinLibraryImpl(baseAccess, isDefault)
return base.componentList.map {
createKotlinLibrary(libraryFile, it.path, isDefault)
createKotlinLibrary(libraryFile, it, isDefault)
}
}

View File

@@ -14,14 +14,14 @@ open class KotlinLibraryLayoutImpl(val klib: File, override val component: Strin
if (isZipped) zippedKotlinLibraryChecks(klib)
}
override val libFile = if (isZipped) File("/") else klib
override val libDir = if (isZipped) File("/") else klib
override val libraryName
get() =
if (isZipped)
klib.path.removeSuffixIfPresent(KLIB_FILE_EXTENSION_WITH_DOT)
else
libFile.path
libDir.path
open val extractingToTemp: KotlinLibraryLayout by lazy {
ExtractingBaseLibraryImpl(this)
@@ -84,7 +84,7 @@ open class FromZipBaseLibraryImpl(zipped: KotlinLibraryLayoutImpl, zipFileSystem
KotlinLibraryLayout {
override val libraryName = zipped.libraryName
override val libFile = zipFileSystem.file(zipped.libFile)
override val libDir = zipFileSystem.file(zipped.libDir)
override val component = zipped.component
}
@@ -113,7 +113,7 @@ fun KotlinLibraryLayoutImpl.extractDir(directory: File): File = this.klib.withZi
}
open class ExtractingKotlinLibraryLayout(zipped: KotlinLibraryLayoutImpl) : KotlinLibraryLayout {
override val libFile: File get() = error("Extracting layout doesn't extract its own root")
override val libDir: File get() = error("Extracting layout doesn't extract its own root")
override val libraryName = zipped.libraryName
override val component = zipped.component
}

View File

@@ -14,38 +14,32 @@ import org.jetbrains.kotlin.library.*
const val KLIB_DEFAULT_COMPONENT_NAME = "default"
open class KotlinLibraryLayoutForWriter(
override val libFile: File,
val unzippedDir: File,
override val libDir: File,
override val component: String = KLIB_DEFAULT_COMPONENT_NAME
) : KotlinLibraryLayout, MetadataKotlinLibraryLayout, IrKotlinLibraryLayout {
override val componentDir: File
get() = File(unzippedDir, component)
override val pre_1_4_manifest: File
get() = File(unzippedDir, KLIB_MANIFEST_FILE_NAME)
}
) : KotlinLibraryLayout, MetadataKotlinLibraryLayout, IrKotlinLibraryLayout
open class BaseWriterImpl(
val libraryLayout: KotlinLibraryLayoutForWriter,
moduleName: String,
_versions: KotlinLibraryVersioning,
override val versions: KotlinLibraryVersioning,
builtInsPlatform: BuiltInsPlatform,
nativeTargets: List<String> = emptyList(),
val nopack: Boolean = false,
val shortName: String? = null
) : BaseWriter {
val klibFile = libraryLayout.libFile
val klibFile = File("${libraryLayout.libDir.path}.$KLIB_FILE_EXTENSION")
val manifestProperties = Properties()
override val versions: KotlinLibraryVersioning = _versions
init {
// TODO: figure out the proper policy here.
klibFile.deleteRecursively()
klibFile.parentFile.run { if (!exists) mkdirs() }
libraryLayout.libDir.deleteRecursively()
klibFile.delete()
libraryLayout.libDir.mkdirs()
libraryLayout.resourcesDir.mkdirs()
// TODO: <name>:<hash> will go somewhere around here.
manifestProperties.setProperty(KLIB_PROPERTY_UNIQUE_NAME, moduleName)
manifestProperties.writeKonanLibraryVersioning(_versions)
manifestProperties.writeKonanLibraryVersioning(versions)
if (builtInsPlatform != BuiltInsPlatform.COMMON) {
manifestProperties.setProperty(KLIB_PROPERTY_BUILTINS_PLATFORM, builtInsPlatform.name)
@@ -82,8 +76,8 @@ open class BaseWriterImpl(
override fun commit() {
manifestProperties.saveToFile(libraryLayout.manifestFile)
if (!nopack) {
libraryLayout.unzippedDir.zipDirAs(klibFile)
libraryLayout.unzippedDir.deleteRecursively()
libraryLayout.libDir.zipDirAs(klibFile)
libraryLayout.libDir.deleteRecursively()
}
}
}
@@ -92,13 +86,16 @@ open class BaseWriterImpl(
* Requires non-null [target].
*/
class KotlinLibraryWriterImpl(
libDir: File,
moduleName: String,
versions: KotlinLibraryVersioning,
builtInsPlatform: BuiltInsPlatform,
nativeTargets: List<String>,
nopack: Boolean = false,
shortName: String? = null,
val layout: KotlinLibraryLayoutForWriter,
val layout: KotlinLibraryLayoutForWriter = KotlinLibraryLayoutForWriter(libDir),
val base: BaseWriter = BaseWriterImpl(layout, moduleName, versions, builtInsPlatform, nativeTargets, nopack, shortName),
metadata: MetadataWriter = MetadataWriterImpl(layout),
ir: IrWriter = IrMonoliticWriterImpl(layout)
@@ -121,11 +118,11 @@ fun buildKotlinLibrary(
nativeTargets: List<String> = emptyList()
): KotlinLibraryLayout {
val klibFile = File(output)
val unzippedKlibDir = if (nopack) klibFile.also { it.isDirectory } else org.jetbrains.kotlin.konan.file.createTempDir(moduleName)
val layout = KotlinLibraryLayoutForWriter(klibFile, unzippedKlibDir)
val klibDirectory = File(output)
val layout = KotlinLibraryLayoutForWriter(klibDirectory)
val irWriter = if (perFile) IrPerFileWriterImpl(layout) else IrMonoliticWriterImpl(layout)
val library = KotlinLibraryWriterImpl(
klibDirectory,
moduleName,
versions,
builtInsPlatform,
@@ -161,9 +158,9 @@ class KotlinLibraryOnlyIrWriter(output: String, moduleName: String, versions: Ko
nativeTargets: List<String>,
directory: File
): KotlinLibraryWriterImpl {
val layout = KotlinLibraryLayoutForWriter(directory, directory)
val layout = KotlinLibraryLayoutForWriter(directory)
val irWriter = if (perFile) IrPerFileWriterImpl(layout) else IrMonoliticWriterImpl(layout)
return KotlinLibraryWriterImpl(moduleName, versions, platform, nativeTargets, nopack = true, layout = layout, ir = irWriter)
return KotlinLibraryWriterImpl(directory, moduleName, versions, platform, nativeTargets, nopack = true, layout = layout, ir = irWriter)
}
fun invalidate() {

View File

@@ -1516,14 +1516,6 @@ fun main(args: Array<String>) {
model("incremental/js", extension = null, excludeParentDirs = true)
}
testClass<AbstractIncrementalMultiModuleJsCompilerRunnerTest> {
model("incremental/multiModule/common", extension = null, excludeParentDirs = true)
}
testClass<AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest>(annotations = listOf(muteExtraSuffix(".jsklib"))) {
model("incremental/multiModule/common", extension = null, excludeParentDirs = true)
}
testClass<AbstractIncrementalJsCompilerRunnerWithMetadataOnlyTest> {
model("incremental/pureKotlin", extension = null, recursive = false)
model("incremental/classHierarchyAffected", extension = null, recursive = false)

View File

@@ -1109,16 +1109,6 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes
runTest("jps-plugin/testData/incremental/pureKotlin/packageRemoved/");
}
@TestMetadata("parameterWithDefaultValueAdded")
public void testParameterWithDefaultValueAdded() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueAdded/");
}
@TestMetadata("parameterWithDefaultValueRemoved")
public void testParameterWithDefaultValueRemoved() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/parameterWithDefaultValueRemoved/");
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
runTest("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");

View File

@@ -1,52 +0,0 @@
================ Step #1 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/foo/AChild.class
End of files
Compiling files:
module2/src/AChild.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Cannot access 'A': it is private in file
'public' subclass exposes its 'private' supertype A
================ Step #2 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Compiling files:
module2/src/AChild.kt
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,52 +0,0 @@
================ Step #1 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/foo/AChild.class
End of files
Compiling files:
module2/src/AChild.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Cannot access 'A': it is private in file
'public' subclass exposes its 'private' supertype A
================ Step #2 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Compiling files:
module2/src/AChild.kt
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,23 +0,0 @@
================ Step #1 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/inline/InlineKt.class
End of files
Compiling files:
module1/src/inline.kt
End of files
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/usage/UsageKt.class
End of files
Compiling files:
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,47 +0,0 @@
================ Step #1 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/inline/InlineFKt.class
End of files
Compiling files:
module1/src/inlineF.kt
End of files
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/usage/UsageFKt.class
End of files
Compiling files:
End of files
Exit code: OK
------------------------------------------
================ Step #2 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/inline/InlineGKt.class
End of files
Compiling files:
module1/src/inlineG.kt
End of files
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/usage/UsageGKt.class
End of files
Compiling files:
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,67 +0,0 @@
================ Step #1 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
module2/src/importA.kt
module3/src/importAChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/foo/AChild.class
End of files
Compiling files:
module2/src/AChild.kt
module2/src/importA.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Cannot access 'A': it is private in file
'public' subclass exposes its 'private' supertype A
Cannot access 'A': it is private in file
================ Step #2 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
module2/src/importA.kt
module3/src/importAChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Compiling files:
module2/src/AChild.kt
module2/src/importA.kt
End of files
Exit code: OK
------------------------------------------
Building module3
Cleaning output files:
out/production/module3/META-INF/module3.kotlin_module
End of files
Compiling files:
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,67 +0,0 @@
================ Step #1 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
module2/src/importA.kt
module3/src/importAChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/foo/AChild.class
End of files
Compiling files:
module2/src/AChild.kt
module2/src/importA.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Cannot access 'A': it is private in file
'public' subclass exposes its 'private' supertype A
Cannot access 'A': it is private in file
================ Step #2 =================
Building module1
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/foo/A.class
End of files
Compiling files:
module1/src/A.kt
End of files
Marked as dirty by Kotlin:
module2/src/AChild.kt
module2/src/importA.kt
module3/src/importAChild.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Exit code: NOTHING_DONE
------------------------------------------
Building module2
Compiling files:
module2/src/AChild.kt
module2/src/importA.kt
End of files
Exit code: OK
------------------------------------------
Building module3
Cleaning output files:
out/production/module3/META-INF/module3.kotlin_module
End of files
Compiling files:
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,6 +0,0 @@
================ Step #1 =================
Compiling files:
module1/src/a.kt
End of files
Exit code: OK

View File

@@ -1,22 +0,0 @@
================ Step #1 =================
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/FunKt.class
End of files
Compiling files:
src/fun.kt
End of files
Marked as dirty by Kotlin:
src/useDefault.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/UseDefaultKt.class
End of files
Compiling files:
src/useDefault.kt
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,5 +0,0 @@
package test
fun f(x: Any) {
println("f(x: Any)")
}

View File

@@ -1,5 +0,0 @@
package test
fun f(x: Any, y: String = "D") {
println("f(x: Any, $y)")
}

View File

@@ -1,3 +0,0 @@
package other
fun other() {}

View File

@@ -1,5 +0,0 @@
package test
fun useDefault1() {
f(10)
}

View File

@@ -1,22 +0,0 @@
================ Step #1 =================
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/FunKt.class
End of files
Compiling files:
src/fun.kt
End of files
Marked as dirty by Kotlin:
src/useDefault.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/UseDefaultKt.class
End of files
Compiling files:
src/useDefault.kt
End of files
Exit code: OK
------------------------------------------

View File

@@ -1,6 +0,0 @@
package test
fun f(x: Any, y: String = "D") {
println("f(x: Any, $y)")
}

View File

@@ -1,5 +0,0 @@
package test
fun f(x: Any) {
println("f(x: Any)")
}

View File

@@ -1,3 +0,0 @@
package other
fun other() {}

View File

@@ -1,5 +0,0 @@
package test
fun useDefault1() {
f(10)
}

View File

@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer;
import org.jetbrains.kotlin.serialization.js.ModuleKind;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -90,7 +89,4 @@ public class JSConfigurationKeys {
public static final CompilerConfigurationKey<ErrorTolerancePolicy> ERROR_TOLERANCE_POLICY =
CompilerConfigurationKey.create("set up policy to ignore compilation errors");
public static final CompilerConfigurationKey<Collection<String>> REPOSITORIES =
CompilerConfigurationKey.create("set up additional repository paths");
}

View File

@@ -72,7 +72,7 @@ class ApiTest : KotlinTestWithEnvironment() {
val fullRuntimeKlib: String = System.getProperty("kotlin.js.full.stdlib.path")
val resolvedLibraries =
jsResolveLibraries(listOf(File(fullRuntimeKlib).absolutePath), emptyList(), messageCollectorLogger(MessageCollector.NONE))
jsResolveLibraries(listOf(File(fullRuntimeKlib).absolutePath), messageCollectorLogger(MessageCollector.NONE))
val project = environment.project
val configuration = environment.configuration

View File

@@ -106,7 +106,7 @@ abstract class BasicIrBoxTest(
compilationCache[it] ?: error("Can't find compiled module for dependency $it")
}).map { File(it).absolutePath }
val resolvedLibraries = jsResolveLibraries(allKlibPaths, emptyList(), messageCollectorLogger(MessageCollector.NONE))
val resolvedLibraries = jsResolveLibraries(allKlibPaths, messageCollectorLogger(MessageCollector.NONE))
val actualOutputFile = outputFile.absolutePath.let {
if (!isMainModule) it.replace("_v5.js", "/") else it

View File

@@ -77,17 +77,7 @@ public actual fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boole
*/
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
public actual fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolean = false): String {
if (ignoreCase) {
val matcher = Pattern.compile(oldValue, Pattern.LITERAL or Pattern.CASE_INSENSITIVE).matcher(this)
if (!matcher.find()) return this
val stringBuilder = StringBuilder()
var i = 0
do {
stringBuilder.append(this, i, matcher.start()).append(newValue)
i = matcher.end()
} while (matcher.find())
return stringBuilder.append(this, i, length).toString()
} else {
run {
var occurrenceIndex: Int = indexOf(oldValue, 0, ignoreCase)
// FAST PATH: no match
if (occurrenceIndex < 0) return this

View File

@@ -896,6 +896,22 @@ class StringTest {
assertEquals("-a-b-b-A-b-", input.replace("", "-"))
assertEquals("-a-b-b-A-b-", input.replace("", "-", ignoreCase = true))
fun testIgnoreCase(chars: String) {
for ((i, c) in chars.withIndex()) {
val message = "Char: $c (${c.toInt()})"
val expectOneReplaced = chars.replaceRange(i..i, "_")
val expectAllReplaced = "_".repeat(chars.length)
assertEquals(expectOneReplaced, chars.replace(c, '_'), message)
assertEquals(expectAllReplaced, chars.replace(c, '_', ignoreCase = true), "$message, ignoreCase")
assertEquals(expectOneReplaced, chars.replace(c.toString(), "_"), "$message, as string")
assertEquals(expectAllReplaced, chars.replace(c.toString(), "_", ignoreCase = true), "$message, as string, ignoreCase")
}
}
testIgnoreCase("üÜ")
testIgnoreCase("öÖ")
testIgnoreCase("äÄ")
}
@Test fun replaceFirst() {

View File

@@ -18,6 +18,5 @@ internal const val GENERATE_D_TS = "-Xgenerate-dts"
internal const val PRODUCE_JS = "-Xir-produce-js"
internal const val PRODUCE_UNZIPPED_KLIB = "-Xir-produce-klib-dir"
internal const val PRODUCE_ZIPPED_KLIB = "-Xir-produce-klib-file"
internal const val MODULE_NAME = "-Xir-module-name"

View File

@@ -17,7 +17,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinTasksProvider
import org.jetbrains.kotlin.gradle.testing.internal.kotlinTestRegistry
import org.jetbrains.kotlin.gradle.testing.testTaskName
import org.jetbrains.kotlin.gradle.utils.klibModuleName
import java.io.File
open class KotlinJsIrTargetConfigurator(kotlinPluginVersion: String) :
KotlinOnlyTargetConfigurator<KotlinJsIrCompilation, KotlinJsIrTarget>(true, true, kotlinPluginVersion),
@@ -69,34 +68,18 @@ open class KotlinJsIrTargetConfigurator(kotlinPluginVersion: String) :
compilation.kotlinOptions {
configureOptions()
var produceUnzippedKlib = PRODUCE_UNZIPPED_KLIB in freeCompilerArgs
var produceZippedKlib = PRODUCE_ZIPPED_KLIB in freeCompilerArgs
freeCompilerArgs = freeCompilerArgs + DISABLE_PRE_IR
val isMainCompilation = compilation.isMain()
if (!produceUnzippedKlib && !produceZippedKlib) {
freeCompilerArgs = freeCompilerArgs + PRODUCE_UNZIPPED_KLIB
produceUnzippedKlib = true
}
freeCompilerArgs += listOf(
DISABLE_PRE_IR,
PRODUCE_UNZIPPED_KLIB
)
// Configure FQ module name to avoid cyclic dependencies in klib manifests (see KT-36721).
val baseName = if (isMainCompilation) {
val baseName = if (compilation.isMain()) {
target.project.name
} else {
"${target.project.name}_${compilation.name}"
}
val klibModuleName = target.project.klibModuleName(baseName)
val outFileName = if (produceUnzippedKlib) klibModuleName else "$klibModuleName.$KLIB_TYPE"
val destinationDir = compilation.compileKotlinTask.destinationDir
outputFile = File(destinationDir, outFileName).canonicalPath
freeCompilerArgs = freeCompilerArgs + "$MODULE_NAME=$klibModuleName"
freeCompilerArgs += listOf("$MODULE_NAME=${target.project.klibModuleName(baseName)}")
}
compilation.binaries

View File

@@ -44,6 +44,9 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.associateWithTransitiveClosure
import org.jetbrains.kotlin.gradle.plugin.mpp.ownModuleName
import org.jetbrains.kotlin.gradle.report.ReportingSettings
import org.jetbrains.kotlin.gradle.utils.*
import org.jetbrains.kotlin.gradle.utils.isParentOf
import org.jetbrains.kotlin.gradle.utils.pathsAsStringRelativeTo
import org.jetbrains.kotlin.gradle.utils.toSortedPathsArray
import org.jetbrains.kotlin.incremental.ChangedFiles
import org.jetbrains.kotlin.library.impl.isKotlinLibrary
import org.jetbrains.kotlin.utils.JsLibraryUtils
@@ -273,7 +276,6 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractKo
@get:Internal
internal var coroutinesFromGradleProperties: Coroutines? = null
// Input is needed to force rebuild even if source files are not changed
@get:Input
@@ -629,29 +631,15 @@ open class Kotlin2JsCompile : AbstractKotlinCompile<K2JSCompilerArguments>(), Ko
override fun isIncrementalCompilationEnabled(): Boolean =
when {
"-Xir-produce-js" in kotlinOptions.freeCompilerArgs -> false
"-Xir-produce-klib-dir" in kotlinOptions.freeCompilerArgs -> false // TODO: it's not supported yet
"-Xir-produce-klib-dir" in kotlinOptions.freeCompilerArgs -> incrementalJsKlib
"-Xir-produce-klib-file" in kotlinOptions.freeCompilerArgs -> incrementalJsKlib
else -> incremental
}
@get:Internal
val outputFile: File
get() = outputFilePath?.let(::File) ?: defaultOutputFile
@Suppress("unused")
@get:OutputFile
@get:Optional
val outputFileOrNull: File?
get() = outputFile.let { file ->
if (file.isFile) {
file
} else {
null
}
}
@get:Input
val outputFilePath: String?
get() = kotlinOptions.outputFile
val outputFile: File
get() = kotlinOptions.outputFile?.let(::File) ?: defaultOutputFile
override fun findKotlinCompilerClasspath(project: Project): List<File> =
findKotlinJsCompilerClasspath(project)

View File

@@ -13,11 +13,10 @@ import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.*
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.CirTreeMerger.CirTreeMergeResult
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.storage.StorageManager
import org.jetbrains.kotlin.descriptors.commonizer.Result as CommonizerResult
fun runCommonization(parameters: Parameters): CommonizerResult {
fun runCommonization(parameters: Parameters): Result {
if (!parameters.hasAnythingToCommonize())
return CommonizerResult.NothingToCommonize
return Result.NothingToCommonize
val storageManager = LockBasedStorageManager("Declaration descriptors commonization")
@@ -45,7 +44,7 @@ fun runCommonization(parameters: Parameters): CommonizerResult {
parameters.progressLogger?.invoke("Prepared new descriptors")
return CommonizerResult.Commonized(modulesByTargets)
return Result.Commonized(modulesByTargets)
}
private fun mergeAndCommonize(storageManager: StorageManager, parameters: Parameters): CirTreeMergeResult {

View File

@@ -12,8 +12,7 @@ import org.jetbrains.kotlin.builtins.konan.KonanBuiltIns
import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.commonizer.*
import org.jetbrains.kotlin.descriptors.commonizer.Target as CommonizerTarget
import org.jetbrains.kotlin.descriptors.commonizer.Result as CommonizerResult
import org.jetbrains.kotlin.descriptors.commonizer.Target
import org.jetbrains.kotlin.descriptors.commonizer.konan.NativeDistributionCommonizer.StatsType.*
import org.jetbrains.kotlin.descriptors.commonizer.stats.AggregatedStatsCollector
import org.jetbrains.kotlin.descriptors.commonizer.stats.FileStatsOutput
@@ -27,7 +26,6 @@ import org.jetbrains.kotlin.library.SerializedMetadata
import org.jetbrains.kotlin.library.ToolingSingleFileKlibResolveStrategy
import org.jetbrains.kotlin.library.impl.BaseWriterImpl
import org.jetbrains.kotlin.library.impl.BuiltInsPlatform
import org.jetbrains.kotlin.library.impl.KotlinLibraryLayoutForWriter
import org.jetbrains.kotlin.library.impl.KotlinLibraryWriterImpl
import org.jetbrains.kotlin.library.resolveSingleFileKlib
import org.jetbrains.kotlin.name.Name
@@ -138,7 +136,7 @@ class NativeDistributionCommonizer(
return library
}
private fun commonize(allLibraries: AllNativeLibraries): CommonizerResult {
private fun commonize(allLibraries: AllNativeLibraries): Result {
val statsCollector = when (statsType) {
RAW -> RawStatsCollector(targets, FileStatsOutput(destination, "raw"))
AGGREGATED -> AggregatedStatsCollector(targets, FileStatsOutput(destination, "aggregated"))
@@ -172,13 +170,13 @@ class NativeDistributionCommonizer(
}
}
private fun saveModules(originalLibraries: AllNativeLibraries, result: CommonizerResult) {
private fun saveModules(originalLibraries: AllNativeLibraries, result: Result) {
// optimization: stdlib and endorsed libraries effectively remain the same across all Kotlin/Native targets,
// so they can be just copied to the new destination without running serializer
copyCommonStandardLibraries()
when (result) {
is CommonizerResult.NothingToCommonize -> {
is Result.NothingToCommonize -> {
// It may happen that all targets to be commonized (or at least all but one target) miss platform libraries.
// In such case commonizer will do nothing and return a special result value 'NothingToCommonize'.
// So, let's just copy platform libraries from the target where they are to the new destination.
@@ -187,7 +185,7 @@ class NativeDistributionCommonizer(
}
}
is CommonizerResult.Commonized -> {
is Result.Commonized -> {
val serializer = KlibMetadataMonolithicSerializer(
languageVersionSettings = LanguageVersionSettingsImpl.DEFAULT,
metadataVersion = KlibMetadataVersion.INSTANCE,
@@ -268,7 +266,7 @@ class NativeDistributionCommonizer(
}
private fun serializeTarget(
target: CommonizerTarget,
target: Target,
targetName: String,
newModules: Collection<ModuleDescriptor>,
absentModuleLocations: List<File>,
@@ -306,16 +304,14 @@ class NativeDistributionCommonizer(
manifestData: NativeSensitiveManifestData,
destination: File
) {
val kDestination = KFile(destination.path)
val layout = KotlinLibraryLayoutForWriter(kDestination, kDestination)
val library = KotlinLibraryWriterImpl(
libDir = KFile(destination.path),
moduleName = manifestData.uniqueName,
versions = manifestData.versions,
builtInsPlatform = BuiltInsPlatform.NATIVE,
nativeTargets = emptyList(), // will be overwritten with NativeSensitiveManifestData.applyTo() below
nopack = true,
shortName = manifestData.shortName,
layout = layout
shortName = manifestData.shortName
)
library.addMetadata(metadata)
manifestData.applyTo(library.base as BaseWriterImpl)
@@ -327,7 +323,7 @@ class NativeDistributionCommonizer(
.resolve(KONAN_DISTRIBUTION_PLATFORM_LIBS_DIR)
.resolve(name)
private val CommonizerTarget.librariesDestination: File
private val Target.librariesDestination: File
get() = when (this) {
is LeafTarget -> destination.resolve(KONAN_DISTRIBUTION_PLATFORM_LIBS_DIR).resolve(name)
is SharedTarget -> destination.resolve(KONAN_DISTRIBUTION_COMMON_LIBS_DIR)

View File

@@ -116,7 +116,6 @@ fun readLibrariesFromConfiguration(configuration: CompilerConfiguration): List<M
val libraries = scriptDependencies.map { (it as JsDependency).path }
val resolvedLibraries = jsResolveLibraries(
libraries,
emptyList(),
object : Logger {
private val collector = configuration[CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY] ?: MessageCollector.NONE
override fun warning(message: String) = collector.report(CompilerMessageSeverity.STRONG_WARNING, message)