revanced-patches/src/main/kotlin/app/revanced/meta/PatchesFileGenerator.kt
oSumAtrIX eeb3d80525
chore: remove ReadmeGenerator
This is not necessary anymore because the list of patches is now parsed and displayed by revanced/revanced-website
2023-07-06 20:19:10 +02:00

25 lines
834 B
Kotlin

package app.revanced.meta
import app.revanced.patcher.data.Context
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.util.patch.PatchBundle
import java.io.File
internal typealias PatchBundlePatches = List<Class<out Patch<Context>>>
internal interface PatchesFileGenerator {
fun generate(bundle: PatchBundlePatches)
private companion object {
@JvmStatic
fun main(args: Array<String>) = PatchBundle.Jar(
File("build/libs/").listFiles()!!.first {
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
}.absolutePath
).loadPatches().also {
if (it.isEmpty()) throw IllegalStateException("No patches found")
}.let { bundle ->
arrayOf(JsonGenerator()).forEach { it.generate(bundle) }
}
}
}