In AndroidX we exclude experimental APIs from our compatibility tracking. The way we do this is by ignoring anything which is annotated by an annotation which itself is annotated with RequiresOptin.
Enumerating all the nonPublicMarkers is brittle (see here) so it would bee great if we could add meta annotations which should not be tracked. e.g. do not track anything annotated with an annotation which itself is annotated with @RequiresOptin.
I took a quick look into implementing it and it seems doable for JVM, however for klibs an AbiReadingFilter doesn't seem to have access to the necessary information to do such a check. Specifically, the list of annotations on a declaration and the associated classes with their annotations.
@Target(AnnotationTarget.ANNOTATION_CLASS)
annotation class MetaHide
@MetaHide
@Target(AnnotationTarget.CLASS)
annotation class MyExperimentalApi
@MetaHide
@Target(AnnotationTarget.CLASS)
annotation class AnotherExperimentalAPi
@MyExperimentalApi
class A {} // should be hidden
@AnotherExperimentalApi
class B {} // so should this
one of the alternative solutions would be using regexes/patterns instead of explicitly listing all the annotations;
currently, BCV can only "look" inside a module to be verified; if a meta-annotated annotation is defined in some other module, BCV won't know if it requires special treatment and will silently ignore it;
proper meta-annotation support may require scanning all modules dependencies.
In AndroidX we exclude experimental APIs from our compatibility tracking. The way we do this is by ignoring anything which is annotated by an annotation which itself is annotated with
RequiresOptin
.Enumerating all the nonPublicMarkers is brittle (see here) so it would bee great if we could add meta annotations which should not be tracked. e.g. do not track anything annotated with an annotation which itself is annotated with
@RequiresOptin
.I took a quick look into implementing it and it seems doable for JVM, however for klibs an
AbiReadingFilter
doesn't seem to have access to the necessary information to do such a check. Specifically, the list of annotations on a declaration and the associated classes with their annotations.