mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 02:35:40 +08:00
90 lines
2.7 KiB
Groovy
90 lines
2.7 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'org.jetbrains.kotlin.jvm'
|
|
id 'maven-publish'
|
|
id 'signing'
|
|
}
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
sourceSets.main { java.srcDir("src/api/kotlin") }
|
|
withJavadocJar()
|
|
withSourcesJar()
|
|
}
|
|
|
|
javadoc {
|
|
options.addStringOption("charset", "UTF-8")
|
|
if (JavaVersion.current().isJava9Compatible()) options.addBooleanOption('html5', true)
|
|
}
|
|
|
|
kotlin { sourceSets.main { kotlin.srcDir("src/api/kotlin") } }
|
|
|
|
dependencies {
|
|
// Used 82 API Version
|
|
compileOnly 'de.robv.android.xposed:api:82'
|
|
compileOnly fileTree(include: ['android-stub.jar'], dir: 'libs')
|
|
implementation 'androidx.annotation:annotation:1.3.0'
|
|
}
|
|
|
|
group = 'com.highcapable.yukihookapi'
|
|
version = '1.0'
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifactId = 'api'
|
|
from components.java
|
|
pom {
|
|
name = 'YukiHookAPI'
|
|
description = 'An efficient Kotlin version of the Xposed Hook API.'
|
|
url = 'https://github.com/fankes/YukiHookAPI'
|
|
licenses {
|
|
license {
|
|
name = 'MIT License'
|
|
url = 'https://github.com/fankes/YukiHookAPI/blob/master/LICENSE'
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id = '0'
|
|
name = 'fankesyooni'
|
|
email = 'qzmmcn@163.com'
|
|
}
|
|
}
|
|
scm {
|
|
connection = 'scm:git:git://github.com/path/to/repo.git'
|
|
developerConnection = 'scm:git:ssh://github.com/path/to/repo.git'
|
|
url = 'https://github.com/path/to/repo'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
name = "OSSRH"
|
|
if (project.version.toString().endsWith("-SNAPSHOT")) {
|
|
url = "https://s01.oss.sonatype.org/content/repositories/snapshots"
|
|
} else {
|
|
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
|
|
}
|
|
credentials {
|
|
username = getFileContent("OSSRH_USERNAME")
|
|
password = getFileContent("OSSRH_PASSWORD")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
signing {
|
|
sign(publishing.publications.mavenJava)
|
|
}
|
|
|
|
private static String getFileContent(String name) {
|
|
FileReader reader = new FileReader("/Users/fankes/ProjectPath/AndroidStudioProjects/YukiHookAPI/.gradle/" + name)
|
|
BufferedReader buff = new BufferedReader(reader)
|
|
String result = buff.readLine()
|
|
buff.close()
|
|
reader.close()
|
|
return result
|
|
} |