mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Android] Update SDK download links -> dailybuild 0.0.0 (#950)
* [Android] Update SDK download links * [Android] Revert c++ sdk download link * [Android] Update c++ sdk download link * [Android] Update c++ sdk download link * [Android] Update c++ sdk download link * [Android] Update c++ sdk download link * [Android] Update c++ sdk download link
This commit is contained in:
@@ -83,12 +83,14 @@ def FD_MODEL = [
|
|||||||
|
|
||||||
def FD_JAVA_SDK = [
|
def FD_JAVA_SDK = [
|
||||||
[
|
[
|
||||||
'src' : 'https://bj.bcebos.com/fastdeploy/test/fastdeploy-android-sdk-latest-dev.aar',
|
'src' : 'https://bj.bcebos.com/fastdeploy/dev/android/fastdeploy-android-sdk-with-text-0.0.0.aar',
|
||||||
'dest': 'libs'
|
'dest': 'libs',
|
||||||
|
'name': 'fastdeploy-android-sdk-latest-dev.aar'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'src' : 'https://bj.bcebos.com/fastdeploy/test/bdasr_V3_20210628_cfe8c44.aar',
|
'src' : 'https://bj.bcebos.com/fastdeploy/test/bdasr_V3_20210628_cfe8c44.aar',
|
||||||
'dest': 'libs'
|
'dest': 'libs',
|
||||||
|
'name': 'bdasr_V3_20210628_cfe8c44.aar'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -116,10 +118,7 @@ task downloadAndExtractModels(type: DefaultTask) {
|
|||||||
}
|
}
|
||||||
if (copyFiles) {
|
if (copyFiles) {
|
||||||
println "[INFO] Taring ${cachePath}/${modelName} -> ${model.dest}/${modelPrefix}"
|
println "[INFO] Taring ${cachePath}/${modelName} -> ${model.dest}/${modelPrefix}"
|
||||||
copy {
|
copy { from(tarTree("${cachePath}/${modelName}")) into("${model.dest}") }
|
||||||
from tarTree("${cachePath}/${modelName}")
|
|
||||||
into "${model.dest}"
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
println "[INFO] ${model.dest}/${modelPrefix} already exists!"
|
println "[INFO] ${model.dest}/${modelPrefix} already exists!"
|
||||||
}
|
}
|
||||||
@@ -134,26 +133,25 @@ task downloadAndExtractSDKs(type: DefaultTask) {
|
|||||||
doLast {
|
doLast {
|
||||||
String cachePath = "cache"
|
String cachePath = "cache"
|
||||||
if (!file("${cachePath}").exists()) {
|
if (!file("${cachePath}").exists()) {
|
||||||
mkdir "${cachePath}"
|
mkdir("${cachePath}")
|
||||||
}
|
}
|
||||||
FD_JAVA_SDK.eachWithIndex { sdk, index ->
|
FD_JAVA_SDK.eachWithIndex { sdk, index ->
|
||||||
String[] sdkPaths = sdk.src.split("/")
|
String[] sdkPaths = sdk.src.split("/")
|
||||||
String sdkName = sdkPaths[sdkPaths.length - 1]
|
String cacheName = sdkPaths[sdkPaths.length - 1]
|
||||||
|
String sdkName = sdk.name
|
||||||
|
|
||||||
boolean copyFiles = false
|
boolean copyFiles = false
|
||||||
if (!file("${sdk.dest}/${sdkName}").exists()) {
|
if (!file("${sdk.dest}/${sdkName}").exists()) {
|
||||||
// Download the target SDK if not exists
|
// Download the target SDK if not exists
|
||||||
if (!file("${cachePath}/${sdkName}").exists()) {
|
if (!file("${cachePath}/${cacheName}").exists()) {
|
||||||
println "[INFO] Downloading ${sdk.src} -> ${cachePath}/${sdkName}"
|
println "[INFO] Downloading ${sdk.src} -> ${cachePath}/${cacheName}"
|
||||||
ant.get(src: sdk.src, dest: file("${cachePath}/${sdkName}"))
|
ant.get(src: sdk.src, dest: file("${cachePath}/${cacheName}"))
|
||||||
}
|
}
|
||||||
copyFiles = true
|
copyFiles = true
|
||||||
}
|
}
|
||||||
if (copyFiles) {
|
if (copyFiles) {
|
||||||
println "[INFO] Coping ${cachePath}/${sdkName} -> ${sdk.dest}/${sdkName}"
|
println "[INFO] Rename ${cachePath}/${cacheName} -> ${sdk.dest}/${sdkName}"
|
||||||
copy {
|
copy { from("${cachePath}/${cacheName}") into("${sdk.dest}") rename("${cacheName}", "${sdkName}") }
|
||||||
from "${cachePath}/${sdkName}"
|
|
||||||
into "${sdk.dest}"
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
println "[INFO] ${sdk.dest}/${sdkName} already exists!"
|
println "[INFO] ${sdk.dest}/${sdkName} already exists!"
|
||||||
}
|
}
|
||||||
|
@@ -49,8 +49,9 @@ dependencies {
|
|||||||
|
|
||||||
def FD_CXX_LIB = [
|
def FD_CXX_LIB = [
|
||||||
[
|
[
|
||||||
'src' : 'https://bj.bcebos.com/fastdeploy/test/fastdeploy-android-latest-shared-dev.tgz',
|
'src' : 'https://bj.bcebos.com/fastdeploy/dev/android/fastdeploy-android-with-text-0.0.0-shared.tgz',
|
||||||
'dest': 'libs'
|
'dest': 'libs',
|
||||||
|
'name': 'fastdeploy-android-latest-shared-dev'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -63,26 +64,47 @@ task downloadAndExtractLibs(type: DefaultTask) {
|
|||||||
if (!file("${cachePath}").exists()) {
|
if (!file("${cachePath}").exists()) {
|
||||||
mkdir "${cachePath}"
|
mkdir "${cachePath}"
|
||||||
}
|
}
|
||||||
|
|
||||||
FD_CXX_LIB.eachWithIndex { lib, index ->
|
FD_CXX_LIB.eachWithIndex { lib, index ->
|
||||||
|
|
||||||
String[] libPaths = lib.src.split("/")
|
String[] libPaths = lib.src.split("/")
|
||||||
|
String sdkName = lib.name
|
||||||
String libName = libPaths[libPaths.length - 1]
|
String libName = libPaths[libPaths.length - 1]
|
||||||
libName = libName.split("\\.")[0]
|
libName = libName.substring(0, libName.indexOf("tgz") - 1)
|
||||||
|
String cacheName = cachePath + "/" + "${libName}.tgz"
|
||||||
|
|
||||||
|
String libDir = lib.dest + "/" + libName
|
||||||
|
String sdkDir = lib.dest + "/" + sdkName
|
||||||
|
|
||||||
boolean copyFiles = false
|
boolean copyFiles = false
|
||||||
if (!file("${lib.dest}/${libName}").exists()) {
|
if (!file("${sdkDir}").exists()) {
|
||||||
if (!file("${cachePath}/${libName}.tgz").exists()) {
|
// Download lib and rename to sdk name later.
|
||||||
println "[INFO] Downloading ${lib.src} -> ${cachePath}/${libName}.tgz"
|
if (!file("${cacheName}").exists()) {
|
||||||
ant.get(src: lib.src, dest: file("${cachePath}/${libName}.tgz"))
|
println "[INFO] Downloading ${lib.src} -> ${cacheName}"
|
||||||
|
ant.get(src: lib.src, dest: file("${cacheName}"))
|
||||||
}
|
}
|
||||||
copyFiles = true
|
copyFiles = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copyFiles) {
|
if (copyFiles) {
|
||||||
println "[INFO] Taring ${cachePath}/${libName}.tgz -> ${lib.dest}/${libName}"
|
println "[INFO] Taring ${cacheName} -> ${libDir}"
|
||||||
copy {
|
copy { from(tarTree("${cacheName}")) into("${lib.dest}") }
|
||||||
from tarTree("${cachePath}/${libName}.tgz")
|
if (!libName.equals(sdkName)) {
|
||||||
into "${lib.dest}"
|
if (file("${sdkDir}").exists()) {
|
||||||
|
delete("${sdkDir}")
|
||||||
|
println "[INFO] Remove old ${sdkDir}"
|
||||||
|
}
|
||||||
|
mkdir "${sdkDir}"
|
||||||
|
println "[INFO] Coping ${libDir} -> ${sdkDir}"
|
||||||
|
copy { from("${libDir}") into("${sdkDir}") }
|
||||||
|
delete("${libDir}")
|
||||||
|
println "[INFO] Removed ${libDir}"
|
||||||
|
println "[INFO] Update ${sdkDir} done!"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println "[INFO] ${lib.dest}/${libName} already exists!"
|
println "[INFO] ${sdkDir} already exists!"
|
||||||
|
println "[WARN] Please delete ${cacheName} and ${sdkDir} " +
|
||||||
|
"if you want to UPDATE ${sdkName} c++ lib. Then, rebuild this sdk."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user