From 68cde202a4d9103bded045cc4852fe685561c91a Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 14 Jun 2019 18:37:46 +0100 Subject: [PATCH] Added JSC to improve performances of Android app --- ReactNativeClient/android/app/build.gradle | 5 +++++ ReactNativeClient/android/build.gradle | 26 +++++++++++++--------- ReactNativeClient/package-lock.json | 5 +++++ ReactNativeClient/package.json | 1 + 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index 5261f748f..7bc96f89b 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -139,9 +139,14 @@ android { } } } + packagingOptions { + pickFirst '**/libjsc.so' + pickFirst '**/libc++_shared.so' + } } dependencies { + implementation "org.webkit:android-jsc:r241213" implementation project(':react-native-webview') compile project(':react-native-push-notification') implementation (project(':react-native-camera')) { diff --git a/ReactNativeClient/android/build.gradle b/ReactNativeClient/android/build.gradle index d2e870b5d..85ed8cb83 100644 --- a/ReactNativeClient/android/build.gradle +++ b/ReactNativeClient/android/build.gradle @@ -32,18 +32,22 @@ allprojects { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } - } -} - - -subprojects { - afterEvaluate {project -> - if (project.hasProperty("android")) { - android { - compileSdkVersion 26 - buildToolsVersion "27.0.3" - } + maven { + url "$rootDir/../node_modules/jsc-android/dist" } } } +// TODO: Maybe remove this (forgot why it was needed - probably to make some module work) + +// subprojects { +// afterEvaluate {project -> +// if (project.hasProperty("android")) { +// android { +// compileSdkVersion 28 +// buildToolsVersion "28.0.3" +// } +// } +// } +// } + diff --git a/ReactNativeClient/package-lock.json b/ReactNativeClient/package-lock.json index 17630dd35..a339bbc56 100644 --- a/ReactNativeClient/package-lock.json +++ b/ReactNativeClient/package-lock.json @@ -3704,6 +3704,11 @@ "esprima": "^4.0.0" } }, + "jsc-android": { + "version": "241213.1.0", + "resolved": "https://registry.npmjs.org/jsc-android/-/jsc-android-241213.1.0.tgz", + "integrity": "sha512-AH8NYyMNLNhcUEF97QbMxPNLNW+oiSBlvm1rsMNzgJ1d5TQzdh/AOJGsxeeESp3m9YIWGLCgUvGTVoVLs0p68A==" + }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", diff --git a/ReactNativeClient/package.json b/ReactNativeClient/package.json index 32e4bee32..165fda8f9 100644 --- a/ReactNativeClient/package.json +++ b/ReactNativeClient/package.json @@ -13,6 +13,7 @@ "base-64": "^0.1.0", "buffer": "^5.0.8", "diacritics": "^1.3.0", + "jsc-android": "241213.1.0", "diff-match-patch": "^1.0.4", "events": "^1.1.1", "form-data": "^2.1.4",