[FIR-PLUGIN] Move fir plugin prototype out from :compiler module

This commit is contained in:
Dmitriy Novozhilov
2020-05-08 11:22:19 +03:00
parent ab7613f6a4
commit 959ecceaf7
24 changed files with 46 additions and 48 deletions
+1 -2
View File
@@ -273,8 +273,7 @@ extra["compilerModules"] = arrayOf(
":compiler:fir:java", ":compiler:fir:java",
":compiler:fir:jvm", ":compiler:fir:jvm",
":compiler:fir:checkers", ":compiler:fir:checkers",
":compiler:fir:analysis-tests", ":compiler:fir:analysis-tests"
":compiler:fir:plugins:allopen-plugin"
) )
val coreLibProjects = listOfNotNull( val coreLibProjects = listOfNotNull(
-1
View File
@@ -46,7 +46,6 @@ dependencies {
testCompile(projectTests(":compiler:fir:raw-fir:light-tree2fir")) testCompile(projectTests(":compiler:fir:raw-fir:light-tree2fir"))
testCompile(projectTests(":compiler:fir:fir2ir")) testCompile(projectTests(":compiler:fir:fir2ir"))
testCompile(projectTests(":compiler:fir:analysis-tests")) testCompile(projectTests(":compiler:fir:analysis-tests"))
testCompile(projectTests(":compiler:fir:plugins:allopen-plugin"))
testCompile(projectTests(":compiler:visualizer")) testCompile(projectTests(":compiler:visualizer"))
testCompile(projectTests(":generators:test-generator")) testCompile(projectTests(":generators:test-generator"))
testCompile(project(":compiler:ir.ir2cfg")) testCompile(project(":compiler:ir.ir2cfg"))
@@ -1,7 +0,0 @@
import org.jetbrains.kotlin.fir.allopen.WithClass
import org.jetbrains.kotlin.fir.allopen.AllOpen
@WithClass
class A {
}
@@ -22,7 +22,6 @@ import org.jetbrains.kotlin.codegen.defaultConstructor.AbstractDefaultArgumentsR
import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest
import org.jetbrains.kotlin.codegen.ir.* import org.jetbrains.kotlin.codegen.ir.*
import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.*
import org.jetbrains.kotlin.fir.allopen.AbstractFirAllOpenDiagnosticTest
import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderTestCase import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderTestCase
import org.jetbrains.kotlin.fir.lightTree.AbstractLightTree2FirConverterTestCase import org.jetbrains.kotlin.fir.lightTree.AbstractLightTree2FirConverterTestCase
import org.jetbrains.kotlin.fir.java.AbstractFirOldFrontendLightClassesTest import org.jetbrains.kotlin.fir.java.AbstractFirOldFrontendLightClassesTest
@@ -629,10 +628,4 @@ fun main(args: Array<String>) {
model("uncommonCases/testFiles", testMethod = "doUncommonCasesTest") model("uncommonCases/testFiles", testMethod = "doUncommonCasesTest")
} }
} }
testGroup("compiler/fir/plugins/allopen-plugin/tests", "compiler/fir/plugins/allopen-plugin/testData") {
testClass<AbstractFirAllOpenDiagnosticTest> {
model("")
}
}
} }
+1
View File
@@ -57,6 +57,7 @@ dependencies {
testCompile(projectTests(":kotlin-noarg-compiler-plugin")) testCompile(projectTests(":kotlin-noarg-compiler-plugin"))
testCompile(projectTests(":kotlin-sam-with-receiver-compiler-plugin")) testCompile(projectTests(":kotlin-sam-with-receiver-compiler-plugin"))
testCompile(projectTests(":kotlinx-serialization-compiler-plugin")) testCompile(projectTests(":kotlinx-serialization-compiler-plugin"))
testCompile(projectTests(":plugins:fir:fir-plugin-prototype"))
testCompile(projectTests(":idea:jvm-debugger:jvm-debugger-test")) testCompile(projectTests(":idea:jvm-debugger:jvm-debugger-test"))
testCompile(projectTests(":generators:test-generator")) testCompile(projectTests(":generators:test-generator"))
testCompile(projectTests(":idea")) testCompile(projectTests(":idea"))
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.copyright.AbstractUpdateKotlinCopyrightTest
import org.jetbrains.kotlin.findUsages.AbstractFindUsagesTest import org.jetbrains.kotlin.findUsages.AbstractFindUsagesTest
import org.jetbrains.kotlin.findUsages.AbstractFindUsagesWithDisableComponentSearchTest import org.jetbrains.kotlin.findUsages.AbstractFindUsagesWithDisableComponentSearchTest
import org.jetbrains.kotlin.findUsages.AbstractKotlinFindUsagesWithLibraryTest import org.jetbrains.kotlin.findUsages.AbstractKotlinFindUsagesWithLibraryTest
import org.jetbrains.kotlin.fir.plugin.AbstractFirAllOpenDiagnosticTest
import org.jetbrains.kotlin.formatter.AbstractFormatterTest import org.jetbrains.kotlin.formatter.AbstractFormatterTest
import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase
import org.jetbrains.kotlin.generators.tests.generator.TestGroup import org.jetbrains.kotlin.generators.tests.generator.TestGroup
@@ -1446,6 +1447,12 @@ fun main(args: Array<String>) {
} }
} }
testGroup("plugins/fir/fir-plugin-prototype/tests", "plugins/fir/fir-plugin-prototype/testData") {
testClass<AbstractFirAllOpenDiagnosticTest> {
model("")
}
}
testGroup("idea/performanceTests/test", "idea/testData") { testGroup("idea/performanceTests/test", "idea/testData") {
testClass<AbstractPerformanceJavaToKotlinCopyPasteConversionTest> { testClass<AbstractPerformanceJavaToKotlinCopyPasteConversionTest> {
model("copyPaste/conversion", testMethod = "doPerfTest", pattern = """^([^\.]+)\.java$""") model("copyPaste/conversion", testMethod = "doPerfTest", pattern = """^([^\.]+)\.java$""")
@@ -41,7 +41,7 @@ projectTest(parallel = true) {
workingDir = rootDir workingDir = rootDir
jvmArgs!!.removeIf { it.contains("-Xmx") } jvmArgs!!.removeIf { it.contains("-Xmx") }
maxHeapSize = "3g" maxHeapSize = "3g"
dependsOn(":compiler:fir:plugins:allopen-plugin:allopen-annotations:jar") dependsOn(":plugins:fir:fir-plugin-prototype:plugin-annotations:jar")
} }
testsJar() testsJar()
@@ -3,6 +3,6 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen package org.jetbrains.kotlin.fir.plugin
annotation class AllOpen annotation class AllOpen
@@ -3,6 +3,6 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen package org.jetbrains.kotlin.fir.plugin
annotation class WithClass annotation class WithClass
@@ -3,4 +3,4 @@
# Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. # Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
# #
org.jetbrains.kotlin.fir.allopen.FirAllOpenComponentRegistrar org.jetbrains.kotlin.fir.plugin.FirAllOpenComponentRegistrar
@@ -3,13 +3,12 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen package org.jetbrains.kotlin.fir.plugin
import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.fir.FirAnnotationContainer import org.jetbrains.kotlin.fir.FirAnnotationContainer
import org.jetbrains.kotlin.fir.FirEffectiveVisibility
import org.jetbrains.kotlin.fir.FirEffectiveVisibilityImpl import org.jetbrains.kotlin.fir.FirEffectiveVisibilityImpl
import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.*
@@ -43,7 +42,7 @@ class AllOpenClassGenerator(session: FirSession) : FirClassGenerationExtension(s
return listOf(GeneratedClass(klass, containingFile)) return listOf(GeneratedClass(klass, containingFile))
} }
override val directlyApplicableAnnotations: Set<AnnotationFqn> = setOf(FqName("org.jetbrains.kotlin.fir.allopen.WithClass")) override val directlyApplicableAnnotations: Set<AnnotationFqn> = setOf(FqName("org.jetbrains.kotlin.fir.plugin.WithClass"))
override val childrenApplicableAnnotations: Set<AnnotationFqn> override val childrenApplicableAnnotations: Set<AnnotationFqn>
get() = emptySet() get() = emptySet()
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen package org.jetbrains.kotlin.fir.plugin
import org.jetbrains.kotlin.fir.declarations.FirPluginKey import org.jetbrains.kotlin.fir.declarations.FirPluginKey
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen package org.jetbrains.kotlin.fir.plugin
import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.FirSession
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.name.FqName
class AllOpenStatusTransformer(session: FirSession) : FirStatusTransformerExtension(session) { class AllOpenStatusTransformer(session: FirSession) : FirStatusTransformerExtension(session) {
companion object { companion object {
private val ALL_OPEN = FqName("org.jetbrains.kotlin.fir.allopen.AllOpen") private val ALL_OPEN = FqName("org.jetbrains.kotlin.fir.plugin.AllOpen")
} }
override fun transformStatus(declaration: FirDeclaration, status: FirDeclarationStatus): FirDeclarationStatus { override fun transformStatus(declaration: FirDeclaration, status: FirDeclarationStatus): FirDeclarationStatus {
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen package org.jetbrains.kotlin.fir.plugin
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrar import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrar
@@ -0,0 +1,7 @@
import org.jetbrains.kotlin.fir.plugin.WithClass
import org.jetbrains.kotlin.fir.plugin.AllOpen
@WithClass
class A {
}
@@ -1,5 +1,5 @@
FILE: simple.kt FILE: simple.kt
@R|org/jetbrains/kotlin/fir/allopen/WithClass|() public final class A : R|kotlin/Any| { @R|org/jetbrains/kotlin/fir/plugin/WithClass|() public final class A : R|kotlin/Any| {
public constructor(): R|A| { public constructor(): R|A| {
super<R|kotlin/Any|>() super<R|kotlin/Any|>()
} }
@@ -1,4 +1,4 @@
import org.jetbrains.kotlin.fir.allopen.AllOpen import org.jetbrains.kotlin.fir.plugin.AllOpen
@Open @Open
class A { class A {
@@ -17,7 +17,7 @@ FILE: metaAnnotation.kt
} }
} }
@R|org/jetbrains/kotlin/fir/allopen/AllOpen|() public open annotation class Open : R|kotlin/Annotation| { @R|org/jetbrains/kotlin/fir/plugin/AllOpen|() public open annotation class Open : R|kotlin/Annotation| {
public constructor(): R|Open| { public constructor(): R|Open| {
super<R|kotlin/Any|>() super<R|kotlin/Any|>()
} }
@@ -1,4 +1,4 @@
import org.jetbrains.kotlin.fir.allopen.AllOpen import org.jetbrains.kotlin.fir.plugin.AllOpen
@AllOpen @AllOpen
class A { class A {
@@ -1,5 +1,5 @@
FILE: simpleAnnotation.kt FILE: simpleAnnotation.kt
@R|org/jetbrains/kotlin/fir/allopen/AllOpen|() public open class A : R|kotlin/Any| { @R|org/jetbrains/kotlin/fir/plugin/AllOpen|() public open class A : R|kotlin/Any| {
public constructor(): R|A| { public constructor(): R|A| {
super<R|kotlin/Any|>() super<R|kotlin/Any|>()
} }
@@ -8,7 +8,7 @@ FILE: simpleAnnotation.kt
} }
} }
@R|org/jetbrains/kotlin/fir/allopen/AllOpen|() public open class B : R|A| { @R|org/jetbrains/kotlin/fir/plugin/AllOpen|() public open class B : R|A| {
public constructor(): R|B| { public constructor(): R|B| {
super<R|A|>() super<R|A|>()
} }
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen package org.jetbrains.kotlin.fir.plugin
import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot
import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.config.CompilerConfiguration
@@ -19,6 +19,6 @@ abstract class AbstractFirAllOpenDiagnosticTest : AbstractFirDiagnosticsTest() {
override fun performCustomConfiguration(configuration: CompilerConfiguration) { override fun performCustomConfiguration(configuration: CompilerConfiguration) {
super.performCustomConfiguration(configuration) super.performCustomConfiguration(configuration)
configuration.addJvmClasspathRoot(File("compiler/fir/plugins/allopen-plugin/allopen-annotations/build/libs/allopen-annotations-1.4.255-SNAPSHOT.jar")) configuration.addJvmClasspathRoot(File("plugins/fir/fir-plugin-prototype/plugin-annotations/build/libs/plugin-annotations-1.4.255-SNAPSHOT.jar"))
} }
} }
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.fir.allopen; package org.jetbrains.kotlin.fir.plugin;
import com.intellij.testFramework.TestDataPath; import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
@@ -16,7 +16,7 @@ import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all") @SuppressWarnings("all")
@TestMetadata("compiler/fir/plugins/allopen-plugin/testData") @TestMetadata("plugins/fir/fir-plugin-prototype/testData")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
public class FirAllOpenDiagnosticTestGenerated extends AbstractFirAllOpenDiagnosticTest { public class FirAllOpenDiagnosticTestGenerated extends AbstractFirAllOpenDiagnosticTest {
@@ -25,10 +25,10 @@ public class FirAllOpenDiagnosticTestGenerated extends AbstractFirAllOpenDiagnos
} }
public void testAllFilesPresentInTestData() throws Exception { public void testAllFilesPresentInTestData() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/plugins/allopen-plugin/testData"), Pattern.compile("^(.+)\\.kt$"), null, true); KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/fir/fir-plugin-prototype/testData"), Pattern.compile("^(.+)\\.kt$"), null, true);
} }
@TestMetadata("compiler/fir/plugins/allopen-plugin/testData/classGen") @TestMetadata("plugins/fir/fir-plugin-prototype/testData/classGen")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
public static class ClassGen extends AbstractFirAllOpenDiagnosticTest { public static class ClassGen extends AbstractFirAllOpenDiagnosticTest {
@@ -37,16 +37,16 @@ public class FirAllOpenDiagnosticTestGenerated extends AbstractFirAllOpenDiagnos
} }
public void testAllFilesPresentInClassGen() throws Exception { public void testAllFilesPresentInClassGen() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/plugins/allopen-plugin/testData/classGen"), Pattern.compile("^(.+)\\.kt$"), null, true); KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/fir/fir-plugin-prototype/testData/classGen"), Pattern.compile("^(.+)\\.kt$"), null, true);
} }
@TestMetadata("simple.kt") @TestMetadata("simple.kt")
public void testSimple() throws Exception { public void testSimple() throws Exception {
runTest("compiler/fir/plugins/allopen-plugin/testData/classGen/simple.kt"); runTest("plugins/fir/fir-plugin-prototype/testData/classGen/simple.kt");
} }
} }
@TestMetadata("compiler/fir/plugins/allopen-plugin/testData/status") @TestMetadata("plugins/fir/fir-plugin-prototype/testData/status")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
public static class Status extends AbstractFirAllOpenDiagnosticTest { public static class Status extends AbstractFirAllOpenDiagnosticTest {
@@ -55,17 +55,17 @@ public class FirAllOpenDiagnosticTestGenerated extends AbstractFirAllOpenDiagnos
} }
public void testAllFilesPresentInStatus() throws Exception { public void testAllFilesPresentInStatus() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/plugins/allopen-plugin/testData/status"), Pattern.compile("^(.+)\\.kt$"), null, true); KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/fir/fir-plugin-prototype/testData/status"), Pattern.compile("^(.+)\\.kt$"), null, true);
} }
@TestMetadata("metaAnnotation.kt") @TestMetadata("metaAnnotation.kt")
public void testMetaAnnotation() throws Exception { public void testMetaAnnotation() throws Exception {
runTest("compiler/fir/plugins/allopen-plugin/testData/status/metaAnnotation.kt"); runTest("plugins/fir/fir-plugin-prototype/testData/status/metaAnnotation.kt");
} }
@TestMetadata("simpleAnnotation.kt") @TestMetadata("simpleAnnotation.kt")
public void testSimpleAnnotation() throws Exception { public void testSimpleAnnotation() throws Exception {
runTest("compiler/fir/plugins/allopen-plugin/testData/status/simpleAnnotation.kt"); runTest("plugins/fir/fir-plugin-prototype/testData/status/simpleAnnotation.kt");
} }
} }
} }
+2 -2
View File
@@ -96,8 +96,6 @@ include ":kotlin-build-common",
":compiler:fir:jvm", ":compiler:fir:jvm",
":compiler:fir:checkers", ":compiler:fir:checkers",
":compiler:fir:analysis-tests", ":compiler:fir:analysis-tests",
":compiler:fir:plugins:allopen-plugin",
":compiler:fir:plugins:allopen-plugin:allopen-annotations",
":compiler:frontend", ":compiler:frontend",
":compiler:frontend.common", ":compiler:frontend.common",
":compiler:frontend.java", ":compiler:frontend.java",
@@ -205,6 +203,8 @@ include ":kotlin-build-common",
":plugins:annotation-based-compiler-plugins-ide-support", ":plugins:annotation-based-compiler-plugins-ide-support",
":kotlin-script-runtime", ":kotlin-script-runtime",
":kotlin-coroutines-experimental-compat", ":kotlin-coroutines-experimental-compat",
":plugins:fir:fir-plugin-prototype",
":plugins:fir:fir-plugin-prototype:plugin-annotations",
":kotlin-test", ":kotlin-test",
":kotlin-test:kotlin-test-common", ":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-annotations-common", ":kotlin-test:kotlin-test-annotations-common",