This is an automated email from the ASF dual-hosted git repository.

luckychen 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 739e07f  * [Android] Remove shared library from binary of Weex (#2940)
739e07f is described below

commit 739e07f3e5426c9bdfbaec5c08838de3b5db8281
Author: YorkShen <shenyua...@gmail.com>
AuthorDate: Fri Oct 11 16:53:05 2019 +0800

    * [Android] Remove shared library from binary of Weex (#2940)
    
    * [Android] Make JS Interpolator in Android as replaceable.
    
    * [Android] support switch javascriptCore (legacy)or jsc (apache)
    
    * [Android] fix
    
    * [Android] Revert the commit of initConfig.
---
 .travis.yml                                        |   6 +--
 android/sdk/.gitignore                             |   3 +-
 android/sdk/build.gradle                           |  22 ++++++--
 android/sdk/buildSrc/download_jsc.gradle           |  57 +++++++++++++++++++++
 android/sdk/buildSrc/packageName.gradle            |  12 -----
 android/sdk/libs/arm64-v8a/libJavaScriptCore.so    | Bin 9258456 -> 0 bytes
 android/sdk/libs/arm64-v8a/libWTF.so               | Bin 522016 -> 0 bytes
 android/sdk/libs/armeabi-v7a/libJavaScriptCore.so  | Bin 5237568 -> 0 bytes
 android/sdk/libs/armeabi-v7a/libWTF.so             | Bin 472828 -> 0 bytes
 android/sdk/libs/x86/libJavaScriptCore.so          | Bin 12134688 -> 0 bytes
 android/sdk/libs/x86/libWTF.so                     | Bin 488784 -> 0 bytes
 .../main/java/org/apache/weex/WXEnvironment.java   |  36 ++++++-------
 .../java/org/apache/weex/utils/WXFileUtils.java    |   5 +-
 .../org/apache/weex/utils/WXSoInstallMgrSdk.java   |   4 +-
 weex_core/Source/CMakeLists.txt                    |  17 +++---
 weex_core/Source/js_runtime/CMakeLists.txt         |  18 +++++--
 .../Source/js_runtime/weex/utils/weex_jsc_utils.h  |   5 ++
 .../Source/libs/arm64-v8a/libJavaScriptCore.so     | Bin 9278912 -> 0 bytes
 weex_core/Source/libs/arm64-v8a/libWTF.so          | Bin 522016 -> 0 bytes
 .../Source/libs/armeabi-v7a/libJavaScriptCore.so   | Bin 5237308 -> 0 bytes
 weex_core/Source/libs/armeabi-v7a/libWTF.so        | Bin 472828 -> 0 bytes
 weex_core/Source/libs/armeabi/libJavaScriptCore.so | Bin 5237308 -> 0 bytes
 weex_core/Source/libs/armeabi/libWTF.so            | Bin 472828 -> 0 bytes
 weex_core/Source/libs/x86/libJavaScriptCore.so     | Bin 13729888 -> 0 bytes
 weex_core/Source/libs/x86/libWTF.so                | Bin 805056 -> 0 bytes
 25 files changed, 127 insertions(+), 58 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 28e3aff..e709618 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -138,9 +138,9 @@ script:
         if npm run danger -- ci --dangerfile ./dangerfile-android.js | grep -q 
"hasAndroidFile" ; then
           cd android
           ./gradlew clean assembleRelease --quiet -PbuildRuntimeApi=true 
${GRADLE_ABI} -PapachePackageName="false" || exit 1
-          ./gradlew assembleRelease --quiet -PbuildRuntimeApi=false 
${GRADLE_ABI} -PapachePackageName="false" || exit 1
-          ./gradlew :weex_sdk:assembleRelease --quiet -PbuildRuntimeApi=true 
${GRADLE_ABI} -PapachePackageName="true"  || exit 1
-          ./gradlew :weex_sdk:assembleRelease --quiet -PbuildRuntimeApi=false 
${GRADLE_ABI} -PapachePackageName="true" || exit 1
+          ./gradlew assembleRelease --quiet ${GRADLE_ABI} 
-PbuildRuntimeApi=false 
-Pjsc_url="https://raw.githubusercontent.com/apache/incubator-weex/release/0.26/android/sdk/weex_sdk-0.26.0.aar";
 -Paar_name="weex_sdk" -PJSInterpolatorName="JavaScriptCore" 
-PapachePackageName="false" || exit 1
+          ./gradlew :weex_sdk:assembleRelease --quiet -PbuildRuntimeApi=true 
${GRADLE_ABI} -PapachePackageName="true" || exit 1
+          ./gradlew :weex_sdk:assembleRelease --quiet  ${GRADLE_ABI} 
-PbuildRuntimeApi=false 
-Pjsc_url="https://raw.githubusercontent.com/apache/incubator-weex/release/0.26/android/sdk/weex_sdk-0.26.0.aar";
 -Paar_name="weex_sdk" -PJSInterpolatorName="JavaScriptCore" 
-PapachePackageName="true" || exit 1
         fi
         ;;
       "jsfm" )
diff --git a/android/sdk/.gitignore b/android/sdk/.gitignore
index f29323d..8074061 100755
--- a/android/sdk/.gitignore
+++ b/android/sdk/.gitignore
@@ -16,7 +16,8 @@ assets/weex-main-jsfm.js
 assets/weex-rax-api.js
 .externalNativeBuild
 
-/libs/armeabi
+/libs/
+/src/main/jniLibs
 
 /src/legacyRelease/
 proguard-rules-legacy.pro
\ No newline at end of file
diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle
index 32ce256..d1660f0 100755
--- a/android/sdk/build.gradle
+++ b/android/sdk/build.gradle
@@ -31,6 +31,7 @@ apply from: 'buildSrc/jcenter.gradle'
 apply from: 'buildSrc/unstripped.gradle'
 apply from: 'buildSrc/checkStyle.gradle'
 apply from: 'buildSrc/packageName.gradle'
+apply from: 'buildSrc/download_jsc.gradle'
 
 version = project.hasProperty('weexVersion') ? 
project.getProperty('weexVersion') : '0.26.0.1'
 
@@ -101,13 +102,19 @@ android {
 
     def android_project_dir = projectDir
 
-    def buildRuntimeApi = project.hasProperty('buildRuntimeApi') ? 
project.property('buildRuntimeApi') : false
+    def buildRuntimeApi = project.hasProperty('buildRuntimeApi') ? 
project.property('buildRuntimeApi').toBoolean() : true
+    def jsInterpolatorName = project.hasProperty('JSInterpolatorName') ? 
project.property('JSInterpolatorName') : 'jsc'
+    def initJSCPrivateApi = false
+    if (buildRuntimeApi){
+        initJSCPrivateApi = jsInterpolatorName =="JavaScriptCore"
+    }
 
     defaultPublishConfig project.useApachePackageName ? 'apacheRelease' : 
'legacyRelease'
 
     defaultConfig {
         buildConfigField "String", "buildJavascriptFrameworkVersion", 
"\"${jsfmVersion}\""
         buildConfigField "String", "buildVersion", "\"${version}\""
+        buildConfigField "String", "JSInterpolatorName", 
"\"${jsInterpolatorName}\""
         minSdkVersion project.minSdkVersion
         targetSdkVersion project.targetSdkVersion
 
@@ -135,8 +142,13 @@ android {
                         '-DANDROID_STL=' + "${cxx_stl}",
                         '-DCMAKE_BUILD_TYPE=Release',
                         '-DANDROID_PROJECT_DIR=' + "${android_project_dir}",
-                        '-DENABLE_ASAN=false',
-                        '-DBUILD_RUNTIME_API='+"${buildRuntimeApi}"
+                        '-DENABLE_ASAN=false'
+                if(buildRuntimeApi){
+                    arguments '-DBUILD_RUNTIME_API='+"${buildRuntimeApi}"
+                    if (initJSCPrivateApi){
+                        arguments 
'-DINIT_JSC_PRIVATE_API='+"${initJSCPrivateApi}"
+                    }
+                }
                 if(project.hasProperty('enableASan') && "true" == 
project.getProperty('enableASan')) {
                     cppFlags "-fsanitize=address -fno-omit-frame-pointer"
                 }
@@ -189,7 +201,6 @@ android {
 
     sourceSets {
         main.assets.srcDirs = ['assets']
-        main.jniLibs.srcDirs = ['libs']
         apacheRelease.java.srcDirs = ['src/main/java']
         apacheRelease.manifest.srcFile(new 
File('src/main/AndroidManifest.xml'))
         legacyRelease.java.srcDirs = ['src/legacyRelease/java']
@@ -273,4 +284,5 @@ task weex_core_license(type: 
com.hierynomus.gradle.license.tasks.LicenseFormat)
                      'Source/include/JavaScriptCore/**/*.cpp'])
 }
 
-preBuild.dependsOn copyAndRenameCppSourceFile, copyAndRenamePackage, 
copyManifest, copyProguard, copyASanLib, checkNdkVersion, licenseFormat
\ No newline at end of file
+preBuild.dependsOn copyAndRenameCppSourceFile, copyAndRenamePackage, 
copyManifest, copyProguard,
+        copyASanLib, checkNdkVersion, licenseFormat, copyJscToJniDir
\ No newline at end of file
diff --git a/android/sdk/buildSrc/download_jsc.gradle 
b/android/sdk/buildSrc/download_jsc.gradle
new file mode 100644
index 0000000..229c12d
--- /dev/null
+++ b/android/sdk/buildSrc/download_jsc.gradle
@@ -0,0 +1,57 @@
+def jsc_dir = new File(project.buildDir, 'jsc')
+def jsc_url = project.hasProperty('jsc_url') ? new 
URL(project.getProperty('jsc_url').toString()) : new 
URL('https://registry.npmjs.org/jsc-android/-/jsc-android-241213.1.0.tgz')
+def aar_name = project.hasProperty('aar_name') ? 
project.getProperty('aar_name').toString() : 'android-jsc-intl'
+
+def jsc_file = new File(jsc_dir, jsc_url.path.split('/').last())
+def aar_file = new File(jsc_dir, "${aar_name}.aar")
+
+def downloadJSC = { URL url, File dest ->
+    if (!dest.getParentFile().exists()) {
+        dest.getParentFile().mkdirs()
+    }
+    url.withInputStream { i -> dest.withOutputStream { it << i } }
+}
+
+task download(){
+    inputs.property('url', jsc_url)
+    outputs.file(jsc_file)
+    doFirst {
+        if (!jsc_file.exists()) {
+            downloadJSC(jsc_url, jsc_file)
+        }
+    }
+}
+
+task unzipJSC(type: Copy, dependsOn: download) {
+    from jsc_file.name.endsWith(".aar") ? jsc_file : tarTree(jsc_file)
+    into jsc_dir
+    include "**/*${aar_name}*.aar"
+    includeEmptyDirs false
+    eachFile {
+        it.path = it.name
+        it.name = "${aar_name}.aar"
+    }
+    inputs.file(jsc_file)
+    outputs.file(aar_file)
+}
+
+task copyJscToJniDir(type: Copy, dependsOn: unzipJSC) {
+    def libsDir = project.android.sourceSets.main.jniLibs.srcDirs[-1]
+    doFirst{
+        delete libsDir
+    }
+    from zipTree(aar_file)
+    into libsDir
+    include 'jni/**/*.so'
+    exclude '**/libweexcore.so', '**/libweexjsb.so', '**/libweexjss.so',
+            '**/libweexjssr.so', '**/libweexjst.so', '**/libc++_shared.so',
+            '**/x86_64/**'
+    includeEmptyDirs false
+    eachFile {
+        def path_list = new LinkedList<>(it.relativePath.segments.toList())
+        path_list.removeAt(0)
+        it.relativePath = new RelativePath(true, path_list[0], path_list[1])
+    }
+    inputs.file(aar_file)
+    outputs.dir(libsDir)
+}
\ No newline at end of file
diff --git a/android/sdk/buildSrc/packageName.gradle 
b/android/sdk/buildSrc/packageName.gradle
index 345bb3d..d03cca7 100644
--- a/android/sdk/buildSrc/packageName.gradle
+++ b/android/sdk/buildSrc/packageName.gradle
@@ -1,8 +1,5 @@
 task copyAndRenamePackage(type: Copy) {
     if(!project.useApachePackageName) {
-        doFirst {
-            delete new File('src/legacyRelease/java')
-        }
         from new File('src/main/java/org/apache/weex')
         into new File('src/legacyRelease/java/com/taobao/weex')
         filter { String line ->
@@ -19,9 +16,6 @@ task copyAndRenamePackage(type: Copy) {
 
 task copyManifest(type: Copy){
     if(!project.useApachePackageName){
-        doFirst {
-            delete new File('src/legacyRelease/AndroidManifest.xml')
-        }
         from new File('src/main/AndroidManifest.xml')
         into new File('src/legacyRelease')
         filter { String line ->
@@ -34,9 +28,6 @@ task copyManifest(type: Copy){
 
 task copyProguard(type: Copy){
     if(!project.useApachePackageName){
-        doFirst {
-            delete new File('proguard-rules-legacy.pro')
-        }
         from new File('proguard-rules.pro')
         into new File('.')
         rename 'proguard-rules.pro', 'proguard-rules-legacy.pro'
@@ -50,9 +41,6 @@ task copyProguard(type: Copy){
 
 task copyOtherCppFile(type: Copy){
     if(!project.useApachePackageName) {
-        doFirst {
-            delete new File('src/legacyRelease/cpp')
-        }
         from new File('../../weex_core')
         into new File('src/legacyRelease/cpp')
         exclude '**/*.cpp', '**/*.cc', '**/*.c', '**/*.h', '**/*.hpp'
diff --git a/android/sdk/libs/arm64-v8a/libJavaScriptCore.so 
b/android/sdk/libs/arm64-v8a/libJavaScriptCore.so
deleted file mode 100755
index 7f33280..0000000
Binary files a/android/sdk/libs/arm64-v8a/libJavaScriptCore.so and /dev/null 
differ
diff --git a/android/sdk/libs/arm64-v8a/libWTF.so 
b/android/sdk/libs/arm64-v8a/libWTF.so
deleted file mode 100755
index ce8d0bc..0000000
Binary files a/android/sdk/libs/arm64-v8a/libWTF.so and /dev/null differ
diff --git a/android/sdk/libs/armeabi-v7a/libJavaScriptCore.so 
b/android/sdk/libs/armeabi-v7a/libJavaScriptCore.so
deleted file mode 100755
index d6b471c..0000000
Binary files a/android/sdk/libs/armeabi-v7a/libJavaScriptCore.so and /dev/null 
differ
diff --git a/android/sdk/libs/armeabi-v7a/libWTF.so 
b/android/sdk/libs/armeabi-v7a/libWTF.so
deleted file mode 100755
index 790bef2..0000000
Binary files a/android/sdk/libs/armeabi-v7a/libWTF.so and /dev/null differ
diff --git a/android/sdk/libs/x86/libJavaScriptCore.so 
b/android/sdk/libs/x86/libJavaScriptCore.so
deleted file mode 100755
index 3cdfd01..0000000
Binary files a/android/sdk/libs/x86/libJavaScriptCore.so and /dev/null differ
diff --git a/android/sdk/libs/x86/libWTF.so b/android/sdk/libs/x86/libWTF.so
deleted file mode 100755
index 6d2bb48..0000000
Binary files a/android/sdk/libs/x86/libWTF.so and /dev/null differ
diff --git a/android/sdk/src/main/java/org/apache/weex/WXEnvironment.java 
b/android/sdk/src/main/java/org/apache/weex/WXEnvironment.java
index d1d87fa..dd467b3 100644
--- a/android/sdk/src/main/java/org/apache/weex/WXEnvironment.java
+++ b/android/sdk/src/main/java/org/apache/weex/WXEnvironment.java
@@ -29,18 +29,10 @@ import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.graphics.Typeface;
 import android.os.Environment;
+import android.support.annotation.RestrictTo;
+import android.support.annotation.RestrictTo.Scope;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
-import org.apache.weex.R;
-import org.apache.weex.common.WXConfig;
-import org.apache.weex.utils.FontDO;
-import org.apache.weex.utils.LogLevel;
-import org.apache.weex.utils.TypefaceUtil;
-import org.apache.weex.utils.WXFileUtils;
-import org.apache.weex.utils.WXLogUtils;
-import org.apache.weex.utils.WXSoInstallMgrSdk;
-import org.apache.weex.utils.WXUtils;
-import org.apache.weex.utils.WXViewUtils;
 import dalvik.system.PathClassLoader;
 import java.io.BufferedReader;
 import java.io.File;
@@ -52,6 +44,16 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import org.apache.weex.R;
+import org.apache.weex.common.WXConfig;
+import org.apache.weex.utils.FontDO;
+import org.apache.weex.utils.LogLevel;
+import org.apache.weex.utils.TypefaceUtil;
+import org.apache.weex.utils.WXFileUtils;
+import org.apache.weex.utils.WXLogUtils;
+import org.apache.weex.utils.WXSoInstallMgrSdk;
+import org.apache.weex.utils.WXUtils;
+import org.apache.weex.utils.WXViewUtils;
 
 public class WXEnvironment {
 
@@ -93,7 +95,8 @@ public class WXEnvironment {
 
   public static boolean AUTO_UPDATE_APPLICATION_SCREEN_SIZE = true;
 
-  public static volatile boolean sUseRunTimeApi = false;
+  @RestrictTo(Scope.LIBRARY)
+  public static volatile boolean sUseRunTimeApi;
 
   /**
    * Debug model
@@ -137,10 +140,10 @@ public class WXEnvironment {
   public static final String CORE_JSS_SO_NAME = "weexjss";
   public static final String CORE_JSB_SO_NAME = "weexjsb";
   public static final String CORE_JST_SO_NAME = "weexjst";
-  public static final String CORE_JSC_SO_NAME = "JavaScriptCore";
-  private static  String CORE_JSS_SO_PATH = null;
 
-  public static  String CORE_JSS_RUNTIME_SO_PATH = null;
+  @RestrictTo(Scope.LIBRARY)
+  public static String CORE_JSC_SO_NAME = BuildConfig.JSInterpolatorName;
+  public static  String CORE_JSS_SO_PATH = null;
 
   private static String CORE_JSS_ICU_PATH = null;
 
@@ -607,11 +610,6 @@ public class WXEnvironment {
   }
 
   public static String getLibJssRealPath() {
-    if (WXEnvironment.sUseRunTimeApi && 
!TextUtils.isEmpty(CORE_JSS_RUNTIME_SO_PATH)){
-      WXLogUtils.d("test-> findLibJssRuntimeRealPath " + 
CORE_JSS_RUNTIME_SO_PATH);
-      return CORE_JSS_RUNTIME_SO_PATH;
-    }
-
     if(TextUtils.isEmpty(CORE_JSS_SO_PATH)) {
       CORE_JSS_SO_PATH = findSoPath(CORE_JSS_SO_NAME);
       WXLogUtils.d("test-> findLibJssRealPath " + CORE_JSS_SO_PATH);
diff --git a/android/sdk/src/main/java/org/apache/weex/utils/WXFileUtils.java 
b/android/sdk/src/main/java/org/apache/weex/utils/WXFileUtils.java
index 3d1aaaa..feaec62 100644
--- a/android/sdk/src/main/java/org/apache/weex/utils/WXFileUtils.java
+++ b/android/sdk/src/main/java/org/apache/weex/utils/WXFileUtils.java
@@ -36,9 +36,11 @@ import java.io.UnsupportedEncodingException;
 import java.math.BigInteger;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.util.Locale;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 import java.util.zip.ZipInputStream;
+import org.apache.weex.WXEnvironment;
 
 public class WXFileUtils {
 
@@ -212,7 +214,8 @@ public class WXFileUtils {
         continue;
       }
       if(zipEntry.getName().contains("lib/armeabi/") &&
-              (zipEntry.getName().contains("weex") || 
zipEntry.getName().equals("libJavaScriptCore.so"))){
+              (zipEntry.getName().contains("weex") || 
zipEntry.getName().equals(
+                  String.format(Locale.ENGLISH, "lib%s.so", 
WXEnvironment.CORE_JSC_SO_NAME)))){
         String[] fileNames = zipEntry.getName().split("/");
         String fileName = fileNames[fileNames.length - 1];
         InputStream inputStream = zip.getInputStream(zipEntry);
diff --git 
a/android/sdk/src/main/java/org/apache/weex/utils/WXSoInstallMgrSdk.java 
b/android/sdk/src/main/java/org/apache/weex/utils/WXSoInstallMgrSdk.java
index a7d97b3..e5140a7 100644
--- a/android/sdk/src/main/java/org/apache/weex/utils/WXSoInstallMgrSdk.java
+++ b/android/sdk/src/main/java/org/apache/weex/utils/WXSoInstallMgrSdk.java
@@ -307,7 +307,7 @@ public class WXSoInstallMgrSdk {
         if 
(!TextUtils.equals(WXEnvironment.getAppVersionName(),defaultSettingValue)){
           targetFile.delete();
         }else {
-          WXEnvironment.CORE_JSS_RUNTIME_SO_PATH= targetFile.getAbsolutePath();
+          WXEnvironment.CORE_JSS_SO_PATH= targetFile.getAbsolutePath();
           WXEnvironment.sUseRunTimeApi = true;
           WXLogUtils.e("weex", "copyJssRuntimeSo exist:  return");
           return;
@@ -321,7 +321,7 @@ public class WXSoInstallMgrSdk {
       targetFile.createNewFile();
       WXFileUtils.copyFileWithException(new File(fromPath),targetFile);
       /**3. update flag **/
-      WXEnvironment.CORE_JSS_RUNTIME_SO_PATH= targetFile.getAbsolutePath();
+      WXEnvironment.CORE_JSS_SO_PATH= targetFile.getAbsolutePath();
       
WXEnvironment.writeDefaultSettingsValue(keyVersionCode,WXEnvironment.getAppVersionName());
       WXEnvironment.sUseRunTimeApi = true;
       WXLogUtils.e("weex", "copyJssRuntimeSo: cp end and return ");
diff --git a/weex_core/Source/CMakeLists.txt b/weex_core/Source/CMakeLists.txt
index d1bb5fe..508aaea 100755
--- a/weex_core/Source/CMakeLists.txt
+++ b/weex_core/Source/CMakeLists.txt
@@ -42,7 +42,7 @@ add_definitions(-DDOM_PARSER_LOG=0)
 add_definitions(-DDEBUG=1)
 
 message("ANDROID_PROJECT_DIR:"${ANDROID_PROJECT_DIR})
-set(LOCAL_LIBRARIES_DIR ${ANDROID_PROJECT_DIR}/libs/${ANDROID_ABI})
+set(LOCAL_LIBRARIES_DIR ${ANDROID_PROJECT_DIR}/src/main/jniLibs/${ANDROID_ABI})
 
 if ("${ANDROID_ABI}" STREQUAL "x86")
     # todo
@@ -119,19 +119,14 @@ if(ANDROID)
   ## add_subdirectory for subdirectory has a CMakeLists.txt
   add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/IPC)
 
-
-  message("check build jsc BUILD_RUNTIME_API flag: ${BUILD_RUNTIME_API}")
-  if ("${BUILD_RUNTIME_API}" STREQUAL "true")
-      add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/js_runtime)
-      message("cmake build jsApi for runtime")
+  if (DEFINED BUILD_RUNTIME_API)
+    message("Variable BUILD_RUNTIME_API is defined with value: 
${BUILD_RUNTIME_API}")
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/js_runtime)
   else()
-      add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/android/jsengine)
-      message("cmake build jsApi for jsc")
+    message("Variable BUILD_RUNTIME_API is not defined")
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/android/jsengine)
   endif()
 
-
-
-
   ## include_directories for include head file
   include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/IPC)
 
diff --git a/weex_core/Source/js_runtime/CMakeLists.txt 
b/weex_core/Source/js_runtime/CMakeLists.txt
index 42bd160..51f8e6d 100644
--- a/weex_core/Source/js_runtime/CMakeLists.txt
+++ b/weex_core/Source/js_runtime/CMakeLists.txt
@@ -212,10 +212,6 @@ set(${WEEXJSSERVER_NAME}_LIBRARIES
 weexbase
 weexipc
 wson
-#c++_shared
-JavaScriptCore
-WTF
-#jsc
 log
 z
 -lc
@@ -223,6 +219,20 @@ z
 -pthread
 )
 
+if (DEFINED BUILD_RUNTIME_API)
+    set(${WEEXJSSERVER_NAME}_LIBRARIES
+        ${${WEEXJSSERVER_NAME}_LIBRARIES}
+        c++_shared
+        jsc
+    )
+else()
+    set(${WEEXJSSERVER_NAME}_LIBRARIES
+        ${${WEEXJSSERVER_NAME}_LIBRARIES}
+        JavaScriptCore
+        WTF
+    )
+endif()
+
 add_library(${WEEXJSSERVER_NAME} SHARED
             ${${WEEXJSSERVER_NAME}_SOURCES} )
 
diff --git a/weex_core/Source/js_runtime/weex/utils/weex_jsc_utils.h 
b/weex_core/Source/js_runtime/weex/utils/weex_jsc_utils.h
index 30a87d8..a4a2701 100644
--- a/weex_core/Source/js_runtime/weex/utils/weex_jsc_utils.h
+++ b/weex_core/Source/js_runtime/weex/utils/weex_jsc_utils.h
@@ -209,6 +209,7 @@ namespace WEEXICU {
 //    }
 
     static bool initICUEnv(bool multiProcess) {
+#ifdef INIT_JSC_PRIVATE_API
         static bool isInit = false;
         if (isInit)
             return true;
@@ -245,6 +246,10 @@ namespace WEEXICU {
             return true;//mapIcuData(std::string(path));
         }
         return false;
+#else
+        LOGE("skip initICUEnv");
+        return true;
+#endif
     }
 
 }
diff --git a/weex_core/Source/libs/arm64-v8a/libJavaScriptCore.so 
b/weex_core/Source/libs/arm64-v8a/libJavaScriptCore.so
deleted file mode 100755
index 56307f0..0000000
Binary files a/weex_core/Source/libs/arm64-v8a/libJavaScriptCore.so and 
/dev/null differ
diff --git a/weex_core/Source/libs/arm64-v8a/libWTF.so 
b/weex_core/Source/libs/arm64-v8a/libWTF.so
deleted file mode 100755
index ce8d0bc..0000000
Binary files a/weex_core/Source/libs/arm64-v8a/libWTF.so and /dev/null differ
diff --git a/weex_core/Source/libs/armeabi-v7a/libJavaScriptCore.so 
b/weex_core/Source/libs/armeabi-v7a/libJavaScriptCore.so
deleted file mode 100755
index 2d59099..0000000
Binary files a/weex_core/Source/libs/armeabi-v7a/libJavaScriptCore.so and 
/dev/null differ
diff --git a/weex_core/Source/libs/armeabi-v7a/libWTF.so 
b/weex_core/Source/libs/armeabi-v7a/libWTF.so
deleted file mode 100755
index 790bef2..0000000
Binary files a/weex_core/Source/libs/armeabi-v7a/libWTF.so and /dev/null differ
diff --git a/weex_core/Source/libs/armeabi/libJavaScriptCore.so 
b/weex_core/Source/libs/armeabi/libJavaScriptCore.so
deleted file mode 100755
index 2d59099..0000000
Binary files a/weex_core/Source/libs/armeabi/libJavaScriptCore.so and /dev/null 
differ
diff --git a/weex_core/Source/libs/armeabi/libWTF.so 
b/weex_core/Source/libs/armeabi/libWTF.so
deleted file mode 100755
index 790bef2..0000000
Binary files a/weex_core/Source/libs/armeabi/libWTF.so and /dev/null differ
diff --git a/weex_core/Source/libs/x86/libJavaScriptCore.so 
b/weex_core/Source/libs/x86/libJavaScriptCore.so
deleted file mode 100755
index b7abc27..0000000
Binary files a/weex_core/Source/libs/x86/libJavaScriptCore.so and /dev/null 
differ
diff --git a/weex_core/Source/libs/x86/libWTF.so 
b/weex_core/Source/libs/x86/libWTF.so
deleted file mode 100755
index 0f4c2df..0000000
Binary files a/weex_core/Source/libs/x86/libWTF.so and /dev/null differ

Reply via email to