-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates package build #198
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ buildscript { | |
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.2.2' | ||
classpath("com.android.tools.build:gradle:7.2.2") | ||
} | ||
} | ||
|
||
|
@@ -47,6 +47,13 @@ def reactNativeArchitectures() { | |
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] | ||
} | ||
|
||
def resolveBuildType() { | ||
Gradle gradle = getGradle() | ||
String tskReqStr = gradle.getStartParameter().getTaskRequests()['args'].toString() | ||
|
||
return tskReqStr.contains('Release') ? 'release' : 'debug' | ||
} | ||
|
||
def reactProperties = new Properties() | ||
file("$nodeModules/react-native/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } | ||
|
||
|
@@ -83,6 +90,7 @@ android { | |
} | ||
|
||
packagingOptions { | ||
doNotStrip resolveBuildType() == 'debug' ? "**/**/*.so" : '' | ||
excludes = [ | ||
"**/libc++_shared.so", | ||
"**/libfbjni.so", | ||
|
@@ -91,9 +99,12 @@ android { | |
"**/libreact_nativemodule_core.so", | ||
"**/libturbomodulejsijni.so", | ||
"**/MANIFEST.MF", | ||
"" | ||
] | ||
doNotStrip '**/*.so' | ||
// Should prevent clashes with other libraries that use OpenSSL | ||
pickFirst '**/x86/libcrypto.so' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should prevent conflicts when other libraries also generate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea I mean it's kinda unsafe here but that's the developers fault if he includes two libs with different major versions imo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Transitive dependencies are a bitch |
||
pickFirst '**/x86_64/libcrypto.so' | ||
pickFirst '**/armeabi-v7a/libcrypto.so' | ||
pickFirst '**/arm64-v8a/libcrypto.so' | ||
} | ||
|
||
buildTypes { | ||
|
@@ -130,9 +141,8 @@ repositories { | |
} | ||
|
||
dependencies { | ||
//noinspection GradleDynamicVersion | ||
implementation 'com.facebook.react:react-android:+' | ||
// https://mvnrepository.com/artifact/com.android.ndk.thirdparty/openssl | ||
implementation 'com.android.ndk.thirdparty:openssl:1.1.1l-beta-1' | ||
|
||
implementation "com.facebook.react:react-android:" | ||
implementation "com.facebook.react:hermes-android:" | ||
implementation 'com.android.ndk.thirdparty:openssl:1.1.1q-beta-1' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
{} | ||
{ | ||
"prefer_split_fsevents_watcher": true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gets rid of the annoying re-crawled message when metro starts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That always annoyed me, lol. I wonder why that bugs tho There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tzvetan mentioned something about macos not being their default platform, so fsevents is kinda just duck-taped in |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
rootProject.name = 'QuickCryptoExample' | ||
|
||
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) | ||
include ':app' | ||
includeBuild('../node_modules/react-native-gradle-plugin') | ||
|
||
include ':reactnativequickcrypto' | ||
project(':reactnativequickcrypto').projectDir = new File(rootProject.projectDir, '../../android') | ||
includeBuild('../node_modules/@react-native/gradle-plugin') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
const crypto = require('crypto'); | ||
const quickCrypto = require('react-native-quick-crypto'); | ||
// const quickCrypto = require('react-native-quick-crypto'); | ||
import quickCrypto from 'react-native-quick-crypto'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed so that metro correctly resolves the dependency now |
||
|
||
crypto.publicEncrypt = quickCrypto.publicEncrypt; | ||
crypto.privateDecrypt = quickCrypto.privateDecrypt; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should prevent stripping of debug symbols while not in release mode. I'm guessing it will shave disk space, but more importantly, I wonder if there is some sort of performance penalty for not stripping the symbols.