Skip to content

This tool checks whether everything annotated with a specific Kotlin annotation is also annotated with another annotation.

License

Notifications You must be signed in to change notification settings

danthe1st/annotation-combination-checker

Repository files navigation

Annotation combination checker

Release

This tool checks whether everything annotated with a specific Kotlin annotation is also annotated with another annotation.

annotation-combination-checker

How to use

  • Add the following to the repositories section of your build.gradle.kts:
    maven {
        url = uri("https://jitpack.io")
    }
    Alternatively, you could use mavenLocal() and build Annotation combination checker yourself using ./gradlew build
  • add the following to the plugins section of your build.gradle.kts:
    id("com.google.devtools.ksp") version "1.7.0-RC-1.0.5"
  • add the following to the dependencies section of your build.gradle.kts:
    ksp("io.github.danthe1st:annotation-combination-checker:1.0-SNAPSHOT")
    If JitPack is used, the group id is com.github.danthe1st instead of io.github.danthe1st.
  • add the following to your build.gradle.kts:
    tasks{
        ksp{
            arg("com.yourpackage.RequiringAnnotation",
                    "com.yourpackage.RequiredAnnotationA;" +
                    "com.yourpackage.RequiredAnnotationB;" +
                    "com.yourpackage.RequiredAnnotationC")
        }
    }
    This configures Annotation combination checker to raise an error for every class annotated with @RequiringAnnotation but missing at least one of @RequiredAnnotationA, @RequiredAnnotationB, or @RequiredAnnotationC.

Limitiations

  • 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")
    }

About

This tool checks whether everything annotated with a specific Kotlin annotation is also annotated with another annotation.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages