2022-03-21 16:19:51 +01:00
|
|
|
plugins {
|
2022-06-14 01:03:27 +02:00
|
|
|
kotlin("jvm") version "1.7.0"
|
2022-03-21 16:19:51 +01:00
|
|
|
}
|
|
|
|
|
2022-03-21 22:06:24 +01:00
|
|
|
group = "app.revanced"
|
2022-03-21 16:19:51 +01:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
2022-06-14 01:03:27 +02:00
|
|
|
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
|
2022-03-21 16:19:51 +01:00
|
|
|
credentials {
|
2022-06-14 01:31:37 +02:00
|
|
|
username = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
|
|
|
|
password = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
|
2022-03-21 16:19:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-06-14 01:31:37 +02:00
|
|
|
implementation(kotlin("stdlib"))
|
2022-03-21 16:19:51 +01:00
|
|
|
|
2022-06-12 01:38:54 +02:00
|
|
|
implementation("app.revanced:revanced-patcher:1.1.0")
|
2022-06-16 11:54:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
2022-06-16 12:55:13 +02:00
|
|
|
register<DefaultTask>("generateDex") {
|
2022-06-16 12:47:49 +02:00
|
|
|
description = "Generate dex files from build"
|
|
|
|
dependsOn(build)
|
|
|
|
|
2022-06-16 12:55:13 +02:00
|
|
|
doLast {
|
|
|
|
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
|
|
|
val d8 = "${androidHome}/build-tools/32.0.0/d8"
|
|
|
|
val input = build.get().outputs.files.singleFile.absolutePath
|
|
|
|
val output = input.replace(".jar", ".dex")
|
|
|
|
val work = File("${buildDir}/libs")
|
2022-06-16 12:47:49 +02:00
|
|
|
|
2022-06-16 12:55:13 +02:00
|
|
|
exec {
|
|
|
|
workingDir = work
|
|
|
|
commandLine = listOf(d8, input)
|
|
|
|
}
|
|
|
|
|
|
|
|
exec {
|
|
|
|
workingDir = work
|
|
|
|
commandLine = listOf("mv", "*.dex", output)
|
|
|
|
}
|
|
|
|
}
|
2022-06-16 12:47:49 +02:00
|
|
|
}
|
2022-06-16 11:54:39 +02:00
|
|
|
// Dummy task to fix the Gradle semantic-release plugin.
|
|
|
|
// Remove this if you forked it to support building only.
|
|
|
|
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
|
|
|
register<DefaultTask>("publish") {
|
|
|
|
group = "publish"
|
|
|
|
description = "Dummy task"
|
2022-06-16 12:47:49 +02:00
|
|
|
dependsOn(named("generateDex"))
|
2022-06-16 11:54:39 +02:00
|
|
|
}
|
2022-06-14 01:03:27 +02:00
|
|
|
}
|