Skip to content

Commit

Permalink
update gradle config
Browse files Browse the repository at this point in the history
  • Loading branch information
JarvisSemou committed Jun 19, 2024
1 parent 660fb5d commit 1681bbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions public_sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ dependencies {
implementation("com.squareup.retrofit2:converter-gson:2.9.0")

// json 解析库
api("com.google.code.gson:gson:2.9.0")
implementation("com.google.code.gson:gson:2.9.0")

// 网络请求库
api("com.squareup.okhttp3:okhttp:3.14.9")
api("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.okhttp3:okhttp:3.14.9")
implementation("com.squareup.retrofit2:retrofit:2.9.0")

// 观测云
implementation("com.cloudcare.ft.mobile.sdk.tracker.agent:ft-sdk:1.5.0")
Expand All @@ -79,43 +79,33 @@ dependencies {

val version = PublicSdkConfig.versionName
val sdkFile = "TiCloudRTC_Android_SDK_${PublicSdkConfig.versionName}_release.zip"
val downloadedSdkFile = File("$buildDir/downloaded_sdk/$sdkFile")
val zipPackagesPath = File("${rootDir.absolutePath}/zip_packages/$sdkFile")

task<Delete>("deleteExpiredFiles"){
delete = setOf("${projectDir.path}/libs","${projectDir.path}/src/main/jinLibs")
}

task<de.undercouch.gradle.tasks.download.Download>("downloadSdk") {
dependsOn("deleteExpiredFiles")
group = "custom"
src("https://tinet-sdk-release.s3.cn-north-1.amazonaws.com.cn/TiCloudRTC/sdk/v$version/TiCloudRTC_Android_SDK_${version}_release.zip")
dest(downloadedSdkFile)
overwrite(true)
onlyIfModified(true)
doLast {
println("start to copy libs")

copy {
from(zipTree(downloadedSdkFile))
from(zipTree(zipPackagesPath))
include("arm*/**","x86*/**")
into("${project.projectDir}/src/main/jniLibs")
}

copy{
from(zipTree(downloadedSdkFile))
from(zipTree(zipPackagesPath))
include("*.jar")
into("${project.projectDir}/libs")
}

copy{
from(zipTree(downloadedSdkFile))
from(zipTree(zipPackagesPath))
include("include/**")
into("${project.projectDir}/src/main/jniLibs")
}
}

}

tasks.named("preBuild"){
dependsOn("downloadSdk")
dependsOn("deleteExpiredFiles")
}
Binary file not shown.

0 comments on commit 1681bbb

Please sign in to comment.