mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-29 14:14:36 +02:00
74 lines
2.0 KiB
Plaintext
74 lines
2.0 KiB
Plaintext
import org.gradle.kotlin.dsl.support.listFilesOrdered
|
|
|
|
plugins {
|
|
kotlin("jvm") version "1.9.10"
|
|
}
|
|
|
|
group = "app.revanced"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
google()
|
|
maven { url = uri("https://jitpack.io") }
|
|
// Required for FlexVer-Java
|
|
maven {
|
|
url = uri("https://repo.sleeping.town")
|
|
content {
|
|
includeGroup("com.unascribed")
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.revanced.patcher)
|
|
implementation(libs.smali)
|
|
// Used in JsonGenerator.
|
|
implementation(libs.gson)
|
|
implementation(libs.flexver)
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(11)
|
|
}
|
|
|
|
tasks {
|
|
register<DefaultTask>("generateBundle") {
|
|
description = "Generate dex files from build and bundle them in the jar file"
|
|
dependsOn(build)
|
|
|
|
doLast {
|
|
val d8 = File(System.getenv("ANDROID_HOME")).resolve("build-tools")
|
|
.listFilesOrdered().last().resolve("d8").absolutePath
|
|
|
|
val artifacts = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
|
val workingDirectory = layout.buildDirectory.dir("libs").get().asFile
|
|
|
|
exec {
|
|
workingDir = workingDirectory
|
|
commandLine = listOf(d8, artifacts)
|
|
}
|
|
|
|
exec {
|
|
workingDir = workingDirectory
|
|
commandLine = listOf("zip", "-u", artifacts, "classes.dex")
|
|
}
|
|
}
|
|
}
|
|
|
|
register<JavaExec>("generateMeta") {
|
|
description = "Generate metadata for this bundle"
|
|
dependsOn(build)
|
|
|
|
classpath = sourceSets["main"].runtimeClasspath
|
|
mainClass.set("app.revanced.meta.PatchesFileGenerator")
|
|
}
|
|
|
|
// Required to run tasks because Gradle semantic-release plugin runs the publish task.
|
|
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
|
register<DefaultTask>("publish") {
|
|
dependsOn("generateBundle")
|
|
dependsOn("generateMeta")
|
|
}
|
|
}
|