feat: 埋点数据收集SDK
This commit is contained in:
parent
a1157cb3e9
commit
c79385b6e1
|
|
@ -1,7 +1,7 @@
|
||||||
采用 Room 实现数据持久化,使用Worker管理上传任务,初次上传+重试共5次,重试间隔10s线性增加;多上传任务顺序处理;
|
采用 Room 实现数据持久化,使用Worker管理上传任务,初次上传+重试共5次,重试间隔10s线性增加;多上传任务顺序处理;
|
||||||
网络请求 Retrofit
|
网络请求 Retrofit
|
||||||
### aar位置
|
### aar位置
|
||||||
根目录 aar/release/trackingPoint.aar
|
根目录 /aar/release/trackingPoint-x.x.x.aar
|
||||||
### 使用
|
### 使用
|
||||||
```kotlin
|
```kotlin
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -4,6 +4,8 @@ plugins {
|
||||||
alias(libs.plugins.ksp)
|
alias(libs.plugins.ksp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
version = "1.0.0"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.yuanxuan.tracking_point.library"
|
namespace = "com.yuanxuan.tracking_point.library"
|
||||||
compileSdk {
|
compileSdk {
|
||||||
|
|
@ -19,11 +21,11 @@ android {
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
buildConfigField("String","BASE_URL","\"http://192.168.2.7:18828\"")
|
buildConfigField("String", "BASE_URL", "\"http://192.168.2.7:18828\"")
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
buildConfigField("String","BASE_URL","\"http://192.168.2.7:18828\"")
|
buildConfigField("String", "BASE_URL", "\"http://192.168.2.7:18828\"")
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = false
|
||||||
proguardFiles(
|
proguardFiles(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro"
|
"proguard-rules.pro"
|
||||||
|
|
@ -59,3 +61,31 @@ dependencies {
|
||||||
implementation(libs.androidx.room.ktx)
|
implementation(libs.androidx.room.ktx)
|
||||||
ksp(libs.androidx.room.ksp)
|
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()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue