refactor: gradle build script

This commit is contained in:
oSumAtrIX 2022-06-14 00:54:22 +02:00
parent bc92eb7fd8
commit 4c8eb0e5c7
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -1,24 +1,21 @@
plugins {
kotlin("jvm") version "1.6.21"
kotlin("jvm") version "1.7.0"
java
`maven-publish`
}
group = "app.revanced"
val githubUsername: String = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
val githubPassword: String = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/revanced/multidexlib2")
credentials {
// DO NOT set these variables in the project's gradle.properties.
// Instead, you should set them in:
// Windows: %homepath%\.gradle\gradle.properties
// Linux: ~/.gradle/gradle.properties
username =
project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR") // DO NOT CHANGE!
password =
project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") // DO NOT CHANGE!
username = githubUsername
password = githubPassword
}
}
}
@ -32,8 +29,7 @@ dependencies {
api("org.smali:smali:2.5.2")
testImplementation(kotlin("test"))
implementation(kotlin("reflect"))
}
implementation(kotlin("reflect"))}
tasks {
test {
@ -49,11 +45,8 @@ java {
withJavadocJar()
}
val isGitHubCI = System.getenv("GITHUB_ACTOR") != null
publishing {
repositories {
if (isGitHubCI) {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
@ -62,9 +55,6 @@ publishing {
password = System.getenv("GITHUB_TOKEN")
}
}
} else {
mavenLocal()
}
}
publications {
register<MavenPublication>("gpr") {