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
@@ -1,4 +1,6 @@
@Deprecated("")
annotation class Anno
@Anno
class MyClass {
var myProperty: String = "A"
@@ -1,6 +1,8 @@
package test
@Deprecated("")
annotation class Anno
@Anno
class MyClass
interface MyInterface
@@ -1,3 +1,6 @@
annotation class Anno
@Anno
@Deprecated("")
class Depr
@@ -1,3 +1,6 @@
annotation class Anno
@Anno
class A {
interface AA {
fun onClick(o: Any)
@@ -1,4 +1,6 @@
@Deprecated("")
annotation class Anno
@Anno
open class Parent {
open fun a() {}
}
@@ -1,4 +1,6 @@
@Deprecated("")
annotation class Anno
@Anno
interface Intf {
fun a()
}
@@ -0,0 +1,22 @@
// Test
class Test {
@kotlin.jvm.Transient
val f: String = ""
// explicitly
@org.jetbrains.annotations.NotNull
fun a() {}
@kotlin.jvm.Synchronized
fun b() {}
@kotlin.jvm.JvmOverloads
fun c(a: Int = 3, b: String = "") {}
@java.lang.Deprecated
fun d() {}
@kotlin.Deprecated("")
fun e() {}
}
@@ -0,0 +1,31 @@
public final class Test {
@kotlin.jvm.Transient
@org.jetbrains.annotations.NotNull
private final transient java.lang.String f
@org.jetbrains.annotations.NotNull
public final java.lang.String getF()
@org.jetbrains.annotations.NotNull
public final void a()
@kotlin.jvm.Synchronized
public final synchronized void b()
@kotlin.jvm.JvmOverloads
public final void c(int a, java.lang.String b)
@kotlin.jvm.JvmOverloads
public void c(int a)
@kotlin.jvm.JvmOverloads
public void c()
@java.lang.Deprecated
public final void d()
@kotlin.Deprecated(message = "")
public final void e()
public void <init>()
}
@@ -2,7 +2,9 @@ abstract class Base<A> {
fun baseF(): A = null!!
}
@Deprecated("")
annotation class Anno
@Anno
class Test<T> : Base<Int>() {
fun a(): String = ""
fun b(i: String, b: CharSequence) {}
@@ -1,4 +1,6 @@
@Deprecated("")
annotation class Anno
@Anno
class Test {
fun a(): Int = 5
fun b(): Unit {}
@@ -0,0 +1,25 @@
annotation class Anno
@Anno
class AnnoAnnotated
class Test {
@kotlin.jvm.Transient
val f: String = ""
// explicitly
@org.jetbrains.annotations.NotNull
fun a() {}
@kotlin.jvm.Synchronized
fun b() {}
@kotlin.jvm.JvmOverloads
fun c(a: Int = 3, b: String = "") {}
@java.lang.Deprecated
fun d() {}
@kotlin.Deprecated("")
fun e() {}
}
@@ -1,4 +1,6 @@
@Deprecated("")
annotation class Anno
@Anno
class A : B<Int>(), C<Int>
open class B<T>
@@ -2,7 +2,9 @@ interface I<T>
abstract class A<T> : I<T>
@Deprecated("")
annotation class Anno
@Anno
class B : A<String>()
class C<T : CharSequence> : A<T>()