From bba0dfb4693b888df0266e6aa4cce6b3c7f0e2c0 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Thu, 15 Jul 2021 18:21:46 +0300 Subject: [PATCH] Cleanup as42 bunch files We don't build AS42 plugin from main kotlin repo anymore. --- .bunch | 3 +- .../android/tests/AndroidRunner.java.as42 | 0 .../META-INF/extensions/core.xml.as42 | 10 - .../jvm/compiler/KotlinCoreDumbUtil.kt.as42 | 19 - .../compiler/KotlinCoreEnvironment.kt.as42 | 722 ---------- .../JUnit3RunnerWithInnersForJPS.java.as42 | 184 --- .../generators/tests/GenerateTests.kt.as42 | 1224 ----------------- gradle/versions.properties.as42 | 23 - 8 files changed, 1 insertion(+), 2184 deletions(-) delete mode 100644 compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java.as42 delete mode 100644 compiler/cli/cli-common/resources/META-INF/extensions/core.xml.as42 delete mode 100644 compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreDumbUtil.kt.as42 delete mode 100644 compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt.as42 delete mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/test/JUnit3RunnerWithInnersForJPS.java.as42 delete mode 100644 generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as42 delete mode 100644 gradle/versions.properties.as42 diff --git a/.bunch b/.bunch index 7d895f57cd0..e4cd0007c6f 100644 --- a/.bunch +++ b/.bunch @@ -1,3 +1,2 @@ 202 -203_202 -as42 +203_202 \ No newline at end of file diff --git a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java.as42 b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java.as42 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/compiler/cli/cli-common/resources/META-INF/extensions/core.xml.as42 b/compiler/cli/cli-common/resources/META-INF/extensions/core.xml.as42 deleted file mode 100644 index da66522edb3..00000000000 --- a/compiler/cli/cli-common/resources/META-INF/extensions/core.xml.as42 +++ /dev/null @@ -1,10 +0,0 @@ - - org.jetbrains.kotlin - 1.2 - - - - - diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreDumbUtil.kt.as42 b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreDumbUtil.kt.as42 deleted file mode 100644 index 36bae41b93b..00000000000 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreDumbUtil.kt.as42 +++ /dev/null @@ -1,19 +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.cli.jvm.compiler - -import com.intellij.openapi.project.DumbUtil - -@Suppress("UnstableApiUsage") -class KotlinCoreDumbUtil : DumbUtil { - override fun filterByDumbAwarenessHonoringIgnoring(collection: Collection): List = - when (collection) { - is List -> collection - else -> ArrayList(collection) - } - - override fun mayUseIndices(): Boolean = false -} \ No newline at end of file diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt.as42 b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt.as42 deleted file mode 100644 index 560e32e1ef5..00000000000 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt.as42 +++ /dev/null @@ -1,722 +0,0 @@ -/* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.cli.jvm.compiler - -import com.intellij.codeInsight.ExternalAnnotationsManager -import com.intellij.codeInsight.InferredAnnotationsManager -import com.intellij.core.CoreApplicationEnvironment -import com.intellij.core.CoreJavaFileManager -import com.intellij.core.JavaCoreProjectEnvironment -import com.intellij.ide.highlighter.JavaFileType -import com.intellij.lang.java.JavaParserDefinition -import com.intellij.mock.MockProject -import com.intellij.openapi.Disposable -import com.intellij.openapi.application.ApplicationManager -import com.intellij.openapi.application.TransactionGuard -import com.intellij.openapi.application.TransactionGuardImpl -import com.intellij.openapi.components.ServiceManager -import com.intellij.openapi.diagnostic.Logger -import com.intellij.openapi.extensions.ExtensionsArea -import com.intellij.openapi.fileTypes.PlainTextFileType -import com.intellij.openapi.project.DumbUtil -import com.intellij.openapi.project.Project -import com.intellij.openapi.util.Disposer -import com.intellij.openapi.util.io.FileUtilRt -import com.intellij.openapi.util.text.StringUtil -import com.intellij.openapi.vfs.* -import com.intellij.openapi.vfs.impl.ZipHandler -import com.intellij.psi.PsiElementFinder -import com.intellij.psi.PsiManager -import com.intellij.psi.impl.JavaClassSupersImpl -import com.intellij.psi.impl.PsiElementFinderImpl -import com.intellij.psi.impl.PsiTreeChangePreprocessor -import com.intellij.psi.impl.file.impl.JavaFileManager -import com.intellij.psi.search.GlobalSearchScope -import com.intellij.psi.util.JavaClassSupers -import com.intellij.util.io.URLUtil -import com.intellij.util.lang.UrlClassLoader -import org.jetbrains.annotations.TestOnly -import org.jetbrains.kotlin.asJava.KotlinAsJavaSupport -import org.jetbrains.kotlin.asJava.LightClassGenerationSupport -import org.jetbrains.kotlin.asJava.classes.FacadeCache -import org.jetbrains.kotlin.asJava.finder.JavaElementFinder -import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension -import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys -import org.jetbrains.kotlin.cli.common.CliModuleVisibilityManagerImpl -import org.jetbrains.kotlin.cli.common.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY -import org.jetbrains.kotlin.cli.common.config.ContentRoot -import org.jetbrains.kotlin.cli.common.config.KotlinSourceRoot -import org.jetbrains.kotlin.cli.common.config.kotlinSourceRoots -import org.jetbrains.kotlin.cli.common.extensions.ScriptEvaluationExtension -import org.jetbrains.kotlin.cli.common.extensions.ShellExtension -import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity -import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.ERROR -import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.STRONG_WARNING -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.cli.common.toBooleanLenient -import org.jetbrains.kotlin.cli.jvm.JvmRuntimeVersionsConsistencyChecker -import org.jetbrains.kotlin.cli.jvm.config.* -import org.jetbrains.kotlin.cli.jvm.index.* -import org.jetbrains.kotlin.cli.jvm.javac.JavacWrapperRegistrar -import org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder -import org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleResolver -import org.jetbrains.kotlin.cli.jvm.modules.CoreJrtFileSystem -import org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension -import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension -import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar -import org.jetbrains.kotlin.config.* -import org.jetbrains.kotlin.extensions.* -import org.jetbrains.kotlin.extensions.internal.CandidateInterceptor -import org.jetbrains.kotlin.extensions.internal.TypeResolutionInterceptor -import org.jetbrains.kotlin.idea.KotlinFileType -import org.jetbrains.kotlin.js.translate.extensions.JsSyntheticTranslateExtension -import org.jetbrains.kotlin.load.kotlin.KotlinBinaryClassCache -import org.jetbrains.kotlin.load.kotlin.MetadataFinderFactory -import org.jetbrains.kotlin.load.kotlin.ModuleVisibilityManager -import org.jetbrains.kotlin.load.kotlin.VirtualFileFinderFactory -import org.jetbrains.kotlin.parsing.KotlinParserDefinition -import org.jetbrains.kotlin.psi.KtFile -import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer -import org.jetbrains.kotlin.resolve.ModuleAnnotationsResolver -import org.jetbrains.kotlin.resolve.extensions.ExtraImportsProviderExtension -import org.jetbrains.kotlin.resolve.jvm.extensions.SyntheticJavaResolveExtension -import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension -import org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade -import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension -import org.jetbrains.kotlin.resolve.jvm.extensions.PackageFragmentProviderExtension -import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleResolver -import org.jetbrains.kotlin.resolve.lazy.declarations.CliDeclarationProviderFactoryService -import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactoryService -import org.jetbrains.kotlin.serialization.DescriptorSerializerPlugin -import org.jetbrains.kotlin.utils.PathUtil -import java.io.File -import java.nio.file.FileSystems -import java.util.zip.ZipFile - -class KotlinCoreEnvironment private constructor( - val projectEnvironment: JavaCoreProjectEnvironment, - initialConfiguration: CompilerConfiguration, - configFiles: EnvironmentConfigFiles -) { - - class ProjectEnvironment( - disposable: Disposable, applicationEnvironment: KotlinCoreApplicationEnvironment - ) : - KotlinCoreProjectEnvironment(disposable, applicationEnvironment) { - - private var extensionRegistered = false - - override fun preregisterServices() { - registerProjectExtensionPoints(project.extensionArea) - } - - fun registerExtensionsFromPlugins(configuration: CompilerConfiguration) { - if (!extensionRegistered) { - registerPluginExtensionPoints(project) - registerExtensionsFromPlugins(project, configuration) - extensionRegistered = true - } - } - - override fun registerJavaPsiFacade() { - with(project) { - registerService( - CoreJavaFileManager::class.java, - ServiceManager.getService(this, JavaFileManager::class.java) as CoreJavaFileManager - ) - - registerKotlinLightClassSupport(project) - - registerService(ExternalAnnotationsManager::class.java, MockExternalAnnotationsManager()) - registerService(InferredAnnotationsManager::class.java, MockInferredAnnotationsManager()) - } - - super.registerJavaPsiFacade() - } - } - - private val sourceFiles = mutableListOf() - private val rootsIndex: JvmDependenciesDynamicCompoundIndex - private val packagePartProviders = mutableListOf() - - private val classpathRootsResolver: ClasspathRootsResolver - private val initialRoots = ArrayList() - - val configuration: CompilerConfiguration = initialConfiguration.apply { setupJdkClasspathRoots(configFiles) }.copy() - - init { - PersistentFSConstants::class.java.getDeclaredField("ourMaxIntellisenseFileSize") - .apply { isAccessible = true } - .setInt(null, FileUtilRt.LARGE_FOR_CONTENT_LOADING) - - val project = projectEnvironment.project - - val messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY) - - (projectEnvironment as? ProjectEnvironment)?.registerExtensionsFromPlugins(configuration) - // otherwise consider that project environment is properly configured before passing to the environment - // TODO: consider some asserts to check important extension points - - project.registerService(DeclarationProviderFactoryService::class.java, CliDeclarationProviderFactoryService(sourceFiles)) - - val isJvm = configFiles == EnvironmentConfigFiles.JVM_CONFIG_FILES - project.registerService(ModuleVisibilityManager::class.java, CliModuleVisibilityManagerImpl(isJvm)) - - registerProjectServicesForCLI(projectEnvironment) - - registerProjectServices(projectEnvironment.project) - - for (extension in CompilerConfigurationExtension.getInstances(project)) { - extension.updateConfiguration(configuration) - } - - sourceFiles += createKtFiles(project) - - collectAdditionalSources(project) - - sourceFiles.sortBy { it.virtualFile.path } - - val javaFileManager = ServiceManager.getService(project, CoreJavaFileManager::class.java) as KotlinCliJavaFileManagerImpl - - val jdkHome = configuration.get(JVMConfigurationKeys.JDK_HOME) - val jrtFileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.JRT_PROTOCOL) - val javaModuleFinder = CliJavaModuleFinder( - jdkHome?.path?.let { path -> - jrtFileSystem?.findFileByPath(path + URLUtil.JAR_SEPARATOR) - }, - javaFileManager - ) - - val outputDirectory = - configuration.get(JVMConfigurationKeys.MODULES)?.singleOrNull()?.getOutputDirectory() - ?: configuration.get(JVMConfigurationKeys.OUTPUT_DIRECTORY)?.absolutePath - - classpathRootsResolver = ClasspathRootsResolver( - PsiManager.getInstance(project), - messageCollector, - configuration.getList(JVMConfigurationKeys.ADDITIONAL_JAVA_MODULES), - this::contentRootToVirtualFile, - javaModuleFinder, - !configuration.getBoolean(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE), - outputDirectory?.let(this::findLocalFile), - javaFileManager - ) - - val (initialRoots, javaModules) = - classpathRootsResolver.convertClasspathRoots(configuration.getList(CLIConfigurationKeys.CONTENT_ROOTS)) - this.initialRoots.addAll(initialRoots) - - if (!configuration.getBoolean(JVMConfigurationKeys.SKIP_RUNTIME_VERSION_CHECK) && messageCollector != null) { - JvmRuntimeVersionsConsistencyChecker.checkCompilerClasspathConsistency( - messageCollector, - configuration, - initialRoots.mapNotNull { (file, type) -> if (type == JavaRoot.RootType.BINARY) file else null } - ) - } - - val (roots, singleJavaFileRoots) = - initialRoots.partition { (file) -> file.isDirectory || file.extension != JavaFileType.DEFAULT_EXTENSION } - - // REPL and kapt2 update classpath dynamically - rootsIndex = JvmDependenciesDynamicCompoundIndex().apply { - addIndex(JvmDependenciesIndexImpl(roots)) - updateClasspathFromRootsIndex(this) - } - - javaFileManager.initialize( - rootsIndex, - packagePartProviders, - SingleJavaFileRootsIndex(singleJavaFileRoots), - configuration.getBoolean(JVMConfigurationKeys.USE_PSI_CLASS_FILES_READING) - ) - - project.registerService( - JavaModuleResolver::class.java, - CliJavaModuleResolver(classpathRootsResolver.javaModuleGraph, javaModules, javaModuleFinder.systemModules.toList(), project) - ) - - val finderFactory = CliVirtualFileFinderFactory(rootsIndex) - project.registerService(MetadataFinderFactory::class.java, finderFactory) - project.registerService(VirtualFileFinderFactory::class.java, finderFactory) - - project.putUserData(APPEND_JAVA_SOURCE_ROOTS_HANDLER_KEY, fun(roots: List) { - updateClasspath(roots.map { JavaSourceRoot(it, null) }) - }) - } - - private fun collectAdditionalSources(project: MockProject) { - var unprocessedSources: Collection = sourceFiles - val processedSources = HashSet() - val processedSourcesByExtension = HashMap>() - // repeat feeding extensions with sources while new sources a being added - var sourceCollectionIterations = 0 - while (unprocessedSources.isNotEmpty()) { - if (sourceCollectionIterations++ > 10) { // TODO: consider using some appropriate global constant - throw IllegalStateException("Unable to collect additional sources in reasonable number of iterations") - } - processedSources.addAll(unprocessedSources) - val allNewSources = ArrayList() - for (extension in CollectAdditionalSourcesExtension.getInstances(project)) { - // do not feed the extension with the sources it returned on the previous iteration - val sourcesToProcess = unprocessedSources - (processedSourcesByExtension[extension] ?: emptyList()) - val newSources = extension.collectAdditionalSourcesAndUpdateConfiguration(sourcesToProcess, configuration, project) - if (newSources.isNotEmpty()) { - allNewSources.addAll(newSources) - processedSourcesByExtension[extension] = newSources - } - } - unprocessedSources = allNewSources.filterNot { processedSources.contains(it) }.distinct() - sourceFiles += unprocessedSources - } - } - - fun addKotlinSourceRoots(rootDirs: List) { - val roots = rootDirs.map { KotlinSourceRoot(it.absolutePath, isCommon = false) } - sourceFiles += createSourceFilesFromSourceRoots(configuration, project, roots) - } - - fun createPackagePartProvider(scope: GlobalSearchScope): JvmPackagePartProvider { - return JvmPackagePartProvider(configuration.languageVersionSettings, scope).apply { - addRoots(initialRoots, configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY)) - packagePartProviders += this - (ModuleAnnotationsResolver.getInstance(project) as CliModuleAnnotationsResolver).addPackagePartProvider(this) - } - } - - private val VirtualFile.javaFiles: List - get() = mutableListOf().apply { - VfsUtilCore.processFilesRecursively(this@javaFiles) { file -> - if (file.fileType == JavaFileType.INSTANCE) { - add(file) - } - true - } - } - - private val allJavaFiles: List - get() = configuration.javaSourceRoots - .mapNotNull(this::findLocalFile) - .flatMap { it.javaFiles } - .map { File(it.canonicalPath) } - - fun registerJavac( - javaFiles: List = allJavaFiles, - kotlinFiles: List = sourceFiles, - arguments: Array? = null, - bootClasspath: List? = null, - sourcePath: List? = null - ): Boolean { - return JavacWrapperRegistrar.registerJavac( - projectEnvironment.project, configuration, javaFiles, kotlinFiles, arguments, bootClasspath, sourcePath, - LightClassGenerationSupport.getInstance(project), packagePartProviders - ) - } - - private val applicationEnvironment: CoreApplicationEnvironment - get() = projectEnvironment.environment - - val project: Project - get() = projectEnvironment.project - - internal fun countLinesOfCode(sourceFiles: List): Int = - sourceFiles.sumBy { sourceFile -> - val text = sourceFile.text - StringUtil.getLineBreakCount(text) + (if (StringUtil.endsWithLineBreak(text)) 0 else 1) - } - - private fun updateClasspathFromRootsIndex(index: JvmDependenciesIndex) { - index.indexedRoots.forEach { - projectEnvironment.addSourcesToClasspath(it.file) - } - } - - fun updateClasspath(contentRoots: List): List? { - // TODO: add new Java modules to CliJavaModuleResolver - val newRoots = classpathRootsResolver.convertClasspathRoots(contentRoots).roots - - if (packagePartProviders.isEmpty()) { - initialRoots.addAll(newRoots) - } else { - for (packagePartProvider in packagePartProviders) { - packagePartProvider.addRoots(newRoots, configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY)) - } - } - - return rootsIndex.addNewIndexForRoots(newRoots)?.let { newIndex -> - updateClasspathFromRootsIndex(newIndex) - newIndex.indexedRoots.mapNotNull { (file) -> - VfsUtilCore.virtualToIoFile(VfsUtilCore.getVirtualFileForJar(file) ?: file) - }.toList() - }.orEmpty() - } - - private fun contentRootToVirtualFile(root: JvmContentRoot): VirtualFile? = - when (root) { - is JvmClasspathRoot -> - if (root.file.isFile) findJarRoot(root.file) else findExistingRoot(root, "Classpath entry") - is JvmModulePathRoot -> - if (root.file.isFile) findJarRoot(root.file) else findExistingRoot(root, "Java module root") - is JavaSourceRoot -> - findExistingRoot(root, "Java source root") - else -> - throw IllegalStateException("Unexpected root: $root") - } - - internal fun findLocalFile(path: String): VirtualFile? = - applicationEnvironment.localFileSystem.findFileByPath(path) - - private fun findExistingRoot(root: JvmContentRoot, rootDescription: String): VirtualFile? { - return findLocalFile(root.file.absolutePath).also { - if (it == null) { - report(STRONG_WARNING, "$rootDescription points to a non-existent location: ${root.file}") - } - } - } - - private fun findJarRoot(file: File): VirtualFile? = - applicationEnvironment.jarFileSystem.findFileByPath("$file${URLUtil.JAR_SEPARATOR}") - - private fun getSourceRootsCheckingForDuplicates(): List { - val uniqueSourceRoots = hashSetOf() - val result = mutableListOf() - - for (root in configuration.kotlinSourceRoots) { - if (!uniqueSourceRoots.add(root.path)) { - report(STRONG_WARNING, "Duplicate source root: ${root.path}") - } - result.add(root) - } - - return result - } - - fun getSourceFiles(): List = sourceFiles - - private fun createKtFiles(project: Project): List = - createSourceFilesFromSourceRoots(configuration, project, getSourceRootsCheckingForDuplicates()) - - internal fun report(severity: CompilerMessageSeverity, message: String) = configuration.report(severity, message) - - companion object { - private val LOG = Logger.getInstance(KotlinCoreEnvironment::class.java) - - private val APPLICATION_LOCK = Object() - private var ourApplicationEnvironment: KotlinCoreApplicationEnvironment? = null - private var ourProjectCount = 0 - - @JvmStatic - fun createForProduction( - parentDisposable: Disposable, configuration: CompilerConfiguration, configFiles: EnvironmentConfigFiles - ): KotlinCoreEnvironment { - setupIdeaStandaloneExecution() - val appEnv = getOrCreateApplicationEnvironmentForProduction(parentDisposable, configuration) - val projectEnv = ProjectEnvironment(parentDisposable, appEnv) - val environment = KotlinCoreEnvironment(projectEnv, configuration, configFiles) - - synchronized(APPLICATION_LOCK) { - ourProjectCount++ - } - return environment - } - - @JvmStatic - fun createForProduction( - projectEnvironment: JavaCoreProjectEnvironment, configuration: CompilerConfiguration, configFiles: EnvironmentConfigFiles - ): KotlinCoreEnvironment { - val environment = KotlinCoreEnvironment(projectEnvironment, configuration, configFiles) - - if (projectEnvironment.environment == applicationEnvironment) { - // accounting for core environment disposing - synchronized(APPLICATION_LOCK) { - ourProjectCount++ - } - } - return environment - } - - @TestOnly - @JvmStatic - fun createForTests( - parentDisposable: Disposable, initialConfiguration: CompilerConfiguration, extensionConfigs: EnvironmentConfigFiles - ): KotlinCoreEnvironment { - val configuration = initialConfiguration.copy() - // Tests are supposed to create a single project and dispose it right after use - val appEnv = createApplicationEnvironment(parentDisposable, configuration, unitTestMode = true) - val projectEnv = ProjectEnvironment(parentDisposable, appEnv) - return KotlinCoreEnvironment(projectEnv, configuration, extensionConfigs) - } - - @TestOnly - @JvmStatic - fun createForTests( - projectEnvironment: ProjectEnvironment, initialConfiguration: CompilerConfiguration, extensionConfigs: EnvironmentConfigFiles - ): KotlinCoreEnvironment { - return KotlinCoreEnvironment(projectEnvironment, initialConfiguration, extensionConfigs) - } - - @TestOnly - fun createProjectEnvironmentForTests(parentDisposable: Disposable, configuration: CompilerConfiguration): ProjectEnvironment { - val appEnv = createApplicationEnvironment(parentDisposable, configuration, unitTestMode = true) - return ProjectEnvironment(parentDisposable, appEnv) - } - - // used in the daemon for jar cache cleanup - val applicationEnvironment: KotlinCoreApplicationEnvironment? get() = ourApplicationEnvironment - - fun getOrCreateApplicationEnvironmentForProduction( - parentDisposable: Disposable, configuration: CompilerConfiguration - ): KotlinCoreApplicationEnvironment = getOrCreateApplicationEnvironment(parentDisposable, configuration, unitTestMode = false) - - fun getOrCreateApplicationEnvironmentForTests( - parentDisposable: Disposable, configuration: CompilerConfiguration - ): KotlinCoreApplicationEnvironment = getOrCreateApplicationEnvironment(parentDisposable, configuration, unitTestMode = true) - - private fun getOrCreateApplicationEnvironment( - parentDisposable: Disposable, configuration: CompilerConfiguration, unitTestMode: Boolean - ): KotlinCoreApplicationEnvironment { - synchronized(APPLICATION_LOCK) { - if (ourApplicationEnvironment == null) { - val disposable = Disposer.newDisposable() - ourApplicationEnvironment = createApplicationEnvironment(disposable, configuration, unitTestMode) - ourProjectCount = 0 - Disposer.register(disposable, Disposable { - synchronized(APPLICATION_LOCK) { - ourApplicationEnvironment = null - } - }) - } - // Disposing of the environment is unsafe in production then parallel builds are enabled, but turning it off universally - // breaks a lot of tests, therefore it is disabled for production and enabled for tests - if (System.getProperty(KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY).toBooleanLenient() != true) { - // JPS may run many instances of the compiler in parallel (there's an option for compiling independent modules in parallel in IntelliJ) - // All projects share the same ApplicationEnvironment, and when the last project is disposed, the ApplicationEnvironment is disposed as well - Disposer.register(parentDisposable, Disposable { - synchronized(APPLICATION_LOCK) { - if (--ourProjectCount <= 0) { - disposeApplicationEnvironment() - } - } - }) - } - - return ourApplicationEnvironment!! - } - } - - private fun disposeApplicationEnvironment() { - synchronized(APPLICATION_LOCK) { - val environment = ourApplicationEnvironment ?: return - ourApplicationEnvironment = null - Disposer.dispose(environment.parentDisposable) - ZipHandler.clearFileAccessorCache() - } - } - - private fun createApplicationEnvironment( - parentDisposable: Disposable, configuration: CompilerConfiguration, unitTestMode: Boolean - ): KotlinCoreApplicationEnvironment { - val applicationEnvironment = KotlinCoreApplicationEnvironment.create(parentDisposable, unitTestMode) - - registerApplicationExtensionPointsAndExtensionsFrom(configuration, "extensions/compiler.xml") - registerApplicationExtensionPointsAndExtensionsFrom(configuration, "extensions/core.xml") - - registerApplicationServicesForCLI(applicationEnvironment) - registerApplicationServices(applicationEnvironment) - - return applicationEnvironment - } - - private fun registerApplicationExtensionPointsAndExtensionsFrom(configuration: CompilerConfiguration, configFilePath: String) { - fun File.hasConfigFile(configFile: String): Boolean = - if (isDirectory) File(this, "META-INF" + File.separator + configFile).exists() - else try { - ZipFile(this).use { - it.getEntry("META-INF/$configFile") != null - } - } catch (e: Throwable) { - false - } - - val pluginRoot: File = - configuration.get(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT)?.let(::File) - ?: PathUtil.getResourcePathForClass(this::class.java).takeIf { it.hasConfigFile(configFilePath) } - // hack for load extensions when compiler run directly from project directory (e.g. in tests) - ?: File("compiler/cli/cli-common/resources").takeIf { it.hasConfigFile(configFilePath) } - ?: throw IllegalStateException( - "Unable to find extension point configuration $configFilePath " + - "(cp:\n ${(Thread.currentThread().contextClassLoader as? UrlClassLoader)?.urls?.joinToString("\n ") { it.file }})" - ) - - CoreApplicationEnvironment.registerExtensionPointAndExtensions( - FileSystems.getDefault().getPath(pluginRoot.path), - configFilePath, - ApplicationManager.getApplication().extensionArea - ) - } - - @JvmStatic - @Suppress("MemberVisibilityCanPrivate") // made public for CLI Android Lint - fun registerPluginExtensionPoints(project: MockProject) { - ExpressionCodegenExtension.registerExtensionPoint(project) - SyntheticResolveExtension.registerExtensionPoint(project) - SyntheticJavaResolveExtension.registerExtensionPoint(project) - ClassBuilderInterceptorExtension.registerExtensionPoint(project) - AnalysisHandlerExtension.registerExtensionPoint(project) - PackageFragmentProviderExtension.registerExtensionPoint(project) - StorageComponentContainerContributor.registerExtensionPoint(project) - DeclarationAttributeAltererExtension.registerExtensionPoint(project) - PreprocessedVirtualFileFactoryExtension.registerExtensionPoint(project) - JsSyntheticTranslateExtension.registerExtensionPoint(project) - CompilerConfigurationExtension.registerExtensionPoint(project) - CollectAdditionalSourcesExtension.registerExtensionPoint(project) - ExtraImportsProviderExtension.registerExtensionPoint(project) - IrGenerationExtension.registerExtensionPoint(project) - ScriptEvaluationExtension.registerExtensionPoint(project) - ShellExtension.registerExtensionPoint(project) - TypeResolutionInterceptor.registerExtensionPoint(project) - CandidateInterceptor.registerExtensionPoint(project) - DescriptorSerializerPlugin.registerExtensionPoint(project) - } - - internal fun registerExtensionsFromPlugins(project: MockProject, configuration: CompilerConfiguration) { - val messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY) - for (registrar in configuration.getList(ComponentRegistrar.PLUGIN_COMPONENT_REGISTRARS)) { - try { - registrar.registerProjectComponents(project, configuration) - } catch (e: AbstractMethodError) { - val message = "The provided plugin ${registrar.javaClass.name} is not compatible with this version of compiler" - // Since the scripting plugin is often discovered in the compiler environment, it is often taken from the incompatible - // location, and in many cases this is not a fatal error, therefore strong warning is generated instead of exception - if (registrar.javaClass.simpleName == "ScriptingCompilerConfigurationComponentRegistrar") { - messageCollector?.report(STRONG_WARNING, "Default scripting plugin is disabled: $message") - } else { - throw IllegalStateException(message, e) - } - } - } - } - - - private fun registerApplicationServicesForCLI(applicationEnvironment: KotlinCoreApplicationEnvironment) { - // ability to get text from annotations xml files - applicationEnvironment.registerFileType(PlainTextFileType.INSTANCE, "xml") - applicationEnvironment.registerParserDefinition(JavaParserDefinition()) - } - - // made public for Upsource - @Suppress("MemberVisibilityCanBePrivate") - @JvmStatic - fun registerApplicationServices(applicationEnvironment: KotlinCoreApplicationEnvironment) { - with(applicationEnvironment) { - registerFileType(KotlinFileType.INSTANCE, "kt") - registerFileType(KotlinFileType.INSTANCE, KotlinParserDefinition.STD_SCRIPT_SUFFIX) - registerParserDefinition(KotlinParserDefinition()) - application.registerService(KotlinBinaryClassCache::class.java, KotlinBinaryClassCache()) - application.registerService(JavaClassSupers::class.java, JavaClassSupersImpl::class.java) - application.registerService(TransactionGuard::class.java, TransactionGuardImpl::class.java) - } - } - - @JvmStatic - fun registerProjectExtensionPoints(area: ExtensionsArea) { - CoreApplicationEnvironment.registerExtensionPoint( - area, PsiTreeChangePreprocessor.EP.name, PsiTreeChangePreprocessor::class.java - ) - CoreApplicationEnvironment.registerExtensionPoint(area, PsiElementFinder.EP.name, PsiElementFinder::class.java) - - IdeaExtensionPoints.registerVersionSpecificProjectExtensionPoints(area) - } - - // made public for Upsource - @JvmStatic - @Deprecated("Use registerProjectServices(project) instead.", ReplaceWith("registerProjectServices(projectEnvironment.project)")) - fun registerProjectServices( - projectEnvironment: JavaCoreProjectEnvironment, - @Suppress("UNUSED_PARAMETER") messageCollector: MessageCollector? - ) { - registerProjectServices(projectEnvironment.project) - } - - // made public for Android Lint - @JvmStatic - fun registerProjectServices(project: MockProject) { - with(project) { - registerService(KotlinJavaPsiFacade::class.java, KotlinJavaPsiFacade(this)) - registerService(FacadeCache::class.java, FacadeCache(this)) - registerService(ModuleAnnotationsResolver::class.java, CliModuleAnnotationsResolver()) - } - } - - private fun registerProjectServicesForCLI(@Suppress("UNUSED_PARAMETER") projectEnvironment: JavaCoreProjectEnvironment) { - /** - * Note that Kapt may restart code analysis process, and CLI services should be aware of that. - * Use PsiManager.getModificationTracker() to ensure that all the data you cached is still valid. - */ - } - - // made public for Android Lint - @JvmStatic - fun registerKotlinLightClassSupport(project: MockProject) { - with(project) { - val traceHolder = CliTraceHolder() - val cliLightClassGenerationSupport = CliLightClassGenerationSupport(traceHolder, project) - val kotlinAsJavaSupport = CliKotlinAsJavaSupport(this, traceHolder) - registerService(LightClassGenerationSupport::class.java, cliLightClassGenerationSupport) - registerService(CliLightClassGenerationSupport::class.java, cliLightClassGenerationSupport) - registerService(KotlinAsJavaSupport::class.java, kotlinAsJavaSupport) - registerService(CodeAnalyzerInitializer::class.java, traceHolder) - @Suppress("UnstableApiUsage") - registerService(DumbUtil::class.java, KotlinCoreDumbUtil()) - - // We don't pass Disposable because in some tests, we manually unregister these extensions, and that leads to LOG.error - // exception from `ExtensionPointImpl.doRegisterExtension`, because the registered extension can no longer be found - // when the project is being disposed. - // For example, see the `unregisterExtension` call in `GenerationUtils.compileFilesUsingFrontendIR`. - // TODO: refactor this to avoid registering unneeded extensions in the first place, and avoid using deprecated API. - @Suppress("DEPRECATION") - PsiElementFinder.EP.getPoint(project).registerExtension(JavaElementFinder(this)) - @Suppress("DEPRECATION") - PsiElementFinder.EP.getPoint(project).registerExtension(PsiElementFinderImpl(this)) - } - } - - private fun CompilerConfiguration.setupJdkClasspathRoots(configFiles: EnvironmentConfigFiles) { - if (getBoolean(JVMConfigurationKeys.NO_JDK)) return - - val jvmTarget = configFiles == EnvironmentConfigFiles.JVM_CONFIG_FILES - if (!jvmTarget) return - - val jdkHome = get(JVMConfigurationKeys.JDK_HOME) - val (javaRoot, classesRoots) = if (jdkHome == null) { - val javaHome = File(System.getProperty("java.home")) - put(JVMConfigurationKeys.JDK_HOME, javaHome) - - javaHome to PathUtil.getJdkClassesRootsFromCurrentJre() - } else { - jdkHome to PathUtil.getJdkClassesRoots(jdkHome) - } - - if (!CoreJrtFileSystem.isModularJdk(javaRoot)) { - if (classesRoots.isEmpty()) { - report(ERROR, "No class roots are found in the JDK path: $javaRoot") - } else { - addJvmSdkRoots(classesRoots) - } - } - } - } -} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/JUnit3RunnerWithInnersForJPS.java.as42 b/compiler/tests-common/tests/org/jetbrains/kotlin/test/JUnit3RunnerWithInnersForJPS.java.as42 deleted file mode 100644 index dff5a8871a8..00000000000 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/JUnit3RunnerWithInnersForJPS.java.as42 +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.test; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; -import org.junit.internal.MethodSorter; -import org.junit.internal.runners.JUnit38ClassRunner; -import org.junit.runner.Description; -import org.junit.runner.Runner; -import org.junit.runner.manipulation.*; -import org.junit.runner.notification.RunNotifier; - -import java.io.IOException; -import java.lang.reflect.Method; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; - -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; -import static org.jetbrains.kotlin.test.JUnit3RunnerWithInners.isTestMethod; - -/** - * This runner runs class with all inners test classes, but monitors situation when those classes are planned to be executed - * with IDEA package test runner. - */ -public class JUnit3RunnerWithInnersForJPS extends Runner implements Filterable, Sortable { - private static final Set requestedRunners = new HashSet<>(); - - private JUnit38ClassRunner delegateRunner; - private final Class klass; - private boolean isFakeTest = false; - - public JUnit3RunnerWithInnersForJPS(Class klass) { - this.klass = klass; - requestedRunners.add(klass); - ensureCompilerExtensionFilesExists(); - } - - @Override - public void run(RunNotifier notifier) { - initialize(); - delegateRunner.run(notifier); - } - - @Override - public Description getDescription() { - initialize(); - return isFakeTest ? Description.EMPTY : delegateRunner.getDescription(); - } - - @Override - public void filter(Filter filter) throws NoTestsRemainException { - initialize(); - delegateRunner.filter(filter); - } - - @Override - public void sort(Sorter sorter) { - initialize(); - delegateRunner.sort(sorter); - } - - protected void initialize() { - if (delegateRunner != null) return; - delegateRunner = new JUnit38ClassRunner(getCollectedTests()); - } - - /** - * compiler.xml needs to be in both compiler & ide module for tests execution. - * To avoid file duplication copy it to the out dir idea module before test execution. - */ - private static void ensureCompilerExtensionFilesExists() { - copyCompilerResourceFile("compiler.xml"); - copyCompilerResourceFile("core.xml"); - } - - private static void copyCompilerResourceFile(String fileName) { - String compilerXmlSourcePath = "compiler/cli/cli-common/resources/META-INF/extensions/" + fileName; - - String jpsTargetDirectory = "out/production/kotlin.idea.main"; - String pillTargetDirectory = "out/production/idea.main"; - - String baseDir = Files.exists(Paths.get(jpsTargetDirectory)) ? jpsTargetDirectory : pillTargetDirectory; - String compilerXmlTargetPath = baseDir + "/META-INF/extensions/" + fileName; - - try { - Path targetPath = Paths.get(compilerXmlTargetPath); - Files.createDirectories(targetPath.getParent()); - Files.copy(Paths.get(compilerXmlSourcePath),targetPath, REPLACE_EXISTING); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - - private Test getCollectedTests() { - List innerClasses = collectDeclaredClasses(klass, false); - Set unprocessedInnerClasses = unprocessedClasses(innerClasses); - - if (unprocessedInnerClasses.isEmpty()) { - if (!innerClasses.isEmpty() && !hasTestMethods(klass)) { - isFakeTest = true; - return new JUnit3RunnerWithInners.FakeEmptyClassTest(klass); - } - else { - return new TestSuite(klass.asSubclass(TestCase.class)); - } - } - else if (unprocessedInnerClasses.size() == innerClasses.size()) { - return createTreeTestSuite(klass); - } - else { - return new TestSuite(klass.asSubclass(TestCase.class)); - } - } - - private static Test createTreeTestSuite(Class root) { - Set classes = new LinkedHashSet<>(collectDeclaredClasses(root, true)); - Map classSuites = new HashMap<>(); - - for (Class aClass : classes) { - classSuites.put(aClass, hasTestMethods(aClass) ? new TestSuite(aClass) : new TestSuite(aClass.getCanonicalName())); - } - - for (Class aClass : classes) { - if (aClass.getEnclosingClass() != null && classes.contains(aClass.getEnclosingClass())) { - classSuites.get(aClass.getEnclosingClass()).addTest(classSuites.get(aClass)); - } - } - - return classSuites.get(root); - } - - private static Set unprocessedClasses(Collection classes) { - Set result = new LinkedHashSet<>(); - for (Class aClass : classes) { - if (!requestedRunners.contains(aClass)) { - result.add(aClass); - } - } - - return result; - } - - private static List collectDeclaredClasses(Class klass, boolean withItself) { - List result = new ArrayList<>(); - if (withItself) { - result.add(klass); - } - - for (Class aClass : klass.getDeclaredClasses()) { - result.addAll(collectDeclaredClasses(aClass, true)); - } - - return result; - } - - private static boolean hasTestMethods(Class klass) { - for (Class currentClass = klass; Test.class.isAssignableFrom(currentClass); currentClass = currentClass.getSuperclass()) { - for (Method each : MethodSorter.getDeclaredMethods(currentClass)) { - if (isTestMethod(each)) return true; - } - } - - return false; - } -} \ No newline at end of file diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as42 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as42 deleted file mode 100644 index f7df952dd15..00000000000 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as42 +++ /dev/null @@ -1,1224 +0,0 @@ -/* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.generators.tests - -import org.jetbrains.kotlin.AbstractDataFlowValueRenderingTest -import org.jetbrains.kotlin.addImport.AbstractAddImportTest -import org.jetbrains.kotlin.allopen.AbstractBytecodeListingTestForAllOpen -import org.jetbrains.kotlin.allopen.AbstractIrBytecodeListingTestForAllOpen -import org.jetbrains.kotlin.android.parcel.AbstractParcelBytecodeListingTest -import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidBoxTest -import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidBytecodeShapeTest -import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidSyntheticPropertyDescriptorTest -import org.jetbrains.kotlin.checkers.* -import org.jetbrains.kotlin.copyright.AbstractUpdateKotlinCopyrightTest -import org.jetbrains.kotlin.findUsages.AbstractFindUsagesTest -import org.jetbrains.kotlin.findUsages.AbstractKotlinFindUsagesWithLibraryTest -import org.jetbrains.kotlin.formatter.AbstractFormatterTest -import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase -import org.jetbrains.kotlin.generators.TestGroup -import org.jetbrains.kotlin.generators.impl.generateTestGroupSuite -import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_OR_KTS -import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_OR_KTS_WITHOUT_DOTS_IN_NAME -import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME -import org.jetbrains.kotlin.idea.AbstractExpressionSelectionTest -import org.jetbrains.kotlin.idea.index.AbstractKotlinTypeAliasByExpansionShortNameIndexTest -import org.jetbrains.kotlin.idea.AbstractSmartSelectionTest -import org.jetbrains.kotlin.idea.actions.AbstractGotoTestOrCodeActionTest -import org.jetbrains.kotlin.idea.caches.resolve.* -import org.jetbrains.kotlin.idea.codeInsight.* -import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractCodeInsightActionTest -import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateHashCodeAndEqualsActionTest -import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateTestSupportMethodActionTest -import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateToStringActionTest -import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveLeftRightTest -import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveStatementTest -import org.jetbrains.kotlin.idea.codeInsight.postfix.AbstractPostfixTemplateProviderTest -import org.jetbrains.kotlin.idea.codeInsight.surroundWith.AbstractSurroundWithTest -import org.jetbrains.kotlin.idea.codeInsight.unwrap.AbstractUnwrapRemoveTest -import org.jetbrains.kotlin.idea.completion.test.* -import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractBasicCompletionHandlerTest -import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractCompletionCharFilterTest -import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractKeywordCompletionHandlerTest -import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractSmartCompletionHandlerTest -import org.jetbrains.kotlin.idea.completion.test.weighers.AbstractBasicCompletionWeigherTest -import org.jetbrains.kotlin.idea.completion.test.weighers.AbstractSmartCompletionWeigherTest -import org.jetbrains.kotlin.idea.configuration.AbstractGradleConfigureProjectByChangingFileTest -import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCopyPasteTest -import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest -import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest -import org.jetbrains.kotlin.idea.debugger.evaluate.* -import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase -import org.jetbrains.kotlin.idea.debugger.test.* -import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest -import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest -import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest -import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS -import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateJavaToLibrarySourceTest -import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractClsStubBuilderTest -import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractLoadJavaClsStubTest -import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextFromJsMetadataTest -import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextTest -import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractJsDecompiledTextFromJsMetadataTest -import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractJvmDecompiledTextTest -import org.jetbrains.kotlin.idea.editor.AbstractMultiLineStringIndentTest -import org.jetbrains.kotlin.idea.editor.backspaceHandler.AbstractBackspaceHandlerTest -import org.jetbrains.kotlin.idea.editor.quickDoc.AbstractQuickDocProviderTest -import org.jetbrains.kotlin.idea.filters.AbstractKotlinExceptionFilterTest -import org.jetbrains.kotlin.idea.folding.AbstractKotlinFoldingTest -import org.jetbrains.kotlin.idea.hierarchy.AbstractHierarchyTest -import org.jetbrains.kotlin.idea.hierarchy.AbstractHierarchyWithLibTest -import org.jetbrains.kotlin.idea.highlighter.* -import org.jetbrains.kotlin.idea.imports.AbstractJsOptimizeImportsTest -import org.jetbrains.kotlin.idea.imports.AbstractJvmOptimizeImportsTest -import org.jetbrains.kotlin.idea.inspections.AbstractLocalInspectionTest -import org.jetbrains.kotlin.idea.inspections.AbstractMultiFileLocalInspectionTest -import org.jetbrains.kotlin.idea.intentions.AbstractConcatenatedStringGeneratorTest -import org.jetbrains.kotlin.idea.intentions.AbstractIntentionTest -import org.jetbrains.kotlin.idea.intentions.AbstractIntentionTest2 -import org.jetbrains.kotlin.idea.intentions.AbstractMultiFileIntentionTest -import org.jetbrains.kotlin.idea.intentions.declarations.AbstractJoinLinesTest -import org.jetbrains.kotlin.idea.internal.AbstractBytecodeToolWindowTest -import org.jetbrains.kotlin.idea.kdoc.AbstractKDocHighlightingTest -import org.jetbrains.kotlin.idea.kdoc.AbstractKDocTypingTest -import org.jetbrains.kotlin.idea.navigation.* -import org.jetbrains.kotlin.idea.parameterInfo.AbstractParameterInfoTest -import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixMultiFileTest -import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixMultiModuleTest -import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest -import org.jetbrains.kotlin.idea.refactoring.AbstractNameSuggestionProviderTest -import org.jetbrains.kotlin.idea.refactoring.copy.AbstractCopyTest -import org.jetbrains.kotlin.idea.refactoring.copy.AbstractMultiModuleCopyTest -import org.jetbrains.kotlin.idea.refactoring.inline.AbstractInlineTest -import org.jetbrains.kotlin.idea.refactoring.introduce.AbstractExtractionTest -import org.jetbrains.kotlin.idea.refactoring.move.AbstractMoveTest -import org.jetbrains.kotlin.idea.refactoring.move.AbstractMultiModuleMoveTest -import org.jetbrains.kotlin.idea.refactoring.pullUp.AbstractPullUpTest -import org.jetbrains.kotlin.idea.refactoring.pushDown.AbstractPushDownTest -import org.jetbrains.kotlin.idea.refactoring.rename.AbstractMultiModuleRenameTest -import org.jetbrains.kotlin.idea.refactoring.rename.AbstractRenameTest -import org.jetbrains.kotlin.idea.refactoring.safeDelete.AbstractMultiModuleSafeDeleteTest -import org.jetbrains.kotlin.idea.refactoring.safeDelete.AbstractSafeDeleteTest -import org.jetbrains.kotlin.idea.repl.AbstractIdeReplCompletionTest -import org.jetbrains.kotlin.idea.resolve.* -import org.jetbrains.kotlin.idea.scratch.AbstractScratchLineMarkersTest -import org.jetbrains.kotlin.idea.scratch.AbstractScratchRunActionTest -import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationCompletionTest -import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationHighlightingTest -import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationNavigationTest -import org.jetbrains.kotlin.idea.script.AbstractScriptDefinitionsOrderTest -import org.jetbrains.kotlin.idea.slicer.AbstractSlicerLeafGroupingTest -import org.jetbrains.kotlin.idea.slicer.AbstractSlicerNullnessGroupingTest -import org.jetbrains.kotlin.idea.slicer.AbstractSlicerTreeTest -import org.jetbrains.kotlin.idea.slicer.AbstractSlicerMultiplatformTest -import org.jetbrains.kotlin.idea.structureView.AbstractKotlinFileStructureTest -import org.jetbrains.kotlin.idea.stubs.AbstractMultiFileHighlightingTest -import org.jetbrains.kotlin.idea.stubs.AbstractResolveByStubTest -import org.jetbrains.kotlin.idea.stubs.AbstractStubBuilderTest -import org.jetbrains.kotlin.incremental.* -//import org.jetbrains.kotlin.jps.build.* -//import org.jetbrains.kotlin.jps.incremental.AbstractJsProtoComparisonTest -//import org.jetbrains.kotlin.jps.incremental.AbstractJvmProtoComparisonTest -import org.jetbrains.kotlin.kapt.cli.test.AbstractArgumentParsingTest -import org.jetbrains.kotlin.kapt.cli.test.AbstractKaptToolIntegrationTest -import org.jetbrains.kotlin.kapt3.test.AbstractClassFileToSourceStubConverterTest -import org.jetbrains.kotlin.kapt3.test.AbstractKotlinKaptContextTest -import org.jetbrains.kotlin.lombok.AbstractLombokCompileTest -import org.jetbrains.kotlin.nj2k.AbstractNewJavaToKotlinConverterMultiFileTest -import org.jetbrains.kotlin.nj2k.AbstractNewJavaToKotlinConverterSingleFileTest -import org.jetbrains.kotlin.nj2k.AbstractNewJavaToKotlinCopyPasteConversionTest -import org.jetbrains.kotlin.nj2k.AbstractTextNewJavaToKotlinCopyPasteConversionTest -import org.jetbrains.kotlin.nj2k.inference.common.AbstractCommonConstraintCollectorTest -import org.jetbrains.kotlin.nj2k.inference.mutability.AbstractMutabilityInferenceTest -import org.jetbrains.kotlin.nj2k.inference.nullability.AbstractNullabilityInferenceTest -import org.jetbrains.kotlin.noarg.* -import org.jetbrains.kotlin.psi.patternMatching.AbstractPsiUnifierTest -import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverScriptTest -import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverTest -import org.jetbrains.kotlin.search.AbstractAnnotatedMembersSearchTest -import org.jetbrains.kotlin.search.AbstractInheritorsSearchTest -import org.jetbrains.kotlin.shortenRefs.AbstractShortenRefsTest -import org.jetbrains.kotlin.test.TargetBackend -import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginBytecodeListingTest -import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginDiagnosticTest -import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListingTest -import org.jetbrains.kotlinx.serialization.idea.AbstractSerializationPluginIdeDiagnosticTest -import org.jetbrains.kotlinx.serialization.idea.AbstractSerializationQuickFixTest - -fun main(args: Array) { - System.setProperty("java.awt.headless", "true") - - testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { - testClass { - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepInto" - ) - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doSmartStepIntoTest", - testClassName = "SmartStepInto" - ) - model( - "stepping/stepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepIntoOnly" - ) - model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("selectExpression", recursive = false) - model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - - testClass { - model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - - testClass { - model("smartStepInto") - } - - testClass { - model("breakpointApplicability") - } - - testClass { - model("fileRanking") - } - - testClass { - model("asyncStackTrace") - } - - testClass { - // TODO: implement mapping logic for terminal operations - model("sequence/streams/sequence", excludeDirs = listOf("terminal")) - } - } - - testGroup("idea/tests", "idea/testData") { - testClass { - model("resolve/additionalLazyResolve") - } - - testClass { - model("resolve/partialBodyResolve") - } - - testClass { - model("checker", recursive = false) - model("checker/regression") - model("checker/recovery") - model("checker/rendering") - model("checker/scripts", extension = "kts") - model("checker/duplicateJvmSignature") - model("checker/infos", testMethod = "doTestWithInfos") - model("checker/diagnosticsMessage") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - model("kotlinAndJavaChecker/javaWithKotlin") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - } - - testClass { - model("unifier") - } - - testClass { - model("checker/codeFragments", extension = "kt", recursive = false) - model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") - } - - testClass { - model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) - } - - testClass { - model("checker/js") - } - - testClass { - model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) - } - - testClass { - model("navigation/gotoSuper", extension = "test", recursive = false) - } - - testClass { - model("navigation/gotoTypeDeclaration", extension = "test") - } - - testClass { - model("navigation/gotoDeclaration", extension = "test") - } - - testClass { - model( - "parameterInfo", - pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, - excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") - ) - } - - testClass { - model("navigation/gotoClass", testMethod = "doClassTest") - model("navigation/gotoSymbol", testMethod = "doSymbolTest") - } - - testClass() { - model("decompiler/navigation/usercode") - } - - testClass() { - model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") - } - - testClass() { - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") - } - - testClass { - model("decompiler/navigation/usercode") - } - - testClass { - model("navigation/implementations", recursive = false) - } - - testClass { - model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") - } - - testClass { - model("search/inheritance") - } - - testClass { - model("search/annotations") - } - - testClass { - model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("typealiasExpansionIndex") - } - - testClass { - model("highlighter") - } - - testClass { - model("dslHighlighter") - } - - testClass { - model("usageHighlighter") - } - - testClass { - model("folding/noCollapse") - model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") - } - - testClass { - model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") - model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") - model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") - model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") - model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") - model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") - model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") - model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") - model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") - model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") - model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") - model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") - model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") - model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") - model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") - model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") - } - - testClass { - model("joinLines") - } - - testClass { - model("codeInsight/breadcrumbs") - } - - testClass { - model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) - } - - testClass { - model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") - model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") - model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") - model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") - model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") - model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") - model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") - } - - testClass { - model("hierarchy/withLib", extension = null, recursive = false) - } - - testClass { - model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") - model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") - model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") - } - - testClass { - model("codeInsight/moveLeftRight") - } - - testClass { - model("refactoring/inline", pattern = "^(\\w+)\\.kt$") - } - - testClass { - model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") - model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") - model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") - model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") - model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") - model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") - model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") - model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") - } - - testClass { - model("codeInsight/expressionType") - } - - testClass { - model("editor/backspaceHandler") - } - - testClass { - model("editor/enterHandler/multilineString") - } - - testClass { - model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") - } - - testClass { - model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") - model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") - model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") - model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") - model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") - model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") - model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") - model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") - model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") - } - - testClass { - model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - model("resolve/referenceInJava/sourceOnly", extension = "java") - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - } - - testClass { - model("resolve/referenceWithLib", recursive = false) - } - - testClass { - model("resolve/referenceInLib", recursive = false) - } - - testClass { - model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) - } - - testClass { - model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") - model("findUsages/java", pattern = """^(.+)\.0\.java$""") - model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") - } - - testClass { - model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") - } - - testClass { - model("refactoring/move", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copy", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/moveMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copyMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileInspections", extension = "test", singleClass = true) - } - - testClass { - model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", - testMethod = "doTestCallSite", testClassName = "FormatterCallSite" - ) - model( - "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", - testMethod = "doTestInverted", testClassName = "FormatterInverted" - ) - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", - testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" - ) - } - - testClass { - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", - testClassName = "DirectSettings") - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", - testClassName = "InvertedSettings") - } - - testClass { - model("diagnosticMessage", recursive = false) - } - - testClass { - model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) - } - - testClass { - model("refactoring/rename", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/renameMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("codeInsight/outOfBlock", pattern = KT_OR_KTS) - } - - testClass { - model("dataFlowValueRendering") - } - - testClass { - model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") - } - - testClass { - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) - } - - testClass { - model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") - } - - testClass { - model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") - } - - testClass { - model("exitPoints") - } - - testClass { - model("codeInsight/lineMarker") - } - - testClass { - model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") - } - - testClass { - model("multiModuleLineMarker", extension = null, recursive = false) - } - - testClass { - model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""") - } - - testClass { - model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") - } - - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } - - testClass { - model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } - - testClass { - model("decompiler/stubBuilder", extension = null, recursive = false) - } - - testClass { - model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) - } - - testClass { - model("stubs", extension = "kt") - } - - testClass { - model("multiFileHighlighting", recursive = false) - } - - testClass { - model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) - } - - testClass { - model("multiModuleHighlighting/hierarchicalExpectActualMatching/", recursive = false, extension = null) - } - - testClass { - model("multiModuleQuickFix", extension = null, deep = 1) - } - - testClass { - model("navigation/implementations/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/gotoSuper/multiModule", recursive = false, extension = null) - } - - testClass { - model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") - model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") - model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") - model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") - model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") - model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") - model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") - model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") - model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") - model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") - } - - testClass { - model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("coverage/outputFiles") - } - - testClass { - model("internal/toolWindow", recursive = false, extension = null) - } - - testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { - model("kdoc/resolve") - } - - testClass { - model("kdoc/highlighting") - } - - testClass { - model("kdoc/typing") - } - - testClass { - model("codeInsight/generate/testFrameworkSupport") - } - - testClass { - model("codeInsight/generate/equalsWithHashCode") - } - - testClass { - model("codeInsight/generate/secondaryConstructors") - } - - testClass { - model("codeInsight/generate/toString") - } - - testClass { - model("repl/completion") - } - - testClass { - model("codeInsight/postfix") - } - - testClass { - model("script/definition/highlighting", extension = null, recursive = false) - model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") - } - - testClass { - model("script/definition/navigation", extension = null, recursive = false) - } - - testClass { - model("script/definition/completion", extension = null, recursive = false) - } - - testClass { - model("script/definition/order", extension = null, recursive = false) - } - - testClass { - model("refactoring/nameSuggestionProvider") - } - - testClass { - model("slicer", excludeDirs = listOf("mpp")) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/mpp", recursive = false, extension = null) - } - } - - testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { - testClass { - model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) - model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) - model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) - - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) - model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) - - model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) - } - - testClass { - model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) - } - } - - /* - // Maven and Gradle are not relevant for AS branch - - testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { - testClass { - model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") - model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") - } - - testClass { - model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) - } - } - - testGroup("idea/idea-gradle/tests", "idea/testData") { - testClass { - model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") - model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") - } - } - - */ - - testGroup("idea/tests", "compiler/testData") { - testClass { - model("loadJava/compiledKotlin") - } - - testClass { - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") - } - - testClass { - model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) - } - } - - testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava/stdlib", extension = "java", recursive = false) - } - - testClass { - model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("basic/common") - model("basic/js") - } - - testClass { - model("basic/common") - model("basic/java") - } - - testClass { - model("smart") - } - - testClass { - model("keywords", recursive = false) - } - - testClass { - model("basic/withLib", recursive = false) - } - - testClass { - model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("handlers/smart") - } - - testClass { - model("handlers/keywords") - } - - testClass { - model("handlers/charFilter") - } - - testClass { - model("basic/multifile", extension = null, recursive = false) - } - - testClass { - model("smartMultiFile", extension = null, recursive = false) - } - - testClass("KDocCompletionTestGenerated") { - model("kdoc") - } - - testClass { - model("basic/java8") - } - - testClass { - model("incrementalResolve") - } - - testClass { - model("multiPlatform", recursive = false, extension = null) - } - } - - //TODO: move these tests into idea-completion module - testGroup("idea/tests", "idea/idea-completion/testData") { - testClass { - model("handlers/runtimeCast") - } - - testClass { - model("basic/codeFragments", extension = "kt") - } - } - - - - - testGroup("nj2k/tests", "nj2k/testData") { - testClass { - model("newJ2k", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("inference/common") - } - testClass { - model("inference/nullability") - } - testClass { - model("inference/mutability") - } - testClass { - model("copyPaste", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") - } - testClass { - model("multiFile", extension = null, recursive = false) - } - } - -/* There is no jps in AS - .... -*/ - testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) - model("incremental/withJava", extension = null, excludeParentDirs = true) - model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) - } - - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - } - - testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { - testClass { - model("descriptors", recursive = false, extension = null) - } - - testClass { - model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") - model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") - } - - testClass { - model("codegen/bytecodeShape", recursive = false, extension = null) - } - - testClass { - model("parcel/codegen") - } - } - - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { - testClass { - model("converter") - } - - testClass { - model("kotlinRunner") - } - } - - testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { - testClass { - model("argumentParsing", extension = "txt") - } - - testClass { - model("integration", recursive = false, extension = null) - } - } - - testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - testClass { - model("bytecodeListing", extension = "kt") - } - } - - testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { - testClass { model("diagnostics", extension = "kt") } - - testClass { - model("bytecodeListing", extension = "kt", targetBackend = TargetBackend.JVM) - } - testClass { - model("bytecodeListing", extension = "kt", targetBackend = TargetBackend.JVM_IR) - } - - testClass { model("box", targetBackend = TargetBackend.JVM) } - testClass { model("box", targetBackend = TargetBackend.JVM_IR) } - } - - testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { - testClass { - model("diagnostics") - } - testClass { - model("script", extension = "kts") - } - } - - testGroup( - "plugins/kotlin-serialization/kotlin-serialization-compiler/test", - "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" - ) { - testClass { - model("diagnostics") - } - - testClass { - model("codegen") - } - - testClass { - model("codegen") - } - } - - testGroup( - "plugins/kotlin-serialization/kotlin-serialization-ide/test", - "plugins/kotlin-serialization/kotlin-serialization-ide/testData" - ) { - testClass { - model("diagnostics") - } - testClass { - model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) - } - } - - testGroup("plugins/lombok/lombok-compiler-plugin/tests", "plugins/lombok/lombok-compiler-plugin/testData") { - testClass { - model("compile") - } - } -/* - testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { - testClass { - model("android/completion", recursive = false, extension = null) - } - - testClass { - model("android/goto", recursive = false, extension = null) - } - - testClass { - model("android/rename", recursive = false, extension = null) - } - - testClass { - model("android/renameLayout", recursive = false, extension = null) - } - - testClass { - model("android/findUsages", recursive = false, extension = null) - } - - testClass { - model("android/usageHighlighting", recursive = false, extension = null) - } - - testClass { - model("android/extraction", recursive = false, extension = null) - } - - testClass { - model("android/parcel/checker", excludeParentDirs = true) - } - - testClass { - model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - } - - testGroup("idea/idea-android/tests", "idea/testData") { - testClass { - model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") - model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") - } - - testClass { - model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/resourceIntention", extension = "test", singleClass = true) - } - - testClass { - model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("android/lint", excludeParentDirs = true) - } - - testClass { - model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/folding") - } - - testClass { - model("android/gutterIcon") - } - } -*/ -} diff --git a/gradle/versions.properties.as42 b/gradle/versions.properties.as42 deleted file mode 100644 index 73717de3b18..00000000000 --- a/gradle/versions.properties.as42 +++ /dev/null @@ -1,23 +0,0 @@ -versions.intellijSdk=202.6397.94 -versions.idea.NodeJS=193.6494.7 -versions.androidStudioRelease=4.2.0.16 -versions.androidStudioBuild=202.6939830 -versions.jar.asm-all=8.0.1 -versions.jar.guava=29.0-jre -versions.jar.groovy=2.5.11 -versions.jar.lombok-ast=0.2.3 -versions.jar.swingx-core=1.6.2-2 -versions.jar.kxml2=2.3.0 -versions.jar.streamex=0.7.2 -versions.jar.gson=2.8.6 -versions.jar.oro=2.0.8 -versions.jar.picocontainer=1.2 -versions.jar.serviceMessages=2019.1.4 -versions.jar.lz4-java=1.7.1 -ignore.jar.snappy-in-java=true -versions.gradle-api=4.5.1 -versions.shadow=6.1.0 -ignore.jar.common=true -ignore.jar.lombok-ast=true -versions.junit-bom=5.7.0 -versions.org.junit.platform=1.7.0