build: Publish artifacts on Jitpack

This commit is contained in:
oSumAtrIX 2023-08-27 04:47:07 +02:00
parent 38ef2f470a
commit cb5e39d73e
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
7 changed files with 47 additions and 91 deletions

0
api/revanced-patcher.api Normal file
View File

View File

@ -1,10 +1,46 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
plugins { plugins {
kotlin("jvm") version "1.9.0" apply false kotlin("jvm") version "1.9.0"
alias(libs.plugins.binary.compatibility.validator) alias(libs.plugins.binary.compatibility.validator)
`maven-publish`
signing
java
} }
allprojects { val publicationVersion = project.version.toString()
subprojects {
apply(plugin = "maven-publish") apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "java")
apply(plugin ="kotlin")
group = "app.revanced" group = "app.revanced"
version = publicationVersion
repositories {
mavenCentral()
mavenLocal()
maven { url = uri("https://jitpack.io") }
google()
}
java {
withJavadocJar()
withSourcesJar()
}
configure<KotlinJvmProjectExtension> {
kotlin { jvmToolchain(11) }
}
tasks {
test {
useJUnitPlatform()
testLogging {
events("PASSED", "SKIPPED", "FAILED")
}
}
}
} }

View File

@ -1,12 +1,12 @@
[versions] [versions]
android = "4.1.1.4" android = "4.1.1.4"
kotlin-reflect = "1.9.0" kotlin-reflect = "1.9.0"
apktool-lib = "2.8.2-6" apktool-lib = "2.9.1"
kotlin-test = "1.8.20-RC" kotlin-test = "1.8.20-RC"
kotlinx-coroutines-core = "1.7.1" kotlinx-coroutines-core = "1.7.3"
multidexlib2 = "3.0.3.r2" multidexlib2 = "3.0.3.r3"
smali = "3.0.3" smali = "3.0.3"
symbol-processing-api = "1.9.0-1.0.11" symbol-processing-api = "1.9.10-1.0.13"
xpp3 = "1.1.4c" xpp3 = "1.1.4c"
binary-compatibility-validator = "0.13.2" binary-compatibility-validator = "0.13.2"
kotlin-compile-testing-ksp = "1.5.0" kotlin-compile-testing-ksp = "1.5.0"
@ -16,7 +16,7 @@ ksp = "1.9.0-1.0.11"
[libraries] [libraries]
android = { module = "com.google.android:android", version.ref = "android" } android = { module = "com.google.android:android", version.ref = "android" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-reflect" } kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-reflect" }
apktool-lib = { module = "app.revanced:apktool-lib", version.ref = "apktool-lib" } apktool-lib = { module = "app.revanced:apktool", version.ref = "apktool-lib" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" } kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" }
multidexlib2 = { module = "app.revanced:multidexlib2", version.ref = "multidexlib2" } multidexlib2 = { module = "app.revanced:multidexlib2", version.ref = "multidexlib2" }

View File

@ -1,5 +1,4 @@
plugins { plugins {
kotlin("jvm") version "1.9.0"
alias(libs.plugins.ksp) alias(libs.plugins.ksp)
} }
@ -12,39 +11,11 @@ dependencies {
testImplementation(libs.kotlin.compile.testing) testImplementation(libs.kotlin.compile.testing)
} }
tasks {
test {
useJUnitPlatform()
testLogging {
events("PASSED", "SKIPPED", "FAILED")
}
}
}
kotlin { jvmToolchain(11) }
java {
withSourcesJar()
}
publishing { publishing {
repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications { publications {
create<MavenPublication>("gpr") { create<MavenPublication>("revanced-patch-annotation-processor-publication") {
from(components["java"]) from(components["java"])
version = project.version.toString()
pom { pom {
name = "ReVanced patch annotation processor" name = "ReVanced patch annotation processor"
description = "Annotation processor for patches." description = "Annotation processor for patches."

View File

@ -1,7 +1,3 @@
plugins {
kotlin("jvm") version "1.9.0"
}
dependencies { dependencies {
implementation(libs.kotlinx.coroutines.core) implementation(libs.kotlinx.coroutines.core)
implementation(libs.xpp3) implementation(libs.xpp3)
@ -17,42 +13,16 @@ dependencies {
} }
tasks { tasks {
test {
useJUnitPlatform()
testLogging {
events("PASSED", "SKIPPED", "FAILED")
}
}
processResources { processResources {
expand("projectVersion" to project.version) expand("projectVersion" to project.version)
} }
} }
kotlin { jvmToolchain(11) }
java {
withSourcesJar()
}
publishing { publishing {
repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications { publications {
create<MavenPublication>("gpr") { create<MavenPublication>("revanced-patcher-publication") {
from(components["java"]) from(components["java"])
version = project.version.toString()
pom { pom {
name = "ReVanced Patcher" name = "ReVanced Patcher"
description = "Patcher used by ReVanced." description = "Patcher used by ReVanced."

View File

@ -1,22 +1 @@
val githubUsername: String = providers.gradleProperty("gpr.user").orNull ?: System.getenv("GITHUB_ACTOR")
val githubPassword: String = providers.gradleProperty("gpr.key").orNull ?: System.getenv("GITHUB_TOKEN")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
google()
mavenLocal()
listOf("multidexlib2", "apktool").forEach { repo ->
maven {
url = uri("https://maven.pkg.github.com/revanced/$repo")
credentials {
username = githubUsername
password = githubPassword
}
}
}
}
}
include("revanced-patch-annotation-processor", "revanced-patcher") include("revanced-patch-annotation-processor", "revanced-patcher")