revanced-patches-ex/src/main/kotlin/app/revanced/meta/PatchesFileGenerator.kt
inotia00 c9d716044d feat: arsclib
- I'm guessing it's based on the following branch, but I'm not sure:
https://github.com/ReVanced/revanced-patches-template/pull/1985
2024-05-09 06:05:09 +09:00

25 lines
843 B
Kotlin

package app.revanced.meta
import app.revanced.patcher.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
).toList().also {
if (it.isEmpty()) throw IllegalStateException("No patches found")
}.let { bundle ->
arrayOf(JsonGenerator(), ReadmeGenerator()).forEach { it.generate(bundle) }
}
}
}