refactor: use include annotation parameter instead of excludeByDefault

This commit is contained in:
oSumAtrIX 2022-06-11 19:14:19 +02:00
parent 81895c7d5c
commit 2dcbd8d079
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,7 @@ object PatchExtensions {
val Class<out Patch<Data>>.patchName: String
get() = recursiveAnnotation(Name::class)?.name ?: this.javaClass.simpleName
val Class<out Patch<Data>>.version get() = recursiveAnnotation(Version::class)?.version
val Class<out Patch<Data>>.excludeByDefault get() = recursiveAnnotation(app.revanced.patcher.patch.annotations.Patch::class)!!.excludeByDefault
val Class<out Patch<Data>>.include get() = recursiveAnnotation(app.revanced.patcher.patch.annotations.Patch::class)!!.include
val Class<out Patch<Data>>.description get() = recursiveAnnotation(Description::class)?.description
val Class<out Patch<Data>>.dependencies get() = recursiveAnnotation(app.revanced.patcher.patch.annotations.Dependencies::class)?.dependencies
val Class<out Patch<Data>>.compatiblePackages get() = recursiveAnnotation(Compatibility::class)?.compatiblePackages

View File

@ -6,11 +6,12 @@ import kotlin.reflect.KClass
/**
* Annotation to mark a Class as a patch.
* @param include If false, the patch should be treated as optional by default.
*/
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
annotation class Patch(val excludeByDefault: Boolean = false)
annotation class Patch(val include: Boolean = true)
/**
* Annotation for dependencies of [Patch]es .