Kapt: load all annotations, even if annotation processors does not require it explicitly. Some annotation processors may want to process some more annotations (see DbFlow, Database annotation).

Blacklist some common-used Java and Kotlin annotations instead (like Deprecated, Nullable or Metadata).
(cherry picked from commit 6856a7c)
This commit is contained in:
Yan Zhulanow
2016-09-02 22:53:25 +03:00
committed by Yan Zhulanow
parent 975364b2ed
commit c6c1673902
18 changed files with 132 additions and 18 deletions
@@ -127,7 +127,7 @@ class ElementsTests : AbstractProcessorTest() {
assertEquals(packageElement, testPackageElement)
assertFalse(packageElement.isUnnamed)
val classes = packageElement.enclosedElements.filterIsInstance<JeTypeElement>()
assertEquals(2, classes.size)
assertEquals(3, classes.size)
}
fun testGetArrayType() = test("GetPackageOf", "*") { set, roundEnv, env ->
@@ -190,7 +190,11 @@ class ProcessorTests : AbstractProcessorTest() {
fun testIncrementalDataSimple() = incrementalDataTest(
"IncrementalDataSimple",
"i Intf, i Test, i Test2, i Test3, i Test8")
"i Intf, i Test, i Test2, i Test3, i Test6, i Test7, i Test8")
fun testIncrementalDataKotlinAnnotations() = incrementalDataTest(
"KotlinAnnotations",
"i AnnoAnnotated")
private fun getKapt2Extension() = AnalysisCompletedHandlerExtension.getInstances(myEnvironment.project)
.firstIsInstance<AnnotationProcessingExtensionForTests>()
@@ -47,6 +47,12 @@ public class KotlinModelWrappersTestGenerated extends AbstractKotlinModelWrapper
doTest(fileName);
}
@TestMetadata("kotlinAnnotations.kt")
public void testKotlinAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/kotlinAnnotations.kt");
doTest(fileName);
}
@TestMetadata("metaAnnotations.kt")
public void testMetaAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/metaAnnotations.kt");