Skip to content
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

Merge all the remaining .so libraries into libreactnative.so #46059

Closed
wants to merge 4 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,9 @@ internal object NdkConfiguratorUtils {
"**/libfbjni.so",
// Those are prefab libraries we distribute via ReactAndroid
// Due to a bug in AGP, they fire a warning on console as both the JNI
// and the prefab .so files gets considered. See more on:
"**/libfabricjni.so",
"**/libfolly_runtime.so",
"**/libglog.so",
// and the prefab .so files gets considered.
"**/libreactnative.so",
"**/libjsi.so",
"**/libmapbufferjni.so",
"**/libreact_codegen_rncore.so",
"**/libreact_debug.so",
"**/libreact_nativemodule_core.so",
"**/libreact_newarchdefaults.so",
"**/libreact_cxxreactpackage.so",
"**/libreact_render_componentregistry.so",
"**/libreact_render_core.so",
"**/libreact_render_debug.so",
"**/libreact_render_graphics.so",
"**/libreact_render_imagemanager.so",
"**/libreact_render_mapbuffer.so",
"**/libreact_utils.so",
"**/librrc_image.so",
"**/librrc_legacyviewmanagerinterop.so",
"**/librrc_view.so",
"**/libruntimeexecutor.so",
"**/libturbomodulejsijni.so",
"**/libyoga.so",
// AGP will give priority of libc++_shared coming from App modules.
"**/libc++_shared.so",
))
Expand Down Expand Up @@ -144,14 +123,14 @@ internal object NdkConfiguratorUtils {
val includes = mutableListOf<String>()
if (hermesEnabled) {
excludes.add("**/libjsc.so")
excludes.add("**/libjscexecutor.so")
excludes.add("**/libjsctooling.so")
includes.add("**/libhermes.so")
includes.add("**/libhermes_executor.so")
includes.add("**/libhermestooling.so")
} else {
excludes.add("**/libhermes.so")
excludes.add("**/libhermes_executor.so")
excludes.add("**/libhermestooling.so")
includes.add("**/libjsc.so")
includes.add("**/libjscexecutor.so")
includes.add("**/libjsctooling.so")
}
return excludes to includes
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.facebook.react.tests.*
import com.facebook.react.tests.createProject
import com.facebook.react.tests.createTestTask
import java.io.File
import org.assertj.Assert.assertThat
import org.assertj.core.api.Assertions.assertThat
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ class NdkConfiguratorUtilsTest {
fun getPackagingOptionsForVariant_withHermesEnabled() {
val (excludes, includes) = getPackagingOptionsForVariant(hermesEnabled = true)

assertThat(excludes).containsExactly("**/libjsc.so", "**/libjscexecutor.so")
assertThat(includes).doesNotContain("**/libjsc.so", "**/libjscexecutor.so")
assertThat(excludes).containsExactly("**/libjsc.so", "**/libjsctooling.so")
assertThat(includes).doesNotContain("**/libjsc.so", "**/libjsctooling.so")

assertThat(includes).containsExactly("**/libhermes.so", "**/libhermes_executor.so")
assertThat(excludes).doesNotContain("**/libhermes.so", "**/libhermes_executor.so")
assertThat(includes).containsExactly("**/libhermes.so", "**/libhermestooling.so")
assertThat(excludes).doesNotContain("**/libhermes.so", "**/libhermestooling.so")
}

@Test
fun getPackagingOptionsForVariant_withHermesDisabled() {
val (excludes, includes) = getPackagingOptionsForVariant(hermesEnabled = false)

assertThat(excludes).containsExactly("**/libhermes.so", "**/libhermes_executor.so")
assertThat(includes).doesNotContain("**/libhermes.so", "**/libhermes_executor.so")
assertThat(excludes).containsExactly("**/libhermes.so", "**/libhermestooling.so")
assertThat(includes).doesNotContain("**/libhermes.so", "**/libhermestooling.so")

assertThat(includes).containsExactly("**/libjsc.so", "**/libjscexecutor.so")
assertThat(excludes).doesNotContain("**/libjsc.so", "**/libjscexecutor.so")
assertThat(includes).containsExactly("**/libjsc.so", "**/libjsctooling.so")
assertThat(excludes).doesNotContain("**/libjsc.so", "**/libjsctooling.so")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ target_link_libraries(
react_codegen_${libraryName}
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
${
libraryName !== 'rncore'
? 'reactnative'
: 'folly_runtime glog react_debug react_nativemodule_core react_render_componentregistry react_render_core react_render_debug react_render_graphics react_render_imagemanager react_render_mapbuffer react_utils rrc_image rrc_view'
: 'folly_runtime glog react_debug react_nativemodule_core react_render_componentregistry react_render_core react_render_debug react_render_graphics react_render_imagemanager react_render_mapbuffer react_utils rrc_image rrc_view turbomodulejsijni yoga'
}
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ target_link_libraries(
react_codegen_SampleWithUppercaseName
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -132,11 +130,9 @@ target_link_libraries(
react_codegen_complex_objects
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -201,11 +197,9 @@ target_link_libraries(
react_codegen_cxx_only_native_modules
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -277,11 +271,9 @@ target_link_libraries(
react_codegen_empty_native_modules
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -353,11 +345,9 @@ target_link_libraries(
react_codegen_event_emitter_module
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -429,11 +419,9 @@ target_link_libraries(
react_codegen_native_modules_with_type_aliases
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -513,11 +501,9 @@ target_link_libraries(
react_codegen_real_module_example
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -589,11 +575,9 @@ target_link_libraries(
react_codegen_simple_native_modules
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down Expand Up @@ -673,11 +657,9 @@ target_link_libraries(
react_codegen_two_modules_different_files
fbjni
jsi
# We need to link different libraries based on wether we are building rncore or not, that's necessary
# We need to link different libraries based on whether we are building rncore or not, that's necessary
# because we want to break a circular dependency between react_codegen_rncore and reactnative
reactnative
turbomodulejsijni
yoga
)

target_compile_options(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target_link_libraries(
fbjni
jsi
reactnative
yoga
)

target_compile_options(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target_link_libraries(
fbjni
jsi
reactnative
yoga
)

target_compile_options(
Expand Down
Loading
Loading