forked from bumptech/glide
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the Index annotation for KSP to annotations.
The processor will produce a Index annotated class for each LibraryGlideModule in given compilation unit. If the Index annotation is in the ksp module, it will not be accessible in parent modules, causing a compilation failure. To work around that, we'll follow the same pattern as we did for Java and place the annotation in the annotations package, but with package private visibility. Any compilation unit that uses our annotation processor must already have a dependency on annotation, so the Index annotation will be available. Fixes bumptech#4911.
- Loading branch information
Showing
6 changed files
with
136 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/Index.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
annotation/src/main/java/com/bumptech/glide/annotation/ksp/Index.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.bumptech.glide.annotation.ksp; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Used to retrieve LibraryGlideModule and GlideExtension classes in our annotation processor from | ||
* libraries and applications. | ||
* | ||
* <p>Part of the internals of Glide's annotation processor and not for public use. | ||
*/ | ||
@Target(ElementType.TYPE) | ||
// Needs to be parsed from class files in JAR. | ||
@Retention(RetentionPolicy.CLASS) | ||
@interface Index { | ||
String[] modules() default {}; | ||
} |