XuqmGroup-AndroidSDK/sdk-bugcollect/build.gradle.kts
XuqmGroup 7b52d09758 refactor(sdk-bugcollect): 将 Gradle 插件拆分为独立 JVM 模块 sdk-bugcollect-plugin
AAR 无法作为 Gradle 插件 classpath,plugins{} 块也需要独立的 plugin marker artifact。
将 XuqmBugCollectPlugin/XuqmUploadMappingTask 迁移到新的 sdk-bugcollect-plugin 模块,
使用 java-gradle-plugin 自动生成 com.xuqm.bugcollect 插件标记并发布到 Nexus。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 10:41:29 +08:00

53 行
1.5 KiB
Plaintext

plugins {
id("com.android.library")
id("maven-publish")
}
group = rootProject.group
android {
namespace = "com.xuqm.sdk.bugcollect"
compileSdk = 36
defaultConfig { minSdk = 24 }
publishing { singleVariant("release") { withSourcesJar() } }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
val sdkBugCollectVersion: String by lazy {
(project.findProperty("SDK_BUGCOLLECT_VERSION") as? String)?.takeIf { it.isNotBlank() }
?: (project.findProperty("PUBLISH_VERSION") as? String)?.takeIf { it.isNotBlank() }
?: "0.0.1-SNAPSHOT"
}
afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
from(components["release"])
groupId = "com.xuqm"
artifactId = "sdk-bugcollect"
version = sdkBugCollectVersion
}
}
repositories {
maven {
url = uri(rootProject.ext["nexusUrl"] as String)
credentials {
username = project.findProperty("NEXUS_USER") as? String ?: ""
password = project.findProperty("NEXUS_PASSWORD") as? String ?: ""
}
}
}
}
}
dependencies {
implementation(project(":sdk-core"))
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.google.code.gson:gson:2.10.1")
}