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

Commit

Permalink
copy libweexcore.so and libweexjss.so to libs automatically (#2280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darin726 authored and YorkShen committed Apr 8, 2019
1 parent 494a55c commit 36f023e
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,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()
}
}

0 comments on commit 36f023e

Please sign in to comment.