This tool checks whether everything annotated with a specific Kotlin annotation is also annotated with another annotation.
- Add the following to the
repositories
section of yourbuild.gradle.kts
:Alternatively, you could usemaven { url = uri("https://jitpack.io") }
mavenLocal()
and build Annotation combination checker yourself using./gradlew build
- add the following to the
plugins
section of yourbuild.gradle.kts
:id("com.google.devtools.ksp") version "1.7.0-RC-1.0.5"
- add the following to the
dependencies
section of yourbuild.gradle.kts
:If JitPack is used, the group id isksp("io.github.danthe1st:annotation-combination-checker:1.0-SNAPSHOT")
com.github.danthe1st
instead ofio.github.danthe1st
. - add the following to your
build.gradle.kts
:This configures Annotation combination checker to raise an error for every class annotated withtasks{ ksp{ arg("com.yourpackage.RequiringAnnotation", "com.yourpackage.RequiredAnnotationA;" + "com.yourpackage.RequiredAnnotationB;" + "com.yourpackage.RequiredAnnotationC") } }
@RequiringAnnotation
but missing at least one of@RequiredAnnotationA
,@RequiredAnnotationB
, or@RequiredAnnotationC
.
- Annotated properties, fields and functions are not checked
- This project is (not yet) available on Maven Central.
However, it is possible to get preview builds on Jitpack
by adding the following to the
build.gradle.kts
:maven { url = uri("https://jitpack.io") }