atteo / classindex

Index classes, do not scan them!
Apache License 2.0
263 stars 42 forks source link

`ClassIndex.getAnnotated()` return nothing, but classes with annotation exist. #60

Closed MairwunNx closed 4 years ago

MairwunNx commented 4 years ago

For example, this code return empty collection for iterating: (for each iterate for zero elements)

ClassIndex.getAnnotated(Configuration::class.java).forEach {
    // ...
}

My configuration annotation:

image

build.gradle:

internal "org.atteo.classindex:classindex:$class_index_version"
annotationProcessor "org.atteo.classindex:classindex:$class_index_version"

note: internal is implementation but also for including library in jar.

In META-INF/services files:

image

Latest library version, JDK 1.8, Kotlin 1.3.71. Used with Minecraft Forge API. Gradle 5.X.X (latest of 5).

MairwunNx commented 4 years ago

I also enabled annotation processing in IDEA settings.

image

MairwunNx commented 4 years ago

Not work with kotlin. If you use kotlin you need https://github.com/matfax/klassindex. (fork of this repo). Closed.