2024-03-04 19:15:08 +01:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
|
2022-04-10 19:36:51 +02:00
|
|
|
plugins {
|
2024-02-14 05:09:42 +01:00
|
|
|
alias(libs.plugins.kotlin)
|
2023-09-23 18:15:10 +02:00
|
|
|
alias(libs.plugins.shadow)
|
2024-02-14 05:09:42 +01:00
|
|
|
application
|
|
|
|
`maven-publish`
|
|
|
|
signing
|
2022-04-10 19:36:51 +02:00
|
|
|
}
|
|
|
|
|
2023-09-23 18:15:10 +02:00
|
|
|
group = "app.revanced"
|
|
|
|
|
2024-02-14 05:09:42 +01:00
|
|
|
application {
|
|
|
|
mainClass = "app.revanced.cli.command.MainCommandKt"
|
|
|
|
}
|
|
|
|
|
2023-10-09 19:15:23 +02:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
google()
|
2024-02-14 05:09:42 +01:00
|
|
|
maven {
|
|
|
|
// A repository must be speficied for some reason. "registry" is a dummy.
|
|
|
|
url = uri("https://maven.pkg.github.com/revanced/registry")
|
|
|
|
credentials {
|
|
|
|
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
|
|
|
|
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
|
|
|
|
}
|
|
|
|
}
|
2023-10-09 19:15:23 +02:00
|
|
|
}
|
|
|
|
|
2023-09-23 18:15:10 +02:00
|
|
|
dependencies {
|
|
|
|
implementation(libs.revanced.patcher)
|
|
|
|
implementation(libs.revanced.library)
|
|
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
|
|
implementation(libs.picocli)
|
|
|
|
|
|
|
|
testImplementation(libs.kotlin.test)
|
|
|
|
}
|
|
|
|
|
2024-03-04 19:15:08 +01:00
|
|
|
kotlin {
|
|
|
|
compilerOptions {
|
|
|
|
jvmTarget.set(JvmTarget.JVM_11)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
|
|
}
|
2023-09-23 18:15:10 +02:00
|
|
|
|
|
|
|
tasks {
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
testLogging {
|
|
|
|
events("PASSED", "SKIPPED", "FAILED")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
expand("projectVersion" to project.version)
|
|
|
|
}
|
|
|
|
|
|
|
|
shadowJar {
|
|
|
|
minimize {
|
|
|
|
exclude(dependency("org.jetbrains.kotlin:.*"))
|
|
|
|
exclude(dependency("org.bouncycastle:.*"))
|
|
|
|
exclude(dependency("app.revanced:.*"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-14 05:09:42 +01:00
|
|
|
publish {
|
2023-09-23 18:15:10 +02:00
|
|
|
dependsOn(shadowJar)
|
|
|
|
}
|
2024-02-14 05:09:42 +01:00
|
|
|
}
|
2023-09-23 18:15:10 +02:00
|
|
|
|
2024-02-14 05:09:42 +01:00
|
|
|
// Needed by gradle-semantic-release-plugin.
|
|
|
|
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
2023-09-23 18:15:10 +02:00
|
|
|
|
2024-02-14 05:09:42 +01:00
|
|
|
// The maven-publish is also necessary to make the signing plugin work.
|
|
|
|
publishing {
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
}
|
2023-09-23 18:15:10 +02:00
|
|
|
|
2024-02-14 05:09:42 +01:00
|
|
|
publications {
|
|
|
|
create<MavenPublication>("revanced-cli-publication") {
|
|
|
|
from(components["java"])
|
|
|
|
}
|
2023-09-23 18:15:10 +02:00
|
|
|
}
|
|
|
|
}
|
2024-02-14 05:09:42 +01:00
|
|
|
|
|
|
|
signing {
|
|
|
|
useGpgCmd()
|
|
|
|
|
|
|
|
sign(publishing.publications["revanced-cli-publication"])
|
|
|
|
}
|