diff --git a/interface/build.gradle.kts b/interface/build.gradle.kts index 267dc44..be52544 100644 --- a/interface/build.gradle.kts +++ b/interface/build.gradle.kts @@ -45,7 +45,7 @@ publishing { licenses { license { name.set("Apache License 2.0") - url.set("https://github.com/libxposed/api/blob/master/LICENSE") + url.set("https://github.com/libxposed/service/blob/master/LICENSE") } } developers { @@ -56,7 +56,7 @@ publishing { } scm { connection.set("scm:git:https://github.com/libxposed/service.git") - url.set("https://github.com/libxposed/api") + url.set("https://github.com/libxposed/service") } } afterEvaluate { diff --git a/service/build.gradle.kts b/service/build.gradle.kts index 7a71661..d1ee9a2 100644 --- a/service/build.gradle.kts +++ b/service/build.gradle.kts @@ -1,5 +1,7 @@ plugins { id("com.android.library") + id("maven-publish") + id("signing") } android { @@ -28,6 +30,13 @@ android { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } + + publishing { + singleVariant("release") { + withSourcesJar() + withJavadocJar() + } + } } dependencies { @@ -35,3 +44,61 @@ dependencies { compileOnly("androidx.annotation:annotation:1.5.0") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.2.2") } + +publishing { + publications { + register("service") { + artifactId = "service" + group = "io.github.libxposed" + version = "100" + pom { + name.set("service") + description.set("Modern Xposed Service Interface") + url.set("https://github.com/libxposed/service") + licenses { + license { + name.set("Apache License 2.0") + url.set("https://github.com/libxposed/service/blob/master/LICENSE") + } + } + developers { + developer { + name.set("libxposed") + url.set("https://libxposed.github.io") + } + } + scm { + connection.set("scm:git:https://github.com/libxposed/service.git") + url.set("https://github.com/libxposed/service") + } + } + afterEvaluate { + from(components.getByName("release")) + } + } + } + repositories { + maven { + name = "ossrh" + url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials(PasswordCredentials::class) + } + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/libxposed/service") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} + +signing { + val signingKey = findProperty("signingKey") as String? + val signingPassword = findProperty("signingPassword") as String? + if (signingKey != null && signingPassword != null) { + useInMemoryPgpKeys(signingKey, signingPassword) + } + sign(publishing.publications) +}