diff --git a/api/build.gradle.kts b/api/build.gradle.kts index ea87542..2bfcf6c 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -1,5 +1,7 @@ plugins { id("com.android.library") + id("maven-publish") + id("signing") } android { @@ -19,11 +21,70 @@ android { } compileOptions { - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_7 } } +publishing { + publications { + fun MavenPublication.setup() { + group = "io.github.libxposed" + version = "100" + pom { + name.set("api") + description.set("Modern Xposed API") + url.set("https://github.com/libxposed/api") + licenses { + license { + name.set("Apache License 2.0") + url.set("https://github.com/libxposed/api/blob/master/LICENSE") + } + } + developers { + developer { + name.set("libxposed") + url.set("https://libxposed.github.io") + } + } + scm { + connection.set("scm:git:https://github.com/libxposed/api.git") + url.set("https://github.com/libxposed/api") + } + } + } + register("api") { + artifactId = "api" + setup() + } + } + 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/LSPosed/LSPlant") + 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) +} + + dependencies { compileOnly("androidx.annotation:annotation:1.5.0") } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755