Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup JDK 1.8
- name: Setup JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/validate-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
working-directory: ./android
steps:
- uses: actions/checkout@v2
- name: Setup JDK 1.8
- name: Setup JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -55,11 +55,17 @@ jobs:
${{ runner.os }}-gradle-
- name: Run Gradle Lint
run: ./gradlew lint --build-cache

- name: Verify lint report exists
run: |
ls -R build/reports
if [ ! -f "build/reports/lint-results-debug.xml" ]; then
echo "Lint report not found!"
exit 1
fi
- name: Parse Gradle Lint Report
uses: yutailang0119/[email protected]
with:
xml_path: android/build/reports/lint-results.xml
xml_path: android/build/reports/lint-results-debug.xml
# ktlint:
# name: Kotlin Lint
# runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ yarn test

To edit the Objective-C files, open `example/ios/BigNumberExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-bignumber`.

To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativeBigNumber` under `Android`.
To edit the Kotlin files, open `example/android` in Android studio and find the source files at `react-native-bignumber` under `Android`.

### Commit message convention

Expand Down
33 changes: 19 additions & 14 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
project("react-native-bignumber")
cmake_minimum_required(VERSION 3.9.0)

set(PACKAGE_NAME "reactnativeBigNumber")
set(PACKAGE_NAME "react-native-bignumber")
set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Consume shared libraries and headers from prefabs
find_package(fbjni REQUIRED CONFIG)
find_package(ReactAndroid REQUIRED CONFIG)
find_package(openssl REQUIRED CONFIG)
find_library(LOG_LIB log)

include_directories(
"../cpp"
Expand Down Expand Up @@ -45,24 +48,26 @@ set_target_properties(
POSITION_INDEPENDENT_CODE ON
)

file(GLOB LIBRN_DIR "${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}")

find_library(
log-lib
log
)

find_package(openssl REQUIRED CONFIG)

target_link_libraries(
${PACKAGE_NAME}
ReactAndroid::turbomodulejsijni
${LOG_LIB}
fbjni::fbjni
${log-lib}
ReactAndroid::jsi
ReactAndroid::reactnativejni
ReactAndroid::react_nativemodule_core
android
openssl::crypto
openssl::ssl
)

if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
target_link_libraries(
${PACKAGE_NAME}
ReactAndroid::reactnative
)
else ()
target_link_libraries(
${PACKAGE_NAME}
ReactAndroid::reactnativejni
ReactAndroid::turbomodulejsijni
ReactAndroid::react_nativemodule_core
)
endif ()
8 changes: 5 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ android {
'**/libreactnativejni.so',
'**/libjsi.so',
'**/libreact_nativemodule_core.so',
'**/libturbomodulejsijni.so'
'**/libturbomodulejsijni.so',
'**/libreactnative.so'
]
}
resources {
excludes += ['**/MANIFEST.MF']
}
exclude 'META-INF/LICENSE.md'
}


Expand Down Expand Up @@ -126,6 +128,6 @@ dependencies {
// 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.facebook.react:react-android:0.71.6"
implementation "com.facebook.react:hermes-android:0.71.6"
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public boolean install() {
return false;
}
Log.i(NAME, "Loading C++ library...");
System.loadLibrary("reactnativeBigNumber");
System.loadLibrary("react-native-bignumber");

JavaScriptContextHolder jsContext = getReactApplicationContext().getJavaScriptContextHolder();
CallInvokerHolderImpl jsCallInvokerHolder = (CallInvokerHolderImpl) getReactApplicationContext()
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ dependencies {
implementation jscFlavor
}

implementation project(':reactnativeBigNumber')
implementation project(':react-native-bignumber')
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
4 changes: 2 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ apply from: file("../node_modules/@react-native-community/cli-platform-android/n
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')

include ':reactnativeBigNumber'
project(':reactnativeBigNumber').projectDir = new File(rootProject.projectDir, '../../android')
include ':react-native-bignumber'
project(':react-native-bignumber').projectDir = new File(rootProject.projectDir, '../../android')
Loading