mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
chore: migrate build script from groovy to kts
- using SweetDependency, SweetProperty - using new maven publish function - update gradle and dependencies
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
id 'com.google.devtools.ksp'
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.addStringOption("charset", "UTF-8")
|
||||
if (JavaVersion.current().isJava9Compatible()) options.addBooleanOption('html5', true)
|
||||
}
|
||||
|
||||
kotlin { sourceSets.main { kotlin.srcDir("src/api/kotlin") } }
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
||||
kotlinOptions {
|
||||
jvmTarget = 11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.auto.service:auto-service-annotations:1.0.1'
|
||||
compileOnly 'com.google.devtools.ksp:symbol-processing-api:1.8.20-1.0.10'
|
||||
ksp 'dev.zacsweers.autoservice:auto-service-ksp:1.0.0'
|
||||
}
|
||||
|
||||
group = rootProject.ext.maven.repository.groupId
|
||||
version = rootProject.ext.maven.repository.apiVersion.name
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifactId = 'ksp-xposed'
|
||||
from components.java
|
||||
pom {
|
||||
name = rootProject.ext.maven.repository.name
|
||||
description = rootProject.ext.maven.repository.description
|
||||
url = rootProject.ext.maven.repository.website
|
||||
licenses {
|
||||
license {
|
||||
name = rootProject.ext.maven.repository.licence.name
|
||||
url = rootProject.ext.maven.repository.licence.url
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = rootProject.ext.maven.developer.id
|
||||
name = rootProject.ext.maven.developer.user
|
||||
email = rootProject.ext.maven.developer.email
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection = rootProject.ext.maven.configurations.githubConnection
|
||||
developerConnection = rootProject.ext.maven.configurations.githubDeveloperConnection
|
||||
url = rootProject.ext.maven.configurations.githubUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
name = rootProject.ext.maven.configurations.ossName
|
||||
url = rootProject.ext.maven.configurations.ossUrl
|
||||
credentials {
|
||||
def configs = getMavenCredentials(projectDir)
|
||||
username = configs.username
|
||||
password = configs.password
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing { sign(publishing.publications.mavenJava) }
|
60
yukihookapi-ksp-xposed/build.gradle.kts
Normal file
60
yukihookapi-ksp-xposed/build.gradle.kts
Normal file
@@ -0,0 +1,60 @@
|
||||
plugins {
|
||||
autowire(libs.plugins.kotlin.jvm)
|
||||
autowire(libs.plugins.kotlin.ksp)
|
||||
autowire(libs.plugins.maven.publish)
|
||||
}
|
||||
|
||||
group = property.project.groupName
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlin {
|
||||
sourceSets.getByName("main") {
|
||||
kotlin.srcDir("src/api/kotlin")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(com.google.auto.service.auto.service.annotations)
|
||||
compileOnly(com.google.devtools.ksp.symbol.processing.api)
|
||||
ksp(dev.zacsweers.autoservice.auto.service.ksp)
|
||||
}
|
||||
|
||||
mavenPublishing {
|
||||
coordinates(property.project.groupName, property.project.yukihookapi.ksp.xposed.moduleName, property.project.yukihookapi.ksp.xposed.version)
|
||||
pom {
|
||||
name = property.project.name
|
||||
description = property.project.description
|
||||
url = property.project.url
|
||||
licenses {
|
||||
license {
|
||||
name = property.project.licence.name
|
||||
url = property.project.licence.url
|
||||
distribution = property.project.licence.url
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = property.project.developer.id
|
||||
name = property.project.developer.name
|
||||
email = property.project.developer.email
|
||||
}
|
||||
}
|
||||
scm {
|
||||
url = property.maven.publish.scm.url
|
||||
connection = property.maven.publish.scm.connection
|
||||
developerConnection = property.maven.publish.scm.developerConnection
|
||||
}
|
||||
}
|
||||
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.S01)
|
||||
signAllPublications()
|
||||
}
|
Reference in New Issue
Block a user