Skip to content

Commit

Permalink
Removing reactnativeutilsjni as it is built from the same sources as …
Browse files Browse the repository at this point in the history
…reactnativejni (#34339)

Summary:
This Pull Request aims at removing the making of reactnativeutilsjni as it is built from the same sources as reactnativejni. It also replaces references to reactnativeutilsjni with reactnativejni.

This should get rid of `reactnativeutilsjni.so` while reusing `reactnativejni.so` in it's place. This should give us some size improvements in the finally built apk.
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Android] [Changed] - Replaced reactnativeutilsjni with reactnativejni in the build process to reduce size

Pull Request resolved: #34339

Test Plan:
1. Ran the CMakelist.txt file using CMake and I could see that reactnativeutilsjni.dir is no longer generated with my changes.
2. Built the aar from this branch in Android Studio and build happened successfully.

I am not sure if we could run any more tests. Please let me know in case anymore testing is required and I can do accordingly

Reviewed By: cortinico

Differential Revision: D38400481

Pulled By: genkikondo

fbshipit-source-id: 592736e56441328389ae89135667c336ff8018e6
  • Loading branch information
SparshaSaha authored and facebook-github-bot committed Aug 4, 2022
1 parent 39b48b1 commit 54a4fcb
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ target_link_libraries(
react_render_uimanager
react_utils
react_config
reactnativeutilsjni
reactnativejni
rrc_image
rrc_modal
rrc_progressbar
Expand Down
29 changes: 0 additions & 29 deletions ReactAndroid/src/main/jni/react/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

# TODO Those two libraries are building against the same sources
# and should probably be merged
file(GLOB reactnativejni_SRC CONFIGURE_DEPENDS *.cpp)

add_compile_options(
Expand All @@ -17,32 +15,6 @@ add_compile_options(
-std=c++17
-DWITH_INSPECTOR=1)

##########################
### React Native Utils ###
##########################

add_library(
reactnativeutilsjni
SHARED
${reactnativejni_SRC}
)

# TODO This should not be ../../
target_include_directories(reactnativeutilsjni PUBLIC ../../)

target_link_libraries(reactnativeutilsjni
android
callinvokerholder
fb
fbjni
folly_runtime
glog_init
react_render_runtimescheduler
reactnative
runtimeexecutor
yoga
)

######################
### reactnativejni ###
######################
Expand All @@ -67,7 +39,6 @@ target_link_libraries(reactnativejni
logger
react_render_runtimescheduler
reactnative
reactnativeutilsjni
runtimeexecutor
yoga
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ target_link_libraries(rrc_progressbar
react_render_debug
react_render_graphics
react_render_uimanager
reactnativeutilsjni
reactnativejni
rrc_view
yoga
)
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ target_link_libraries(rrc_slider
react_render_imagemanager
react_render_mapbuffer
react_render_uimanager
reactnativeutilsjni
reactnativejni
rrc_image
rrc_view
yoga
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ target_link_libraries(
react_render_debug
react_render_graphics
react_render_uimanager
reactnativeutilsjni
reactnativejni
rrc_view
yoga
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ target_link_libraries(react_render_textlayoutmanager
react_render_telemetry
react_render_uimanager
react_utils
reactnativeutilsjni
reactnativejni
yoga
)

0 comments on commit 54a4fcb

Please sign in to comment.