build: Publish on Jitpack

This commit is contained in:
oSumAtrIX 2023-10-09 05:10:01 +02:00
parent 35e23a9ad7
commit c68c74f7d4
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
4 changed files with 6 additions and 37 deletions

View File

@ -1,5 +0,0 @@
jdk:
- openjdk9
install:
- echo "This is not supported. See iBotPeaches/Apktool#2102"
- ./gradlew invalid-command-to-crash-out

View File

@ -1,20 +1,6 @@
val gitRevision: String by rootProject.extra val gitRevision: String by rootProject.extra
val apktoolVersion: String by rootProject.extra val apktoolVersion: String by rootProject.extra
// region Determine Android SDK location
val sdkRoot: String? = System.getenv("ANDROID_SDK_ROOT")
val androidJarPath: String = if (sdkRoot == null) {
GradleException("Missing ANDROID_SDK_ROOT").printStackTrace()
"com.google.android:android:4.1.1.4"
} else {
val androidVersion = 33
File("$sdkRoot/platforms/android-$androidVersion/android.jar").path
}
// endregion
tasks { tasks {
processResources { processResources {
from("src/main/resources/properties") { from("src/main/resources/properties") {
@ -54,5 +40,5 @@ dependencies {
testImplementation(libs.junit) testImplementation(libs.junit)
testImplementation(libs.xmlunit) testImplementation(libs.xmlunit)
compileOnly(files(androidJarPath)) compileOnly(libs.android)
} }

View File

@ -1,7 +1,7 @@
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
val version = "2.9.1" val version = "2.9.1"
val suffix = "SNAPSHOT" val suffix = ""
// Strings embedded into the build. // Strings embedded into the build.
var gitRevision by extra("") var gitRevision by extra("")
@ -36,7 +36,7 @@ val gitBranch: String? by lazy {
} }
} }
if ("release" !in gradle.startParameter.taskNames) { if ("publishToMavenLocal" !in gradle.startParameter.taskNames) {
val hash = this.gitDescribe val hash = this.gitDescribe
if (hash == null) { if (hash == null) {
@ -84,7 +84,7 @@ subprojects {
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
val mavenProjects = arrayOf("apktool-lib", "apktool-cli", "brut.j.common", "brut.j.util", "brut.j.dir") val mavenProjects = arrayOf("apktool-lib", "brut.j.common", "brut.j.util", "brut.j.dir")
if (project.name in mavenProjects) { if (project.name in mavenProjects) {
apply(plugin = "maven-publish") apply(plugin = "maven-publish")
@ -96,15 +96,6 @@ subprojects {
} }
publishing { publishing {
repositories {
maven {
url = uri("https://maven.pkg.github.com/revanced/Apktool")
credentials {
username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("gpr.user").toString()
password = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.key").toString()
}
}
}
publications { publications {
register("mavenJava", MavenPublication::class) { register("mavenJava", MavenPublication::class) {
from(components["java"]) from(components["java"])
@ -148,11 +139,6 @@ subprojects {
tasks.withType<Javadoc>() { tasks.withType<Javadoc>() {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
} }
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}
} }
} }

View File

@ -11,6 +11,7 @@ shadow = "8.1.1"
smali = "3.0.3" smali = "3.0.3"
xmlpull = "1.1.4c" xmlpull = "1.1.4c"
xmlunit = "2.9.1" xmlunit = "2.9.1"
android = "4.1.1.4"
[libraries] [libraries]
baksmali = { module = "com.android.tools.smali:smali-baksmali", version.ref = "baksmali" } baksmali = { module = "com.android.tools.smali:smali-baksmali", version.ref = "baksmali" }
@ -24,6 +25,7 @@ proguard = { module = "com.guardsquare:proguard-gradle", version.ref = "proguard
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" } smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
xmlpull = { module = "xpp3:xpp3", version.ref = "xmlpull" } xmlpull = { module = "xpp3:xpp3", version.ref = "xmlpull" }
xmlunit = { module = "org.xmlunit:xmlunit-legacy", version.ref = "xmlunit" } xmlunit = { module = "org.xmlunit:xmlunit-legacy", version.ref = "xmlunit" }
android = { module = "com.google.android:android", version.ref = "android" }
[plugins] [plugins]
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" } shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }