You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2019/04/08 11:53:02 UTC
[incubator-weex] branch master updated: copy libweexcore.so and
libweexjss.so to libs automatically (#2280)
This is an automated email from the ASF dual-hosted git repository.
kyork pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push:
new 36f023e copy libweexcore.so and libweexjss.so to libs automatically (#2280)
36f023e is described below
commit 36f023eb7182e09e24792cbbc2efdd6aad1727ff
Author: darin <dy...@qq.com>
AuthorDate: Mon Apr 8 19:52:57 2019 +0800
copy libweexcore.so and libweexjss.so to libs automatically (#2280)
---
android/sdk/build.gradle | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle
index 15bc0f8..7bfedd2 100755
--- a/android/sdk/build.gradle
+++ b/android/sdk/build.gradle
@@ -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()
+ }
+}