From 6e362f6734a8b4456ef06994d6f48ee0018dfade Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Thu, 17 May 2018 00:06:11 +0300 Subject: [PATCH] Kapt: Remove kapt1 from Kotlin compiler --- .../kotlin/codegen/ClassBuilderFactories.java | 64 ++--- .../kotlin/codegen/ClassBuilderMode.java | 15 +- .../serialization/JvmSerializerExtension.java | 2 +- compiler/cli/build.gradle.kts | 7 +- .../kotlin/cli/jvm/BundledCompilerPlugins.kt | 6 +- .../compiler/KotlinToJVMBytecodeCompiler.kt | 3 +- .../KotlinToJVMBytecodeCompiler.kt.as31 | 3 +- .../KotlinToJVMBytecodeCompiler.kt.as32 | 3 +- .../kotlin/cli/jvm/config/Kapt2EnabledKey.kt | 21 -- .../cli/jvm/repl/GenericReplCompiler.kt | 2 +- ...stractKapt3BuilderModeBytecodeShapeTest.kt | 2 +- .../codegen/AbstractLightAnalysisModeTest.kt | 2 +- .../kotlin/generators/tests/GenerateTests.kt | 7 - .../generators/tests/GenerateTests.kt.172 | 7 - .../generators/tests/GenerateTests.kt.as31 | 7 - .../generators/tests/GenerateTests.kt.as32 | 7 - .../evaluate/KotlinEvaluationBuilder.kt | 2 +- .../scratch/compile/KtCompilingExecutor.kt | 2 +- .../jvmhost/impl/KJVMCompilerImpl.kt | 2 +- .../parcel/ParcelableDeclarationChecker.kt | 2 +- .../AnnotationCollectorExtension.kt | 270 ------------------ .../annotation/AnnotationCollectorPlugin.kt | 99 ------- .../annotation/StubProducerExtension.kt | 82 ------ .../AbstractAnnotationProcessorBoxTest.kt | 88 ------ .../AnnotationProcessorBoxTestGenerated.java | 136 --------- .../annotatedGettersSetters.kt | 12 - .../annotatedGettersSetters/annotations.txt | 14 - .../annotationInSameFile.kt | 12 - .../annotationInSameFile/annotations.txt | 8 - .../anonymousClasses/annotations.txt | 3 - .../anonymousClasses/anonymousClasses.kt | 13 - .../classAnnotations/annotations.txt | 4 - .../classAnnotations/classAnnotations.kt | 5 - .../constructors/annotations.txt | 4 - .../constructors/constructors.kt | 13 - .../defaultPackage/annotations.txt | 12 - .../defaultPackage/defaultPackage.kt | 9 - .../fieldAnnotations/annotations.txt | 7 - .../fieldAnnotations/fieldAnnotations.kt | 11 - .../inheritedComplex/annotations.txt | 18 -- .../inheritedComplex/inheritedComplex.kt | 19 -- .../inheritedSimple/annotations.txt | 11 - .../inheritedSimple/inheritedSimple.kt | 11 - .../inheritedTopLevel/annotations.txt | 4 - .../inheritedTopLevel/inheritedTopLevel.kt | 8 - .../localClasses/annotations.txt | 7 - .../localClasses/localClasses.kt | 17 -- .../localFunctions/annotations.txt | 4 - .../localFunctions/localFunctions.kt | 11 - .../methodAnnotations/annotations.txt | 8 - .../methodAnnotations/methodAnnotations.kt | 25 -- .../multiFileTopLevelAnnotated/Ann.kt | 3 - .../annotations.txt | 10 - .../multiFileTopLevelAnnotated/partA.kt | 10 - .../multiFileTopLevelAnnotated/partB.kt | 10 - .../nestedClasses/annotations.txt | 7 - .../nestedClasses/nestedClasses.kt | 30 -- .../platformStatic/annotations.txt | 4 - .../platformStatic/platformStatic.kt | 11 - .../ClassAnnotation.java | 4 - .../DefaultAnnotation.java | 3 - .../RuntimeAnnotation.java | 4 - .../SourceAnnotation.java | 4 - .../annotations.txt | 6 - .../retentionPoliciesJavaAnnotations/usage.kt | 11 - .../ClassAnnotation.java | 4 - .../DefaultAnnotation.java | 3 - .../RuntimeAnnotation.java | 4 - .../SourceAnnotation.java | 4 - .../annotations.txt | 8 - .../usage.kt | 11 - .../annotations.kt | 10 - .../annotations.txt | 15 - .../usage.kt | 11 - .../annotations.kt | 10 - .../annotations.txt | 17 -- .../usage.kt | 11 - .../topLevelAnnotated/annotations.txt | 6 - .../topLevelAnnotated/topLevelAnnotated.kt | 9 - 79 files changed, 43 insertions(+), 1308 deletions(-) delete mode 100644 compiler/cli/src/org/jetbrains/kotlin/cli/jvm/config/Kapt2EnabledKey.kt delete mode 100644 plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorExtension.kt delete mode 100644 plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorPlugin.kt delete mode 100644 plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/StubProducerExtension.kt delete mode 100644 plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AbstractAnnotationProcessorBoxTest.kt delete mode 100644 plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AnnotationProcessorBoxTestGenerated.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotatedGettersSetters.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotationInSameFile.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/anonymousClasses/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/anonymousClasses/anonymousClasses.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/classAnnotations/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/classAnnotations/classAnnotations.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/constructors/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/constructors/constructors.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/defaultPackage/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/defaultPackage/defaultPackage.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/fieldAnnotations/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/fieldAnnotations/fieldAnnotations.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/inheritedComplex/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/inheritedComplex/inheritedComplex.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/inheritedSimple/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/inheritedSimple/inheritedSimple.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/inheritedTopLevel.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/localClasses/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/localClasses/localClasses.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/localFunctions/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/localFunctions/localFunctions.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/methodAnnotations/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/methodAnnotations/methodAnnotations.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/Ann.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partA.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partB.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/nestedClasses/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/nestedClasses/nestedClasses.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/platformStatic/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/platformStatic/platformStatic.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/ClassAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/DefaultAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/RuntimeAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/SourceAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/usage.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/ClassAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/DefaultAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/RuntimeAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/SourceAnnotation.java delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/usage.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/usage.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/usage.kt delete mode 100644 plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/annotations.txt delete mode 100644 plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/topLevelAnnotated.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderFactories.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderFactories.java index 735bf6d87d6..2e01cd9117d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderFactories.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderFactories.java @@ -31,7 +31,7 @@ public class ClassBuilderFactories { @NotNull @Override public ClassBuilderMode getClassBuilderMode() { - return ClassBuilderMode.full(false); + return ClassBuilderMode.FULL; } @NotNull @@ -56,21 +56,15 @@ public class ClassBuilderFactories { } }; - public static ClassBuilderFactory TEST = new TestClassBuilderFactory(false); + public static ClassBuilderFactory TEST = new TestClassBuilderFactory(); - public static ClassBuilderFactory TEST_WITH_SOURCE_RETENTION_ANNOTATIONS = new TestClassBuilderFactory(true); - public static class TestClassBuilderFactory implements ClassBuilderFactory { - private final boolean generateSourceRetentionAnnotations; - - public TestClassBuilderFactory(boolean generateSourceRetentionAnnotations) { - this.generateSourceRetentionAnnotations = generateSourceRetentionAnnotations; - } + public TestClassBuilderFactory() {} @NotNull @Override public ClassBuilderMode getClassBuilderMode() { - return ClassBuilderMode.full(generateSourceRetentionAnnotations); + return ClassBuilderMode.FULL; } @NotNull @@ -101,37 +95,33 @@ public class ClassBuilderFactories { } @NotNull - public static ClassBuilderFactory binaries(boolean generateSourceRetentionAnnotations) { - return new ClassBuilderFactory() { - @NotNull - @Override - public ClassBuilderMode getClassBuilderMode() { - return ClassBuilderMode.full(generateSourceRetentionAnnotations); - } + public static ClassBuilderFactory BINARIES = new ClassBuilderFactory() { + @NotNull + @Override + public ClassBuilderMode getClassBuilderMode() { + return ClassBuilderMode.FULL; + } - @NotNull - @Override - public ClassBuilder newClassBuilder(@NotNull JvmDeclarationOrigin origin) { - return new AbstractClassBuilder.Concrete(new BinaryClassWriter()); - } + @NotNull + @Override + public ClassBuilder newClassBuilder(@NotNull JvmDeclarationOrigin origin) { + return new AbstractClassBuilder.Concrete(new BinaryClassWriter()); + } - @Override - public String asText(ClassBuilder builder) { - throw new UnsupportedOperationException("BINARIES generator asked for text"); - } + @Override + public String asText(ClassBuilder builder) { + throw new UnsupportedOperationException("BINARIES generator asked for text"); + } - @Override - public byte[] asBytes(ClassBuilder builder) { - ClassWriter visitor = (ClassWriter) builder.getVisitor(); - return visitor.toByteArray(); - } + @Override + public byte[] asBytes(ClassBuilder builder) { + ClassWriter visitor = (ClassWriter) builder.getVisitor(); + return visitor.toByteArray(); + } - @Override - public void close() { - - } - }; - } + @Override + public void close() {} + }; private ClassBuilderFactories() { } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderMode.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderMode.java index 84a89b5101f..7d19d000e0a 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderMode.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBuilderMode.java @@ -35,15 +35,11 @@ public class ClassBuilderMode { this.generateSourceRetentionAnnotations = generateSourceRetentionAnnotations; this.generateMultiFileFacadePartClasses = generateMultiFileFacadePartClasses; } - - public static ClassBuilderMode full(boolean generateSourceRetentionAnnotations) { - return generateSourceRetentionAnnotations ? KAPT : FULL; - } /** * Full function bodies */ - private final static ClassBuilderMode FULL = new ClassBuilderMode( + public final static ClassBuilderMode FULL = new ClassBuilderMode( /* bodies = */ true, /* metadata = */ true, /* sourceRetention = */ false, @@ -57,15 +53,6 @@ public class ClassBuilderMode { /* metadata = */ false, /* sourceRetention = */ true, /* generateMultiFileFacadePartClasses = */ false); - - /** - * Function signatures + metadata (to support incremental compilation with kapt) - */ - public final static ClassBuilderMode KAPT = new ClassBuilderMode( - /* bodies = */ false, - /* metadata = */ true, - /* sourceRetention = */ true, - /* generateMultiFileFacadePartClasses = */ false); /** * Function signatures + metadata (to support incremental compilation with kapt) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.java index 3c44f53f6cc..b0d6c8faa80 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.java @@ -196,7 +196,7 @@ public class JvmSerializerExtension extends SerializerExtension { @Override public void serializeErrorType(@NotNull KotlinType type, @NotNull ProtoBuf.Type.Builder builder) { - if (classBuilderMode == ClassBuilderMode.KAPT || classBuilderMode == ClassBuilderMode.KAPT3) { + if (classBuilderMode == ClassBuilderMode.KAPT3) { builder.setClassName(stringTable.getStringIndex(TypeSignatureMappingKt.NON_EXISTENT_CLASS_NAME)); return; } diff --git a/compiler/cli/build.gradle.kts b/compiler/cli/build.gradle.kts index 6406ce00252..a9a66cfba94 100644 --- a/compiler/cli/build.gradle.kts +++ b/compiler/cli/build.gradle.kts @@ -37,13 +37,10 @@ dependencies { sourceSets { "main" { projectDefault() - java.srcDirs("../../plugins/annotation-collector/src", - "../builtins-serializer/src", + java.srcDirs("../builtins-serializer/src", "../javac-wrapper/src") } - "test" { - java.srcDirs("../../plugins/annotation-collector/test") - } + "test" { } } testsJar {} diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/BundledCompilerPlugins.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/BundledCompilerPlugins.kt index 9e91c3af90e..04c50b839ee 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/BundledCompilerPlugins.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/BundledCompilerPlugins.kt @@ -16,17 +16,15 @@ package org.jetbrains.kotlin.cli.jvm -import org.jetbrains.kotlin.annotation.AnnotationCollectorCommandLineProcessor -import org.jetbrains.kotlin.annotation.AnnotationCollectorComponentRegistrar import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar object BundledCompilerPlugins { val componentRegistrars: List - get() = listOf(AnnotationCollectorComponentRegistrar()) + get() = emptyList() val commandLineProcessors: List - get() = listOf(AnnotationCollectorCommandLineProcessor()) + get() = emptyList() } \ No newline at end of file diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt index 5386931cdb4..e284f889480 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt @@ -420,10 +420,9 @@ object KotlinToJVMBytecodeCompiler { sourceFiles: List, module: Module? ): GenerationState { - val isKapt2Enabled = environment.project.getUserData(IS_KAPT2_ENABLED_KEY) ?: false val generationState = GenerationState.Builder( environment.project, - ClassBuilderFactories.binaries(isKapt2Enabled), + ClassBuilderFactories.BINARIES, result.moduleDescriptor, result.bindingContext, sourceFiles, diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as31 b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as31 index ea92dca9c3a..3d9141515f3 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as31 +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as31 @@ -422,10 +422,9 @@ object KotlinToJVMBytecodeCompiler { sourceFiles: List, module: Module? ): GenerationState { - val isKapt2Enabled = environment.project.getUserData(IS_KAPT2_ENABLED_KEY) ?: false val generationState = GenerationState.Builder( environment.project, - ClassBuilderFactories.binaries(isKapt2Enabled), + ClassBuilderFactories.BINARIES, result.moduleDescriptor, result.bindingContext, sourceFiles, diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as32 b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as32 index ea92dca9c3a..3d9141515f3 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as32 +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt.as32 @@ -422,10 +422,9 @@ object KotlinToJVMBytecodeCompiler { sourceFiles: List, module: Module? ): GenerationState { - val isKapt2Enabled = environment.project.getUserData(IS_KAPT2_ENABLED_KEY) ?: false val generationState = GenerationState.Builder( environment.project, - ClassBuilderFactories.binaries(isKapt2Enabled), + ClassBuilderFactories.BINARIES, result.moduleDescriptor, result.bindingContext, sourceFiles, diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/config/Kapt2EnabledKey.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/config/Kapt2EnabledKey.kt deleted file mode 100644 index 9a98f7eca82..00000000000 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/config/Kapt2EnabledKey.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010-2016 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.config - -import com.intellij.openapi.util.Key - -val IS_KAPT2_ENABLED_KEY = Key("IsKapt2EnabledKey") \ No newline at end of file diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/GenericReplCompiler.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/GenericReplCompiler.kt index 204eaa58969..e5edf7c5d2c 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/GenericReplCompiler.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/GenericReplCompiler.kt @@ -89,7 +89,7 @@ open class GenericReplCompiler(disposable: Disposable, val generationState = GenerationState.Builder( psiFile.project, - ClassBuilderFactories.binaries(false), + ClassBuilderFactories.BINARIES, compilerState.analyzerEngine.module, compilerState.analyzerEngine.trace.bindingContext, listOf(psiFile), diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractKapt3BuilderModeBytecodeShapeTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractKapt3BuilderModeBytecodeShapeTest.kt index 16d79e11c3c..2108021ee75 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractKapt3BuilderModeBytecodeShapeTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractKapt3BuilderModeBytecodeShapeTest.kt @@ -24,7 +24,7 @@ import java.io.File abstract class AbstractKapt3BuilderModeBytecodeShapeTest : CodegenTestCase() { private companion object { - var TEST_LIGHT_ANALYSIS: ClassBuilderFactory = object : ClassBuilderFactories.TestClassBuilderFactory(false) { + var TEST_LIGHT_ANALYSIS: ClassBuilderFactory = object : ClassBuilderFactories.TestClassBuilderFactory() { override fun getClassBuilderMode() = ClassBuilderMode.KAPT3 } } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractLightAnalysisModeTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractLightAnalysisModeTest.kt index c7c009cd7a2..9c4dd8ec939 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractLightAnalysisModeTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractLightAnalysisModeTest.kt @@ -21,7 +21,7 @@ import java.io.File abstract class AbstractLightAnalysisModeTest : CodegenTestCase() { private companion object { - var TEST_LIGHT_ANALYSIS: ClassBuilderFactory = object : ClassBuilderFactories.TestClassBuilderFactory(false) { + var TEST_LIGHT_ANALYSIS: ClassBuilderFactory = object : ClassBuilderFactories.TestClassBuilderFactory() { override fun getClassBuilderMode() = ClassBuilderMode.LIGHT_ANALYSIS_FOR_TESTS } } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 93061166a09..45e340c72e0 100755 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -32,7 +32,6 @@ import org.jetbrains.kotlin.android.quickfix.AbstractAndroidQuickFixMultiFileTes 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.annotation.AbstractAnnotationProcessorBoxTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinBinariesCheckerTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinSourceCheckerTest import org.jetbrains.kotlin.checkers.AbstractJsCheckerTest @@ -1016,12 +1015,6 @@ fun main(args: Array) { } } - testGroup("plugins/annotation-collector/test", "plugins/annotation-collector/testData") { - testClass { - model("collectToFile", recursive = false, extension = null) - } - } - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { testClass { model("converter") diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.172 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.172 index 81dffdd2d85..270c7c70461 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.172 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.172 @@ -32,7 +32,6 @@ import org.jetbrains.kotlin.android.quickfix.AbstractAndroidQuickFixMultiFileTes 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.annotation.AbstractAnnotationProcessorBoxTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinBinariesCheckerTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinSourceCheckerTest import org.jetbrains.kotlin.checkers.AbstractJsCheckerTest @@ -1006,12 +1005,6 @@ fun main(args: Array) { } } - testGroup("plugins/annotation-collector/test", "plugins/annotation-collector/testData") { - testClass { - model("collectToFile", recursive = false, extension = null) - } - } - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { testClass { model("converter") diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 index bc85cd9f5c4..280af5a5140 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 @@ -31,7 +31,6 @@ import org.jetbrains.kotlin.android.quickfix.AbstractAndroidQuickFixMultiFileTes 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.annotation.AbstractAnnotationProcessorBoxTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinBinariesCheckerTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinSourceCheckerTest import org.jetbrains.kotlin.checkers.AbstractJsCheckerTest @@ -1018,12 +1017,6 @@ fun main(args: Array) { } } - testGroup("plugins/annotation-collector/test", "plugins/annotation-collector/testData") { - testClass { - model("collectToFile", recursive = false, extension = null) - } - } - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { testClass { model("converter") diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 index bc85cd9f5c4..280af5a5140 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 @@ -31,7 +31,6 @@ import org.jetbrains.kotlin.android.quickfix.AbstractAndroidQuickFixMultiFileTes 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.annotation.AbstractAnnotationProcessorBoxTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinBinariesCheckerTest import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinSourceCheckerTest import org.jetbrains.kotlin.checkers.AbstractJsCheckerTest @@ -1018,12 +1017,6 @@ fun main(args: Array) { } } - testGroup("plugins/annotation-collector/test", "plugins/annotation-collector/testData") { - testClass { - model("collectToFile", recursive = false, extension = null) - } - } - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { testClass { model("converter") diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt index b6a89b50f7e..5d4b10a771e 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt @@ -460,7 +460,7 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, val sourcePosition: Sour val state = GenerationState.Builder( fileForDebugger.project, - if (!DEBUG_MODE) ClassBuilderFactories.binaries(false) else ClassBuilderFactories.TEST, + if (!DEBUG_MODE) ClassBuilderFactories.BINARIES else ClassBuilderFactories.TEST, moduleDescriptor, bindingContext, files, diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt index d868f4cf539..bded5c16bd9 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt @@ -112,7 +112,7 @@ class KtCompilingExecutor(file: ScratchFile) : ScratchExecutor(file) { val state = GenerationState.Builder( file.project, - ClassBuilderFactories.binaries(false), + ClassBuilderFactories.BINARIES, resolutionFacade.moduleDescriptor, bindingContext, files, diff --git a/libraries/scripting/jvm-host/src/kotlin/script/experimental/jvmhost/impl/KJVMCompilerImpl.kt b/libraries/scripting/jvm-host/src/kotlin/script/experimental/jvmhost/impl/KJVMCompilerImpl.kt index 0cff6a00fca..7fb381f020d 100644 --- a/libraries/scripting/jvm-host/src/kotlin/script/experimental/jvmhost/impl/KJVMCompilerImpl.kt +++ b/libraries/scripting/jvm-host/src/kotlin/script/experimental/jvmhost/impl/KJVMCompilerImpl.kt @@ -174,7 +174,7 @@ class KJVMCompilerImpl : KJVMCompilerProxy { val generationState = GenerationState.Builder( psiFile.project, - ClassBuilderFactories.binaries(false), + ClassBuilderFactories.BINARIES, analysisResult.moduleDescriptor, analysisResult.bindingContext, sourceFiles, diff --git a/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableDeclarationChecker.kt b/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableDeclarationChecker.kt index 7a8acf0c26d..3c0d61ac798 100644 --- a/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableDeclarationChecker.kt +++ b/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableDeclarationChecker.kt @@ -170,7 +170,7 @@ class ParcelableDeclarationChecker : DeclarationChecker { val typeMapper = KotlinTypeMapper( bindingContext, - ClassBuilderMode.full(false), + ClassBuilderMode.FULL, IncompatibleClassTracker.DoNothing, descriptor.module.name.asString(), /* isJvm8Target */ false, diff --git a/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorExtension.kt b/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorExtension.kt deleted file mode 100644 index ad7d34f9ab6..00000000000 --- a/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorExtension.kt +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright 2010-2016 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.annotation - -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.codegen.ClassBuilder -import org.jetbrains.kotlin.codegen.ClassBuilderFactory -import org.jetbrains.kotlin.codegen.DelegatingClassBuilder -import org.jetbrains.kotlin.codegen.DelegatingClassBuilderFactory -import org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension -import org.jetbrains.kotlin.diagnostics.DiagnosticSink -import org.jetbrains.kotlin.load.java.JvmAnnotationNames -import org.jetbrains.kotlin.resolve.BindingContext -import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin -import org.jetbrains.org.objectweb.asm.* -import java.io.File -import java.io.IOException -import java.io.Writer -import java.util.regex.Pattern -import java.util.regex.PatternSyntaxException - -abstract class AnnotationCollectorExtensionBase(val supportInheritedAnnotations: Boolean) : ClassBuilderInterceptorExtension { - - private object RecordTypes { - val ANNOTATED_CLASS = "c" - val ANNOTATED_METHOD = "m" - val ANNOTATED_FIELD = "f" - - val SHORTENED_ANNOTATION = "a" - val SHORTENED_PACKAGE_NAME = "p" - - val CLASS_DECLARATION = "d" - } - - protected abstract val annotationFilterList: List? - - private val shortenedAnnotationCache = ShortenedNameCache(RecordTypes.SHORTENED_ANNOTATION) - private val shortenedPackageNameCache = ShortenedNameCache(RecordTypes.SHORTENED_PACKAGE_NAME) - - override fun interceptClassBuilderFactory( - interceptedFactory: ClassBuilderFactory, - bindingContext: BindingContext, - diagnostics: DiagnosticSink - ): ClassBuilderFactory { - return AnnotationCollectorClassBuilderFactory(interceptedFactory, getWriter(diagnostics), diagnostics) - } - - protected abstract fun getWriter(diagnostic: DiagnosticSink): Writer - protected abstract fun closeWriter() - - private inner class AnnotationCollectorClassBuilderFactory( - delegateFactory: ClassBuilderFactory, - val writer: Writer, - val diagnostics: DiagnosticSink - ) : DelegatingClassBuilderFactory(delegateFactory) { - - override fun newClassBuilder(origin: JvmDeclarationOrigin): DelegatingClassBuilder { - return AnnotationCollectorClassBuilder(delegate.newClassBuilder(origin), writer, diagnostics) - } - - override fun close() { - closeWriter() - delegate.close() - } - } - - private inner class AnnotationCollectorClassBuilder( - internal val delegateClassBuilder: ClassBuilder, - val writer: Writer, - val diagnostics: DiagnosticSink - ) : DelegatingClassBuilder() { - private val annotationFilterEnabled: Boolean - private val annotationFilters: List - - init { - val nullableAnnotations = annotationFilterList?.map { it.compilePatternOpt() } ?: listOf() - annotationFilterEnabled = nullableAnnotations.isNotEmpty() - annotationFilters = nullableAnnotations.filterNotNull() - } - - private val classVisitor: ClassVisitor by lazy { - object : ClassVisitor(Opcodes.ASM5, super.getVisitor()) { - override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? { - recordAnnotation(null, RecordTypes.ANNOTATED_CLASS, desc) - return super.visitAnnotation(desc, visible) - } - } - } - - private lateinit var currentClassSimpleName: String - - private lateinit var currentPackageName: String - - override fun getVisitor() = classVisitor - - override fun getDelegate() = delegateClassBuilder - - override fun defineClass( - origin: PsiElement?, - version: Int, - access: Int, - name: String, - signature: String?, - superName: String, - interfaces: Array - ) { - val currentClassSimpleName = name.substringAfterLast('/') - val currentPackageName = name.substringBeforeLast('/', "").replace('/', '.') - - this.currentClassSimpleName = currentClassSimpleName - this.currentPackageName = currentPackageName - - if (supportInheritedAnnotations) { - recordClass(currentPackageName, currentClassSimpleName) - } - - super.defineClass(origin, version, access, name, signature, superName, interfaces) - } - - override fun newField( - origin: JvmDeclarationOrigin, - access: Int, - name: String, - desc: String, - signature: String?, - value: Any? - ): FieldVisitor { - return object : FieldVisitor(Opcodes.ASM5, super.newField(origin, access, name, desc, signature, value)) { - override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? { - recordAnnotation(name, RecordTypes.ANNOTATED_FIELD, desc) - return super.visitAnnotation(desc, visible) - } - } - } - - override fun newMethod( - origin: JvmDeclarationOrigin, - access: Int, - name: String, - desc: String, - signature: String?, - exceptions: Array? - ): MethodVisitor { - return object : MethodVisitor(Opcodes.ASM5, super.newMethod(origin, access, name, desc, signature, exceptions)) { - override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? { - recordAnnotation(name, RecordTypes.ANNOTATED_METHOD, desc) - return super.visitAnnotation(desc, visible) - } - } - } - - private fun isAnnotationHandled(annotationFqName: String): Boolean { - return if (annotationFilterEnabled) - annotationFilters.any { it.matcher(annotationFqName).matches() } - else annotationFqName != JvmAnnotationNames.METADATA_FQ_NAME.asString() - } - - private fun recordClass(packageName: String, className: String) { - if (!isValidName(packageName) || !isValidName(className)) return - - val packageNameId = if (!packageName.isEmpty()) - shortenedPackageNameCache.save(packageName, writer) - else null - - val outputClassName = getOutputClassName(packageNameId, className) - writer.write("${RecordTypes.CLASS_DECLARATION} $outputClassName\n") - } - - private fun recordAnnotation(name: String?, type: String, annotationDesc: String) { - val annotationFqName = Type.getType(annotationDesc).className - if (!isAnnotationHandled(annotationFqName) || !isValidName(annotationFqName)) return - - if (name != null && !isValidName(name)) return - - try { - val packageName = this.currentPackageName - if (!isValidName(packageName)) return - - val className = this.currentClassSimpleName - if (!isValidName(className)) return - - val annotationId = shortenedAnnotationCache.save(annotationFqName, writer) - - val packageNameId = if (!packageName.isEmpty()) - shortenedPackageNameCache.save(packageName, writer) - else null - - val outputClassName = getOutputClassName(packageNameId, className) - val elementName = if (name != null) " $name" else "" - - writer.write("$type $annotationId $outputClassName$elementName\n") - } - catch (e: IOException) { - throw e - } - } - - private fun isValidName(name: String): Boolean { - return ' ' !in name - } - - private fun getOutputClassName(packageNameId: String?, className: String): String { - return if (packageNameId == null) className else "$packageNameId/$className" - } - - private fun String.compilePatternOpt(): Pattern? { - return try { - Pattern.compile(this) - } - catch (e: PatternSyntaxException) { - null - } - } - } - - private class ShortenedNameCache(val type: String) { - private val internalCache = hashMapOf() - private var counter: Int = 0 - - fun save(name: String, writer: Writer): String { - return internalCache.getOrPut(name) { - val resultId = counter.toString() - writer.write("$type $name $resultId\n") - counter += 1 - resultId - } - } - } -} - -class AnnotationCollectorExtension( - override val annotationFilterList: List? = null, - private val outputFilename: String? = null, - supportInheritedAnnotations: Boolean -) : AnnotationCollectorExtensionBase(supportInheritedAnnotations) { - - private var writerInternal: Writer? = null - - override fun closeWriter() { - writerInternal?.close() - } - - override fun getWriter(diagnostic: DiagnosticSink): Writer { - return writerInternal ?: try { - with (File(outputFilename)) { - val parent = parentFile - if (!parent.exists()) parent.mkdirs() - writerInternal = bufferedWriter() - writerInternal!! - } - } - catch (e: IOException) { - throw e - } - } -} \ No newline at end of file diff --git a/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorPlugin.kt b/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorPlugin.kt deleted file mode 100644 index c490a37ec4e..00000000000 --- a/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/AnnotationCollectorPlugin.kt +++ /dev/null @@ -1,99 +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.annotation - -import com.intellij.mock.MockProject -import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension -import org.jetbrains.kotlin.compiler.plugin.CliOption -import org.jetbrains.kotlin.compiler.plugin.CliOptionProcessingException -import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor -import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar -import org.jetbrains.kotlin.config.CommonConfigurationKeys -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.config.CompilerConfigurationKey -import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension -import java.io.File - -object AnnotationCollectorConfigurationKeys { - val ANNOTATION_FILTER_LIST: CompilerConfigurationKey> = - CompilerConfigurationKey.create>("annotation filter regular expressions") - val OUTPUT_FILENAME: CompilerConfigurationKey = - CompilerConfigurationKey.create("annotation file name") - val STUBS_PATH: CompilerConfigurationKey = - CompilerConfigurationKey.create("stubs output directory") - val INHERITED: CompilerConfigurationKey = - CompilerConfigurationKey.create("support inherited annotations") -} - -class AnnotationCollectorCommandLineProcessor : CommandLineProcessor { - companion object { - val ANNOTATION_COLLECTOR_COMPILER_PLUGIN_ID: String = "org.jetbrains.kotlin.kapt" - - val ANNOTATION_FILTER_LIST_OPTION: CliOption = - CliOption("annotations", "", "Annotation filter regular expressions, separated by commas", required = false) - - val OUTPUT_FILENAME_OPTION: CliOption = - CliOption("output", "", "File in which annotated declarations will be placed", required = false) - - val STUBS_PATH_OPTION: CliOption = - CliOption("stubs", "", "Output path for stubs", required = false) - - val INHERITED_ANNOTATIONS_OPTION: CliOption = - CliOption("inherited", "", - "True if collecting Kotlin class names for inherited annotations is needed", required = false) - } - - override val pluginId: String = ANNOTATION_COLLECTOR_COMPILER_PLUGIN_ID - - override val pluginOptions: Collection = - listOf(ANNOTATION_FILTER_LIST_OPTION, OUTPUT_FILENAME_OPTION, STUBS_PATH_OPTION, INHERITED_ANNOTATIONS_OPTION) - - override fun processOption(option: CliOption, value: String, configuration: CompilerConfiguration) { - when (option) { - ANNOTATION_FILTER_LIST_OPTION -> { - val annotations = value.split(',').filter { !it.isEmpty() }.toList() - configuration.put(AnnotationCollectorConfigurationKeys.ANNOTATION_FILTER_LIST, annotations) - } - OUTPUT_FILENAME_OPTION -> configuration.put(AnnotationCollectorConfigurationKeys.OUTPUT_FILENAME, value) - STUBS_PATH_OPTION -> configuration.put(AnnotationCollectorConfigurationKeys.STUBS_PATH, value) - INHERITED_ANNOTATIONS_OPTION -> configuration.put(AnnotationCollectorConfigurationKeys.INHERITED, value) - else -> throw CliOptionProcessingException("Unknown option: ${option.name}") - } - } -} - -class AnnotationCollectorComponentRegistrar : ComponentRegistrar { - override fun registerProjectComponents(project: MockProject, configuration: CompilerConfiguration) { - val supportInheritedAnnotations = "true" == (configuration.get(AnnotationCollectorConfigurationKeys.INHERITED) ?: "true") - - val annotationFilterList = configuration.get(AnnotationCollectorConfigurationKeys.ANNOTATION_FILTER_LIST) - val outputFilename = configuration.get(AnnotationCollectorConfigurationKeys.OUTPUT_FILENAME) - if (outputFilename != null) { - val collectorExtension = AnnotationCollectorExtension(annotationFilterList, outputFilename, supportInheritedAnnotations) - ClassBuilderInterceptorExtension.registerExtension(project, collectorExtension) - } - - val stubs = configuration.get(AnnotationCollectorConfigurationKeys.STUBS_PATH) - if (stubs != null) { - val messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE) - val reportOutputFiles = configuration.getBoolean(CommonConfigurationKeys.REPORT_OUTPUT_FILES) - AnalysisHandlerExtension.registerExtension(project, StubProducerExtension(File(stubs), messageCollector, reportOutputFiles)) - } - } -} diff --git a/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/StubProducerExtension.kt b/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/StubProducerExtension.kt deleted file mode 100644 index 5029f9c4860..00000000000 --- a/plugins/annotation-collector/src/org/jetbrains/kotlin/annotation/StubProducerExtension.kt +++ /dev/null @@ -1,82 +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.annotation - -import com.intellij.openapi.project.Project -import org.jetbrains.kotlin.analyzer.AnalysisResult -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.cli.common.output.outputUtils.writeAll -import org.jetbrains.kotlin.codegen.* -import org.jetbrains.kotlin.codegen.state.GenerationState -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.descriptors.ModuleDescriptor -import org.jetbrains.kotlin.psi.KtFile -import org.jetbrains.kotlin.resolve.BindingContext -import org.jetbrains.kotlin.resolve.BindingTrace -import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin -import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension -import org.jetbrains.org.objectweb.asm.ClassWriter -import java.io.File - -class StubProducerExtension( - private val stubsOutputDir: File, - private val messageCollector: MessageCollector, - private val reportOutputFiles: Boolean -) : AnalysisHandlerExtension { - override fun analysisCompleted( - project: Project, - module: ModuleDescriptor, - bindingTrace: BindingTrace, - files: Collection - ): AnalysisResult? { - val generationState = GenerationState.Builder( - project, - StubClassBuilderFactory(), - module, - bindingTrace.bindingContext, - files.toList(), - CompilerConfiguration.EMPTY - ).build() - - KotlinCodegenFacade.compileCorrectFiles(generationState, CompilationErrorHandler.THROW_EXCEPTION) - - if (!stubsOutputDir.exists()) stubsOutputDir.mkdirs() - generationState.factory.writeAll(stubsOutputDir, messageCollector, reportOutputFiles) - - generationState.destroy() - return AnalysisResult.success(BindingContext.EMPTY, module, shouldGenerateCode = false) - } -} - -private class StubClassBuilderFactory : ClassBuilderFactory { - - override fun getClassBuilderMode() = ClassBuilderMode.KAPT - - override fun newClassBuilder(origin: JvmDeclarationOrigin) = AbstractClassBuilder.Concrete( - ClassWriter(ClassWriter.COMPUTE_FRAMES or ClassWriter.COMPUTE_MAXS)) - - override fun asText(builder: ClassBuilder) = throw UnsupportedOperationException("BINARIES generator asked for text") - - override fun asBytes(builder: ClassBuilder): ByteArray { - val visitor = builder.visitor as ClassWriter - return visitor.toByteArray() - } - - override fun close() { - - } -} diff --git a/plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AbstractAnnotationProcessorBoxTest.kt b/plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AbstractAnnotationProcessorBoxTest.kt deleted file mode 100644 index 65f7b56cf92..00000000000 --- a/plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AbstractAnnotationProcessorBoxTest.kt +++ /dev/null @@ -1,88 +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.annotation - -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles -import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.codegen.CodegenTestFiles -import org.jetbrains.kotlin.codegen.CodegenTestUtil -import org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension -import org.jetbrains.kotlin.diagnostics.DiagnosticSink -import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension -import org.jetbrains.kotlin.test.* -import java.io.File -import java.io.StringWriter - -abstract class AbstractAnnotationProcessorBoxTest : KotlinTestWithEnvironmentManagement() { - fun doTest(path: String) { - val testDir = File(path) - - fun filesByExtension(ext: String) = testDir - .listFiles { file -> file.isFile && file.extension.equals(ext, ignoreCase = true) } - .sortedBy { it.name } - - val testName = getTestName(true) - val ktFiles = filesByExtension("kt") - val supportInheritedAnnotations = testName.contains("inherited", ignoreCase = true) - val supportStubs = testName.contains("stubs", ignoreCase = true) - - val javaFiles = filesByExtension("java") - val javaSourceRoot = - if (javaFiles.isNotEmpty()) { - KotlinTestUtils.tmpDir("java-files").also { javaSourceRoot -> - javaFiles.forEach { javaFile -> javaFile.copyTo(File(javaSourceRoot, javaFile.name)) } - } - } - else null - - val configuration = KotlinTestUtils.newConfiguration( - ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, listOf(KotlinTestUtils.getAnnotationsJar()), listOfNotNull(javaSourceRoot) - ) - val environment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES) - val project = environment.project - - val collectorExtension = AnnotationCollectorExtensionForTests(supportInheritedAnnotations) - ClassBuilderInterceptorExtension.registerExtension(project, collectorExtension) - - if (supportStubs) { - val stubsDir = KotlinTestUtils.tmpDir("class-stubs") - val stubProducerExtension = StubProducerExtension(stubsDir, MessageCollector.NONE, false) - AnalysisHandlerExtension.registerExtension(project, stubProducerExtension) - } - - val testFiles = ktFiles.map { KotlinTestUtils.createFile(it.name, KotlinTestUtils.doLoadFile(it), environment.project) } - - CodegenTestUtil.generateFiles(environment, CodegenTestFiles.create(testFiles)) - - val actualAnnotations = collectorExtension.stringWriter.toString() - val expectedAnnotationsFile = File(path + "annotations.txt") - - KotlinTestUtils.assertEqualsToFile(expectedAnnotationsFile, actualAnnotations) - } - - private class AnnotationCollectorExtensionForTests( - supportInheritedAnnotations: Boolean - ) : AnnotationCollectorExtensionBase(supportInheritedAnnotations) { - val stringWriter = StringWriter() - - override fun getWriter(diagnostic: DiagnosticSink) = stringWriter - override fun closeWriter() {} - - override val annotationFilterList = listOf() - } -} diff --git a/plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AnnotationProcessorBoxTestGenerated.java b/plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AnnotationProcessorBoxTestGenerated.java deleted file mode 100644 index 6094b2f9dc8..00000000000 --- a/plugins/annotation-collector/test/org/jetbrains/kotlin/annotation/AnnotationProcessorBoxTestGenerated.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. 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.annotation; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.TargetBackend; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("plugins/annotation-collector/testData/collectToFile") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class AnnotationProcessorBoxTestGenerated extends AbstractAnnotationProcessorBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); - } - - public void testAllFilesPresentInCollectToFile() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/annotation-collector/testData/collectToFile"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false); - } - - @TestMetadata("annotatedGettersSetters") - public void testAnnotatedGettersSetters() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/"); - } - - @TestMetadata("annotationInSameFile") - public void testAnnotationInSameFile() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/annotationInSameFile/"); - } - - @TestMetadata("anonymousClasses") - public void testAnonymousClasses() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/anonymousClasses/"); - } - - @TestMetadata("classAnnotations") - public void testClassAnnotations() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/classAnnotations/"); - } - - @TestMetadata("constructors") - public void testConstructors() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/constructors/"); - } - - @TestMetadata("defaultPackage") - public void testDefaultPackage() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/defaultPackage/"); - } - - @TestMetadata("fieldAnnotations") - public void testFieldAnnotations() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/fieldAnnotations/"); - } - - @TestMetadata("inheritedComplex") - public void testInheritedComplex() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/inheritedComplex/"); - } - - @TestMetadata("inheritedSimple") - public void testInheritedSimple() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/inheritedSimple/"); - } - - @TestMetadata("inheritedTopLevel") - public void testInheritedTopLevel() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/"); - } - - @TestMetadata("localClasses") - public void testLocalClasses() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/localClasses/"); - } - - @TestMetadata("localFunctions") - public void testLocalFunctions() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/localFunctions/"); - } - - @TestMetadata("methodAnnotations") - public void testMethodAnnotations() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/methodAnnotations/"); - } - - @TestMetadata("multiFileTopLevelAnnotated") - public void testMultiFileTopLevelAnnotated() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/"); - } - - @TestMetadata("nestedClasses") - public void testNestedClasses() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/nestedClasses/"); - } - - @TestMetadata("platformStatic") - public void testPlatformStatic() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/platformStatic/"); - } - - @TestMetadata("retentionPoliciesJavaAnnotations") - public void testRetentionPoliciesJavaAnnotations() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/"); - } - - @TestMetadata("retentionPoliciesJavaAnnotationsStubs") - public void testRetentionPoliciesJavaAnnotationsStubs() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/"); - } - - @TestMetadata("retentionPoliciesKotlinAnnotations") - public void testRetentionPoliciesKotlinAnnotations() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/"); - } - - @TestMetadata("retentionPoliciesKotlinAnnotationsStubs") - public void testRetentionPoliciesKotlinAnnotationsStubs() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/"); - } - - @TestMetadata("topLevelAnnotated") - public void testTopLevelAnnotated() throws Exception { - runTest("plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/"); - } -} diff --git a/plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotatedGettersSetters.kt b/plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotatedGettersSetters.kt deleted file mode 100644 index 4e8e16a2e56..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotatedGettersSetters.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.test - -public data class SomeClass(val arg: Any? = null) { - - public val immutableProperty: Int = 5 - @java.lang.Deprecated get - - public var mutableProperty: String = "String" - @java.lang.Deprecated get - @java.lang.Deprecated set - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotations.txt b/plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotations.txt deleted file mode 100644 index 98f62b39b86..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/annotatedGettersSetters/annotations.txt +++ /dev/null @@ -1,14 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -m 0 0/SomeClass getImmutableProperty -a org.jetbrains.annotations.NotNull 1 -f 1 0/SomeClass mutableProperty -m 0 0/SomeClass getMutableProperty -m 1 0/SomeClass getMutableProperty -m 0 0/SomeClass setMutableProperty -a org.jetbrains.annotations.Nullable 2 -f 2 0/SomeClass arg -m 2 0/SomeClass getArg -m 2 0/SomeClass component1 -m 1 0/SomeClass copy -m 1 0/SomeClass copy$default diff --git a/plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotationInSameFile.kt b/plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotationInSameFile.kt deleted file mode 100644 index c6f4a19b6c3..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotationInSameFile.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.test - -@Retention(AnnotationRetention.BINARY) -public annotation class SomeAnnotation - -@SomeAnnotation public class SomeClass { - - @SomeAnnotation public fun annotatedFunction() { - - } - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotations.txt b/plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotations.txt deleted file mode 100644 index a971b549dee..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/annotationInSameFile/annotations.txt +++ /dev/null @@ -1,8 +0,0 @@ -a kotlin.annotation.Retention 0 -p org.test 0 -c 0 0/SomeAnnotation -a java.lang.annotation.Retention 1 -c 1 0/SomeAnnotation -a org.test.SomeAnnotation 2 -c 2 0/SomeClass -m 2 0/SomeClass annotatedFunction diff --git a/plugins/annotation-collector/testData/collectToFile/anonymousClasses/annotations.txt b/plugins/annotation-collector/testData/collectToFile/anonymousClasses/annotations.txt deleted file mode 100644 index c5234bbf612..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/anonymousClasses/annotations.txt +++ /dev/null @@ -1,3 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -f 0 0/SomeClass$a$1 property diff --git a/plugins/annotation-collector/testData/collectToFile/anonymousClasses/anonymousClasses.kt b/plugins/annotation-collector/testData/collectToFile/anonymousClasses/anonymousClasses.kt deleted file mode 100644 index 4c98bd43f9b..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/anonymousClasses/anonymousClasses.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.test - -public class SomeClass { - - private fun a() { - object : Any() { - @java.lang.Deprecated - val property: Int = 5 - } - - } - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/classAnnotations/annotations.txt b/plugins/annotation-collector/testData/collectToFile/classAnnotations/annotations.txt deleted file mode 100644 index e0babb51f7f..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/classAnnotations/annotations.txt +++ /dev/null @@ -1,4 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -c 0 0/SomeClass -c 0 0/SomeObject diff --git a/plugins/annotation-collector/testData/collectToFile/classAnnotations/classAnnotations.kt b/plugins/annotation-collector/testData/collectToFile/classAnnotations/classAnnotations.kt deleted file mode 100644 index f1c2f9d177b..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/classAnnotations/classAnnotations.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.test - -@java.lang.Deprecated public class SomeClass - -@java.lang.Deprecated public object SomeObject \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/constructors/annotations.txt b/plugins/annotation-collector/testData/collectToFile/constructors/annotations.txt deleted file mode 100644 index 9bda17de858..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/constructors/annotations.txt +++ /dev/null @@ -1,4 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -m 0 0/SomeClass -m 0 0/SomeClass diff --git a/plugins/annotation-collector/testData/collectToFile/constructors/constructors.kt b/plugins/annotation-collector/testData/collectToFile/constructors/constructors.kt deleted file mode 100644 index e3a85ab7d44..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/constructors/constructors.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.test - -public class SomeClass { - - @java.lang.Deprecated constructor() { - - } - - @java.lang.Deprecated constructor(s: String) { - - } - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/defaultPackage/annotations.txt b/plugins/annotation-collector/testData/collectToFile/defaultPackage/annotations.txt deleted file mode 100644 index ff4eed9936a..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/defaultPackage/annotations.txt +++ /dev/null @@ -1,12 +0,0 @@ -a java.lang.Deprecated 0 -f 0 SomeClass annotatedProperty -a org.jetbrains.annotations.Nullable 1 -f 1 SomeClass annotatedProperty -m 1 SomeClass getAnnotatedProperty -m 0 SomeClass annotatedFunction -f 1 SomeClass arg -m 1 SomeClass getArg -m 1 SomeClass component1 -a org.jetbrains.annotations.NotNull 2 -m 2 SomeClass copy -m 2 SomeClass copy$default diff --git a/plugins/annotation-collector/testData/collectToFile/defaultPackage/defaultPackage.kt b/plugins/annotation-collector/testData/collectToFile/defaultPackage/defaultPackage.kt deleted file mode 100644 index 78a830a1ffc..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/defaultPackage/defaultPackage.kt +++ /dev/null @@ -1,9 +0,0 @@ -data public class SomeClass(val arg: Any? = null) { - - @java.lang.Deprecated public var annotatedProperty: String? = null - - @java.lang.Deprecated public inline fun annotatedFunction() { - - } - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/fieldAnnotations/annotations.txt b/plugins/annotation-collector/testData/collectToFile/fieldAnnotations/annotations.txt deleted file mode 100644 index f195fb9f68f..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/fieldAnnotations/annotations.txt +++ /dev/null @@ -1,7 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -f 0 0/SomeClass annotatedVal -a org.jetbrains.annotations.Nullable 1 -f 1 0/SomeClass annotatedVal -m 1 0/SomeClass getAnnotatedVal -f 0 0/SomeClass annotatedVar diff --git a/plugins/annotation-collector/testData/collectToFile/fieldAnnotations/fieldAnnotations.kt b/plugins/annotation-collector/testData/collectToFile/fieldAnnotations/fieldAnnotations.kt deleted file mode 100644 index 44e2419ab8c..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/fieldAnnotations/fieldAnnotations.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.test - -public class SomeClass { - - @java.lang.Deprecated - public val annotatedVal: String? = null - - @java.lang.Deprecated - public var annotatedVar: Int = 5 - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/inheritedComplex/annotations.txt b/plugins/annotation-collector/testData/collectToFile/inheritedComplex/annotations.txt deleted file mode 100644 index 20de30e0dcb..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/inheritedComplex/annotations.txt +++ /dev/null @@ -1,18 +0,0 @@ -p org.test 0 -d 0/Ann1 -a java.lang.annotation.Inherited 0 -c 0 0/Ann1 -a java.lang.annotation.Retention 1 -c 1 0/Ann1 -d 0/Ann2 -c 0 0/Ann2 -c 1 0/Ann2 -d 0/D -d 0/C -d 0/B -a org.test.Ann2 2 -c 2 0/B -d 0/A -a org.test.Ann1 3 -c 3 0/A -d 0/A$DefaultImpls diff --git a/plugins/annotation-collector/testData/collectToFile/inheritedComplex/inheritedComplex.kt b/plugins/annotation-collector/testData/collectToFile/inheritedComplex/inheritedComplex.kt deleted file mode 100644 index 087139a9c68..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/inheritedComplex/inheritedComplex.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.test - -import java.lang.annotation.Inherited - -@Inherited -annotation class Ann1 - -@Inherited -annotation class Ann2 - -@Ann1 -interface A - -@Ann2 -open class B : A - -open class C : B() - -class D : C() \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/inheritedSimple/annotations.txt b/plugins/annotation-collector/testData/collectToFile/inheritedSimple/annotations.txt deleted file mode 100644 index 1e5f33cf8ea..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/inheritedSimple/annotations.txt +++ /dev/null @@ -1,11 +0,0 @@ -p org.test 0 -d 0/Ann -a java.lang.annotation.Inherited 0 -c 0 0/Ann -a java.lang.annotation.Retention 1 -c 1 0/Ann -d 0/B -d 0/A -a org.test.Ann 2 -c 2 0/A -d 0/A$DefaultImpls diff --git a/plugins/annotation-collector/testData/collectToFile/inheritedSimple/inheritedSimple.kt b/plugins/annotation-collector/testData/collectToFile/inheritedSimple/inheritedSimple.kt deleted file mode 100644 index 0d28deac85a..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/inheritedSimple/inheritedSimple.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.test - -import java.lang.annotation.Inherited - -@Inherited -annotation class Ann - -@Ann -interface A - -class B : A \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/annotations.txt b/plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/annotations.txt deleted file mode 100644 index 1f43cf9ea09..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/annotations.txt +++ /dev/null @@ -1,4 +0,0 @@ -p org.test 0 -d 0/InheritedTopLevelKt -a org.jetbrains.annotations.NotNull 0 -m 0 0/InheritedTopLevelKt getTopLevelProperty diff --git a/plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/inheritedTopLevel.kt b/plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/inheritedTopLevel.kt deleted file mode 100644 index 56923d97754..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/inheritedTopLevel/inheritedTopLevel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.test - -fun topLevelFunction() { - -} - -val topLevelProperty: String - get() = "text" \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/localClasses/annotations.txt b/plugins/annotation-collector/testData/collectToFile/localClasses/annotations.txt deleted file mode 100644 index c916765a87b..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/localClasses/annotations.txt +++ /dev/null @@ -1,7 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -c 0 0/SomeClass$someFunction$LocalClass -f 0 0/SomeClass$someFunction$LocalClass annotatedProperty -a org.jetbrains.annotations.Nullable 1 -f 1 0/SomeClass$someFunction$LocalClass annotatedProperty -m 1 0/SomeClass$someFunction$LocalClass getAnnotatedProperty diff --git a/plugins/annotation-collector/testData/collectToFile/localClasses/localClasses.kt b/plugins/annotation-collector/testData/collectToFile/localClasses/localClasses.kt deleted file mode 100644 index afe3277b6d2..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/localClasses/localClasses.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.test - -public class SomeClass { - - public fun someFunction() { - @java.lang.Deprecated class LocalClass { - - public @java.lang.Deprecated var annotatedProperty: String? = null - - public inline fun annotatedFunction() { - - } - - } - } - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/localFunctions/annotations.txt b/plugins/annotation-collector/testData/collectToFile/localFunctions/annotations.txt deleted file mode 100644 index 4fff5a30d91..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/localFunctions/annotations.txt +++ /dev/null @@ -1,4 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -m 0 0/Class$method$1 invoke -m 0 0/LocalFunctionsKt$function$1 invoke diff --git a/plugins/annotation-collector/testData/collectToFile/localFunctions/localFunctions.kt b/plugins/annotation-collector/testData/collectToFile/localFunctions/localFunctions.kt deleted file mode 100644 index b5712d2e872..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/localFunctions/localFunctions.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.test - -class Class { - fun method() { - @java.lang.Deprecated fun localFunctionInsideMethod() {} - } -} - -fun function() { - @java.lang.Deprecated fun localFunctionInsideFunction() {} -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/methodAnnotations/annotations.txt b/plugins/annotation-collector/testData/collectToFile/methodAnnotations/annotations.txt deleted file mode 100644 index a7322269e02..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/methodAnnotations/annotations.txt +++ /dev/null @@ -1,8 +0,0 @@ -a java.lang.annotation.Retention 0 -p org.test 0 -c 0 0/Ann -a org.test.Ann 1 -m 1 0/Child overridenWithAnnotation -m 1 0/Child childMethod -m 1 0/Parent overridenWithoutAnnotation -m 1 0/Parent notOverriden diff --git a/plugins/annotation-collector/testData/collectToFile/methodAnnotations/methodAnnotations.kt b/plugins/annotation-collector/testData/collectToFile/methodAnnotations/methodAnnotations.kt deleted file mode 100644 index b5d33f19d52..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/methodAnnotations/methodAnnotations.kt +++ /dev/null @@ -1,25 +0,0 @@ -package org.test - -annotation class Ann - -open class Parent { - @Ann - open fun overridenWithoutAnnotation() {} - - open fun overridenWithAnnotation() {} - - @Ann - fun notOverriden() {} - - open fun notAnnotated() {} -} - -class Child : Parent() { - override fun overridenWithoutAnnotation() {} - - @Ann - override fun overridenWithAnnotation() {} - - @Ann - fun childMethod() {} -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/Ann.kt b/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/Ann.kt deleted file mode 100644 index 9ffea1300a4..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/Ann.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.test - -annotation class Ann \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/annotations.txt b/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/annotations.txt deleted file mode 100644 index 5b751309340..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/annotations.txt +++ /dev/null @@ -1,10 +0,0 @@ -a org.test.Ann 0 -p org.test 0 -m 0 0/TestFacade__PartAKt funA -m 0 0/TestFacade__PartAKt valA$annotations -m 0 0/TestFacade__PartBKt funB -m 0 0/TestFacade__PartBKt valB$annotations -m 0 0/TestFacade funA -m 0 0/TestFacade funB -a java.lang.annotation.Retention 1 -c 1 0/Ann diff --git a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partA.kt b/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partA.kt deleted file mode 100644 index 663d7df0bbd..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partA.kt +++ /dev/null @@ -1,10 +0,0 @@ -@file:JvmMultifileClass -@file:JvmName("TestFacade") - -package org.test - -@Ann -fun funA() {} - -@Ann -val valA = 4 \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partB.kt b/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partB.kt deleted file mode 100644 index adfb2728d1a..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/partB.kt +++ /dev/null @@ -1,10 +0,0 @@ -@file:JvmMultifileClass -@file:JvmName("TestFacade") - -package org.test - -@Ann -fun funB() {} - -@Ann -val valB = 4 \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/nestedClasses/annotations.txt b/plugins/annotation-collector/testData/collectToFile/nestedClasses/annotations.txt deleted file mode 100644 index 209096dc952..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/nestedClasses/annotations.txt +++ /dev/null @@ -1,7 +0,0 @@ -a java.lang.Deprecated 0 -p org.test 0 -c 0 0/SomeClass$SomeInnerObject -c 0 0/SomeClass$InnerClass -c 0 0/SomeClass$InnerClass$InnerClassInInnerClass -c 0 0/SomeClass$NestedClass -c 0 0/SomeClass$Companion diff --git a/plugins/annotation-collector/testData/collectToFile/nestedClasses/nestedClasses.kt b/plugins/annotation-collector/testData/collectToFile/nestedClasses/nestedClasses.kt deleted file mode 100644 index b589bbcdd2a..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/nestedClasses/nestedClasses.kt +++ /dev/null @@ -1,30 +0,0 @@ -package org.test - -public class SomeClass { - - @java.lang.Deprecated - companion object { - - } - - @java.lang.Deprecated - object SomeInnerObject { - - } - - @java.lang.Deprecated - inner class InnerClass { - - @java.lang.Deprecated - inner class InnerClassInInnerClass { - - } - - } - - @java.lang.Deprecated - class NestedClass { - - } - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/platformStatic/annotations.txt b/plugins/annotation-collector/testData/collectToFile/platformStatic/annotations.txt deleted file mode 100644 index c9029b62969..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/platformStatic/annotations.txt +++ /dev/null @@ -1,4 +0,0 @@ -a kotlin.jvm.JvmStatic 0 -p org.test 0 -m 0 0/SomeClass$Companion a -m 0 0/SomeClass a diff --git a/plugins/annotation-collector/testData/collectToFile/platformStatic/platformStatic.kt b/plugins/annotation-collector/testData/collectToFile/platformStatic/platformStatic.kt deleted file mode 100644 index 2599b247fa9..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/platformStatic/platformStatic.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.test - -public class SomeClass { - - companion object { - @JvmStatic inline fun a() { - - } - } - -} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/ClassAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/ClassAnnotation.java deleted file mode 100644 index aaab6a104de..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/ClassAnnotation.java +++ /dev/null @@ -1,4 +0,0 @@ -import java.lang.annotation.*; - -@Retention(RetentionPolicy.CLASS) -public @interface ClassAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/DefaultAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/DefaultAnnotation.java deleted file mode 100644 index c9fc253c40c..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/DefaultAnnotation.java +++ /dev/null @@ -1,3 +0,0 @@ -import java.lang.annotation.*; - -public @interface DefaultAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/RuntimeAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/RuntimeAnnotation.java deleted file mode 100644 index a9517bb6595..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/RuntimeAnnotation.java +++ /dev/null @@ -1,4 +0,0 @@ -import java.lang.annotation.*; - -@Retention(RetentionPolicy.RUNTIME) -public @interface RuntimeAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/SourceAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/SourceAnnotation.java deleted file mode 100644 index 3eda34e1bf8..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/SourceAnnotation.java +++ /dev/null @@ -1,4 +0,0 @@ -import java.lang.annotation.*; - -@Retention(RetentionPolicy.SOURCE) -public @interface SourceAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/annotations.txt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/annotations.txt deleted file mode 100644 index 3cd21147b3f..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/annotations.txt +++ /dev/null @@ -1,6 +0,0 @@ -a DefaultAnnotation 0 -c 0 DafaultUsage -a ClassAnnotation 1 -c 1 ClassUsage -a RuntimeAnnotation 2 -c 2 RuntimeUsage diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/usage.kt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/usage.kt deleted file mode 100644 index 120111d2ad1..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotations/usage.kt +++ /dev/null @@ -1,11 +0,0 @@ -@DefaultAnnotation -class DafaultUsage - -@SourceAnnotation -class SourceUsage - -@ClassAnnotation -class ClassUsage - -@RuntimeAnnotation -class RuntimeUsage \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/ClassAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/ClassAnnotation.java deleted file mode 100644 index aaab6a104de..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/ClassAnnotation.java +++ /dev/null @@ -1,4 +0,0 @@ -import java.lang.annotation.*; - -@Retention(RetentionPolicy.CLASS) -public @interface ClassAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/DefaultAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/DefaultAnnotation.java deleted file mode 100644 index c9fc253c40c..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/DefaultAnnotation.java +++ /dev/null @@ -1,3 +0,0 @@ -import java.lang.annotation.*; - -public @interface DefaultAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/RuntimeAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/RuntimeAnnotation.java deleted file mode 100644 index a9517bb6595..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/RuntimeAnnotation.java +++ /dev/null @@ -1,4 +0,0 @@ -import java.lang.annotation.*; - -@Retention(RetentionPolicy.RUNTIME) -public @interface RuntimeAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/SourceAnnotation.java b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/SourceAnnotation.java deleted file mode 100644 index 3eda34e1bf8..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/SourceAnnotation.java +++ /dev/null @@ -1,4 +0,0 @@ -import java.lang.annotation.*; - -@Retention(RetentionPolicy.SOURCE) -public @interface SourceAnnotation {} \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/annotations.txt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/annotations.txt deleted file mode 100644 index cdae8dd108c..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/annotations.txt +++ /dev/null @@ -1,8 +0,0 @@ -a DefaultAnnotation 0 -c 0 DafaultUsage -a SourceAnnotation 1 -c 1 SourceUsage -a ClassAnnotation 2 -c 2 ClassUsage -a RuntimeAnnotation 3 -c 3 RuntimeUsage diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/usage.kt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/usage.kt deleted file mode 100644 index 120111d2ad1..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesJavaAnnotationsStubs/usage.kt +++ /dev/null @@ -1,11 +0,0 @@ -@DefaultAnnotation -class DafaultUsage - -@SourceAnnotation -class SourceUsage - -@ClassAnnotation -class ClassUsage - -@RuntimeAnnotation -class RuntimeUsage \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.kt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.kt deleted file mode 100644 index dc13bd93bf0..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.kt +++ /dev/null @@ -1,10 +0,0 @@ -annotation class DefaultAnnotation - -@Retention(AnnotationRetention.SOURCE) -annotation class SourceAnnotation - -@Retention(AnnotationRetention.BINARY) -annotation class BinaryAnnotation - -@Retention(AnnotationRetention.RUNTIME) -annotation class RuntimeAnnotation \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.txt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.txt deleted file mode 100644 index 02485909272..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/annotations.txt +++ /dev/null @@ -1,15 +0,0 @@ -a java.lang.annotation.Retention 0 -c 0 DefaultAnnotation -a kotlin.annotation.Retention 1 -c 1 SourceAnnotation -c 0 SourceAnnotation -c 1 BinaryAnnotation -c 0 BinaryAnnotation -c 1 RuntimeAnnotation -c 0 RuntimeAnnotation -a DefaultAnnotation 2 -c 2 DafaultUsage -a BinaryAnnotation 3 -c 3 BinaryUsage -a RuntimeAnnotation 4 -c 4 RuntimeUsage diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/usage.kt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/usage.kt deleted file mode 100644 index 57070658078..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotations/usage.kt +++ /dev/null @@ -1,11 +0,0 @@ -@DefaultAnnotation -class DafaultUsage - -@SourceAnnotation -class SourceUsage - -@BinaryAnnotation -class BinaryUsage - -@RuntimeAnnotation -class RuntimeUsage \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.kt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.kt deleted file mode 100644 index dc13bd93bf0..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.kt +++ /dev/null @@ -1,10 +0,0 @@ -annotation class DefaultAnnotation - -@Retention(AnnotationRetention.SOURCE) -annotation class SourceAnnotation - -@Retention(AnnotationRetention.BINARY) -annotation class BinaryAnnotation - -@Retention(AnnotationRetention.RUNTIME) -annotation class RuntimeAnnotation \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.txt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.txt deleted file mode 100644 index 8424f404d9b..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/annotations.txt +++ /dev/null @@ -1,17 +0,0 @@ -a java.lang.annotation.Retention 0 -c 0 DefaultAnnotation -a kotlin.annotation.Retention 1 -c 1 SourceAnnotation -c 0 SourceAnnotation -c 1 BinaryAnnotation -c 0 BinaryAnnotation -c 1 RuntimeAnnotation -c 0 RuntimeAnnotation -a DefaultAnnotation 2 -c 2 DafaultUsage -a SourceAnnotation 3 -c 3 SourceUsage -a BinaryAnnotation 4 -c 4 BinaryUsage -a RuntimeAnnotation 5 -c 5 RuntimeUsage diff --git a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/usage.kt b/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/usage.kt deleted file mode 100644 index 57070658078..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/retentionPoliciesKotlinAnnotationsStubs/usage.kt +++ /dev/null @@ -1,11 +0,0 @@ -@DefaultAnnotation -class DafaultUsage - -@SourceAnnotation -class SourceUsage - -@BinaryAnnotation -class BinaryUsage - -@RuntimeAnnotation -class RuntimeUsage \ No newline at end of file diff --git a/plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/annotations.txt b/plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/annotations.txt deleted file mode 100644 index 6fdc9dc8866..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/annotations.txt +++ /dev/null @@ -1,6 +0,0 @@ -a java.lang.annotation.Retention 0 -p org.test 0 -c 0 0/Ann -a org.test.Ann 1 -m 1 0/TopLevelAnnotatedKt someAnnotatedFunction -m 1 0/TopLevelAnnotatedKt someAnnotatedValue$annotations diff --git a/plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/topLevelAnnotated.kt b/plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/topLevelAnnotated.kt deleted file mode 100644 index 3b3bb012338..00000000000 --- a/plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/topLevelAnnotated.kt +++ /dev/null @@ -1,9 +0,0 @@ -package org.test - -annotation class Ann - -@Ann -fun someAnnotatedFunction() {} - -@Ann -val someAnnotatedValue = 4 \ No newline at end of file