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>
这个提交包含在:
父节点
8db0d353de
当前提交
7b52d09758
@ -0,0 +1,51 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm")
|
||||||
|
`java-gradle-plugin`
|
||||||
|
`maven-publish`
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "com.xuqm.bugcollect"
|
||||||
|
|
||||||
|
val pluginVersion: 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"
|
||||||
|
}
|
||||||
|
|
||||||
|
version = pluginVersion
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(11)
|
||||||
|
}
|
||||||
|
|
||||||
|
gradlePlugin {
|
||||||
|
plugins {
|
||||||
|
create("bugcollect") {
|
||||||
|
id = "com.xuqm.bugcollect"
|
||||||
|
implementationClass = "com.xuqm.sdk.bugcollect.gradle.XuqmBugCollectPlugin"
|
||||||
|
displayName = "XuqmGroup BugCollect Plugin"
|
||||||
|
description = "Uploads ProGuard mapping files to the XuqmGroup BugCollect service after minified builds."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly("com.android.tools.build:gradle:9.1.0")
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = uri(rootProject.ext["nexusUrl"] as String)
|
||||||
|
credentials {
|
||||||
|
username = project.findProperty("NEXUS_USER") as? String ?: ""
|
||||||
|
password = project.findProperty("NEXUS_PASSWORD") as? String ?: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -49,7 +49,4 @@ dependencies {
|
|||||||
implementation(project(":sdk-core"))
|
implementation(project(":sdk-core"))
|
||||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||||
implementation("com.google.code.gson:gson:2.10.1")
|
implementation("com.google.code.gson:gson:2.10.1")
|
||||||
// Gradle Plugin classes need Gradle API + AGP on compile classpath
|
|
||||||
compileOnly(gradleApi())
|
|
||||||
compileOnly("com.android.tools.build:gradle:9.1.0")
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
implementation-class=com.xuqm.sdk.bugcollect.gradle.XuqmBugCollectPlugin
|
|
||||||
@ -27,4 +27,5 @@ include(":sdk-update")
|
|||||||
include(":sdk-webview")
|
include(":sdk-webview")
|
||||||
include(":sdk-license")
|
include(":sdk-license")
|
||||||
include(":sdk-bugcollect")
|
include(":sdk-bugcollect")
|
||||||
|
include(":sdk-bugcollect-plugin")
|
||||||
include(":sample-app")
|
include(":sample-app")
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户