mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
feat: remove unused annotation SincePatcher
BREAKING CHANGE: The annotation does not exist anymore and any use should be removed
This commit is contained in:
parent
447e1ad30e
commit
4ae9ad09d6
3 changed files with 1 additions and 26 deletions
|
@ -5,7 +5,6 @@ import app.revanced.patcher.data.impl.findIndexed
|
|||
import app.revanced.patcher.extensions.PatchExtensions.dependencies
|
||||
import app.revanced.patcher.extensions.PatchExtensions.deprecated
|
||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||
import app.revanced.patcher.extensions.PatchExtensions.sincePatcherVersion
|
||||
import app.revanced.patcher.extensions.nullOutputStream
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
import app.revanced.patcher.patch.Patch
|
||||
|
@ -213,17 +212,7 @@ class Patcher(private val options: PatcherOptions) {
|
|||
}.dependencies?.forEach { it.java.isResource() }
|
||||
}
|
||||
|
||||
data.patches.addAll(
|
||||
patches.onEach(Class<out Patch<Data>>::isResource).onEach { patch ->
|
||||
val needsVersion = patch.sincePatcherVersion
|
||||
if (needsVersion != null && needsVersion > version) {
|
||||
logger.error("Patch '${patch.patchName}' requires Patcher version $needsVersion or higher")
|
||||
logger.error("Current Patcher version is $version")
|
||||
logger.warn("Skipping '${patch.patchName}'!")
|
||||
return@onEach // TODO: continue or halt/throw?
|
||||
}
|
||||
}
|
||||
)
|
||||
data.patches.addAll(patches.onEach(Class<out Patch<Data>>::isResource))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package app.revanced.patcher.annotation
|
||||
|
||||
import app.revanced.patcher.patch.Patch
|
||||
import app.revanced.patcher.Patcher
|
||||
|
||||
/**
|
||||
* Declares a [Patch] deprecated for removal.
|
||||
* @param version The minimum version of the [Patcher] this [Patch] supports.
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
annotation class SincePatcher(val version: String)
|
|
@ -58,7 +58,6 @@ object PatchExtensions {
|
|||
if (cl == Patch::class) null else cl
|
||||
}
|
||||
}
|
||||
val Class<out Patch<Data>>.sincePatcherVersion get() = recursiveAnnotation(SincePatcher::class)?.version
|
||||
|
||||
@JvmStatic
|
||||
fun Class<out Patch<Data>>.dependsOn(patch: Class<out Patch<Data>>): Boolean {
|
||||
|
|
Loading…
Reference in a new issue