Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

copy libweexcore.so and libweexjss.so to libs automatically #2280

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,43 @@ bintray {
}
}
}

def copy_so_and_backup() {
def cpu_list = ["armeabi", "armeabi-v7a", "x86"]
cpu_list.forEach { cpu_name ->
File so_file = new File(project.buildDir, "/intermediates/bundles/default/jni/" + cpu_name)
if (so_file.exists()) {
println(so_file.getAbsolutePath())
copy {
from so_file.getAbsolutePath()
into new File("libs/" + cpu_name)
include 'libweexjss.so', 'libweexcore.so'
}

if(cpu_name == "armeabi") {
File back_file = new File(project.buildDir, "/intermediates/cmake/release/obj/armeabi/")
//backup so to project'parent's path
File backup_des = new File(project.buildDir.parentFile.parentFile.parentFile.parentFile,"weex_so_armeabi")
if(backup_des.exists()){
backup_des.deleteDir()
backup_des.mkdir()
}
println(backup_des.absolutePath)

println("so backup to "+ backup_des.absolutePath)
copy {
from back_file.getAbsolutePath()
into backup_des
include 'libweexjss.so', 'libweexcore.so'
}
}
}
}
}

afterEvaluate { project ->
project.tasks.find { (it.name.contains("assembleRelease")) }?.doLast {
println("begin_copy_so")
copy_so_and_backup()
}
}