chore: merge to new maven publish way

This commit is contained in:
2023-12-28 23:09:25 +08:00
parent 500b416650
commit fe2342ba42
3 changed files with 40 additions and 68 deletions

View File

@@ -6,18 +6,12 @@ kotlin.code.style=official
kotlin.incremental.useClasspathSnapshot=true kotlin.incremental.useClasspathSnapshot=true
# Project Configuration # Project Configuration
project.name=YukiHookAPI project.name=YukiHookAPI
project.description=An efficient Hook API and Xposed Module solution built in Kotlin.
project.url=https://github.com/HighCapable/YukiHookAPI project.url=https://github.com/HighCapable/YukiHookAPI
project.groupName=com.highcapable.yukihookapi project.groupName=com.highcapable.yukihookapi
project.yukihookapi-core.moduleName=api project.yukihookapi-core.moduleName=api
project.yukihookapi-core.version="1.2.0" project.yukihookapi-core.version="1.2.0"
project.yukihookapi-ksp-xposed.moduleName=ksp-xposed project.yukihookapi-ksp-xposed.moduleName=ksp-xposed
project.yukihookapi-ksp-xposed.version=${project.yukihookapi-core.version} project.yukihookapi-ksp-xposed.version=${project.yukihookapi-core.version}
project.licence.name=Apache License 2.0
project.licence.url=https://github.com/HighCapable/YukiHookAPI/blob/master/LICENSE
project.developer.id="0"
project.developer.name=fankes
project.developer.email=qzmmcn@163.com
project.android.compileSdk=34 project.android.compileSdk=34
project.android.minSdk=21 project.android.minSdk=21
project.android.targetSdk=34 project.android.targetSdk=34
@@ -28,6 +22,19 @@ project.samples-demo-module.packageName=${project.groupName}.demo_module
project.samples-demo-module.versionName=universal project.samples-demo-module.versionName=universal
project.samples-demo-module.versionCode=1 project.samples-demo-module.versionCode=1
# Maven Publish Configuration # Maven Publish Configuration
maven.publish.scm.connection=scm:git:git://github.com/HighCapable/YukiHookAPI.git SONATYPE_HOST=S01
maven.publish.scm.developerConnection=scm:git:ssh://github.com/HighCapable/YukiHookAPI.git RELEASE_SIGNING_ENABLED=true
maven.publish.scm.url=https://github.com/HighCapable/YukiHookAPI # Maven POM Configuration
POM_NAME=YukiHookAPI
POM_DESCRIPTION=An efficient Hook API and Xposed Module solution built in Kotlin.
POM_URL=https://github.com/HighCapable/YukiHookAPI
POM_LICENSE_NAME=Apache License 2.0
POM_LICENSE_URL=https://github.com/HighCapable/YukiHookAPI/blob/master/LICENSE
POM_LICENSE_DIST=repo
POM_SCM_URL=https://github.com/HighCapable/YukiHookAPI
POM_SCM_CONNECTION=scm:git:git://github.com/HighCapable/YukiHookAPI.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/HighCapable/YukiHookAPI.git
POM_DEVELOPER_ID=0
POM_DEVELOPER_NAME=fankes
POM_DEVELOPER_EMAIL=qzmmcn@163.com
POM_DEVELOPER_URL=https://github.com/fankes

View File

@@ -1,9 +1,14 @@
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
plugins { plugins {
autowire(libs.plugins.android.library) autowire(libs.plugins.android.library)
autowire(libs.plugins.kotlin.android) autowire(libs.plugins.kotlin.android)
autowire(libs.plugins.maven.publish) autowire(libs.plugins.maven.publish)
} }
group = property.project.groupName
version = property.project.yukihookapi.core.version
android { android {
namespace = property.project.groupName namespace = property.project.groupName
compileSdk = property.project.android.compileSdk compileSdk = property.project.android.compileSdk
@@ -43,31 +48,10 @@ dependencies {
} }
mavenPublishing { mavenPublishing {
coordinates(property.project.groupName, property.project.yukihookapi.core.moduleName, property.project.yukihookapi.core.version) configure(AndroidSingleVariantLibrary(publishJavadocJar = false))
pom { coordinates(
name = property.project.name groupId = group.toString(),
description = property.project.description artifactId = property.project.yukihookapi.core.moduleName,
url = property.project.url version = version.toString()
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()
} }

View File

@@ -5,6 +5,7 @@ plugins {
} }
group = property.project.groupName group = property.project.groupName
version = property.project.yukihookapi.ksp.xposed.version
java { java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
@@ -12,14 +13,16 @@ java {
} }
kotlin { kotlin {
jvmToolchain(17)
sourceSets.getByName("main") { sourceSets.getByName("main") {
kotlin.srcDir("src/api/kotlin") kotlin.srcDir("src/api/kotlin")
} }
} compilerOptions {
freeCompilerArgs = listOf(
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach { "-Xno-param-assertions",
kotlinOptions { "-Xno-call-assertions",
jvmTarget = "17" "-Xno-receiver-assertions"
)
} }
} }
@@ -30,31 +33,9 @@ dependencies {
} }
mavenPublishing { mavenPublishing {
coordinates(property.project.groupName, property.project.yukihookapi.ksp.xposed.moduleName, property.project.yukihookapi.ksp.xposed.version) coordinates(
pom { groupId = group.toString(),
name = property.project.name artifactId = property.project.yukihookapi.ksp.xposed.moduleName,
description = property.project.description version = version.toString()
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()
} }