https://github.com/danthe1st/annotation-combination-checker
This tool checks whether everything annotated with a specific Kotlin annotation is also annotated with another annotation.
https://github.com/danthe1st/annotation-combination-checker
annotations kotlin kotlin-annotation-processor ksp
Last synced: 5 months ago
JSON representation
This tool checks whether everything annotated with a specific Kotlin annotation is also annotated with another annotation.
- Host: GitHub
- URL: https://github.com/danthe1st/annotation-combination-checker
- Owner: danthe1st
- License: gpl-3.0
- Created: 2022-05-22T18:03:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-23T15:17:35.000Z (over 3 years ago)
- Last Synced: 2025-02-17T09:45:08.557Z (8 months ago)
- Topics: annotations, kotlin, kotlin-annotation-processor, ksp
- Language: Kotlin
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Annotation combination checker
[](https://jitpack.io/#danthe1st/annotation-combination-checker)
This tool checks whether everything annotated with a specific Kotlin annotation
is also annotated with another annotation.
### How to use
- Add the following to the `repositories` section of your `build.gradle.kts`:
```kotlin
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`:
```kotlin
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`:
```kotlin
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`:
```kotlin
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](https://jitpack.io/#danthe1st/annotation-combination-checker)
by adding the following to the `build.gradle.kts`:
```kotlin
maven {
url = uri("https://jitpack.io")
}
```