feat: 埋点数据收集SDK

This commit is contained in:
yangxisong 2025-12-09 15:24:55 +08:00
parent a1157cb3e9
commit c79385b6e1
3 changed files with 34 additions and 4 deletions

View File

@ -1,7 +1,7 @@
采用 Room 实现数据持久化使用Worker管理上传任务初次上传+重试共5次重试间隔10s线性增加多上传任务顺序处理
网络请求 Retrofit
### aar位置
根目录 aar/release/trackingPoint.aar
根目录 /aar/release/trackingPoint-x.x.x.aar
### 使用
```kotlin
/**

Binary file not shown.

View File

@ -4,6 +4,8 @@ plugins {
alias(libs.plugins.ksp)
}
version = "1.0.0"
android {
namespace = "com.yuanxuan.tracking_point.library"
compileSdk {
@ -23,7 +25,7 @@ android {
}
release {
buildConfigField("String", "BASE_URL", "\"http://192.168.2.7:18828\"")
isMinifyEnabled = true
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
@ -59,3 +61,31 @@ dependencies {
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.ksp)
}
tasks.register("buildAar") {
group = "build"
description = "Build AAR manually"
dependsOn("assembleRelease")
doLast {
// 2. 定义 release 和 debug 两个目标文件夹
val releaseDestDir = rootProject.file("aar/release")
// 3. 执行文件复制操作
// 复制 release 包
copy {
from(layout.buildDirectory.file("outputs/aar/library-release.aar"))
into(releaseDestDir)
rename { "trackingPoint-${project.version}.aar" }
}
// 4. 打印清晰的成功信息
println(
"""
AARs have been built and copied:
- Release: ${releaseDestDir.absolutePath}/trackingPoint.aar
""".trimIndent()
)
}
}