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

'[skip ci] [RN][Android] First round of prefab cleanup #46057

Closed
wants to merge 2 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 @@ -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
159 changes: 31 additions & 128 deletions packages/react-native/ReactAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,58 +80,7 @@ val preparePrefab by
// migrate one library at a time.
input.set(
listOf(
PrefabPreprocessingEntry(
"turbomodulejsijni", Pair("src/main/jni/react/turbomodule", "")),
PrefabPreprocessingEntry(
"react_render_animations",
Pair("../ReactCommon/react/renderer/animations/", "react/renderer/animations/")),
PrefabPreprocessingEntry(
"react_render_core",
Pair("../ReactCommon/react/renderer/core/", "react/renderer/core/")),
PrefabPreprocessingEntry(
"react_render_graphics",
listOf(
Pair("../ReactCommon/react/renderer/graphics/", "react/renderer/graphics/"),
Pair("../ReactCommon/react/renderer/graphics/platform/android/", ""),
)),
PrefabPreprocessingEntry(
"react_render_consistency",
Pair(
"../ReactCommon/react/renderer/consistency/", "react/renderer/consistency/")),
PrefabPreprocessingEntry(
"react_featureflags",
Pair("../ReactCommon/react/featureflags/", "react/featureflags/")),
PrefabPreprocessingEntry(
"react_performance_timeline",
Pair(
"../ReactCommon/react/performance/timeline/", "react/performance/timeline/")),
PrefabPreprocessingEntry(
"react_render_observers_events",
Pair(
"../ReactCommon/react/renderer/observers/events/",
"react/renderer/observers/events/")),
PrefabPreprocessingEntry(
"rrc_root",
Pair(
"../ReactCommon/react/renderer/components/root/",
"react/renderer/components/root/")),
PrefabPreprocessingEntry("jsi", Pair("../ReactCommon/jsi/", "")),
PrefabPreprocessingEntry(
"react_render_mapbuffer",
Pair("../ReactCommon/react/renderer/mapbuffer/", "react/renderer/mapbuffer/")),
PrefabPreprocessingEntry(
"react_render_textlayoutmanager",
listOf(
Pair(
"../ReactCommon/react/renderer/textlayoutmanager/",
"react/renderer/textlayoutmanager/"),
Pair("../ReactCommon/react/renderer/textlayoutmanager/platform/android/", ""),
)),
PrefabPreprocessingEntry(
"yoga",
listOf(
Pair("../ReactCommon/yoga/", ""),
Pair("src/main/jni/first-party/yogajni/jni", ""))),
PrefabPreprocessingEntry(
"folly_runtime",
listOf(
Expand Down Expand Up @@ -191,11 +140,6 @@ val preparePrefab by
"react/renderer/imagemanager/"),
Pair("../ReactCommon/react/renderer/imagemanager/platform/cxx/", ""),
)),
PrefabPreprocessingEntry(
"rrc_image",
Pair(
"../ReactCommon/react/renderer/components/image/",
"react/renderer/components/image/")),
// These prefab targets are used by Expo & Reanimated
PrefabPreprocessingEntry(
"hermes_executor",
Expand All @@ -208,18 +152,6 @@ val preparePrefab by
// "jscexecutor" is statically linking against "jscruntime"
// Here we expose only the headers that we know are needed.
Pair("../ReactCommon/jsc/", "jsc/")),
PrefabPreprocessingEntry(
"react_render_uimanager",
Pair("../ReactCommon/react/renderer/uimanager/", "react/renderer/uimanager/"),
),
PrefabPreprocessingEntry(
"react_render_scheduler",
Pair("../ReactCommon/react/renderer/scheduler/", "react/renderer/scheduler/"),
),
PrefabPreprocessingEntry(
"react_render_mounting",
Pair("../ReactCommon/react/renderer/mounting/", "react/renderer/mounting/"),
),
PrefabPreprocessingEntry(
"reactnativejni",
listOf(
Expand All @@ -243,10 +175,20 @@ val preparePrefab by
Pair("src/main/jni/react/turbomodule", ""),
// react_codegen_rncore
Pair(File(buildDir, "generated/source/codegen/jni/").absolutePath, ""),
// react_featureflags
Pair("../ReactCommon/react/featureflags/", "react/featureflags/"),
// react_render_animations
Pair(
"../ReactCommon/react/renderer/animations/",
"react/renderer/animations/"),
// react_render_componentregistry
Pair(
"../ReactCommon/react/renderer/componentregistry/",
"react/renderer/componentregistry/"),
// react_render_consistency
Pair(
"../ReactCommon/react/renderer/consistency/",
"react/renderer/consistency/"),
// react_render_core
Pair("../ReactCommon/react/renderer/core/", "react/renderer/core/"),
// react_debug
Expand All @@ -261,8 +203,12 @@ val preparePrefab by
"../ReactCommon/react/renderer/imagemanager/",
"react/renderer/imagemanager/"),
Pair("../ReactCommon/react/renderer/imagemanager/platform/cxx/", ""),
// react_render_mapbuffer
Pair("../ReactCommon/react/renderer/mapbuffer/", "react/renderer/mapbuffer/"),
// react_render_mounting
Pair("../ReactCommon/react/renderer/mounting/", "react/renderer/mounting/"),
// react_render_scheduler
Pair("../ReactCommon/react/renderer/scheduler/", "react/renderer/scheduler/"),
// react_render_uimanager
Pair("../ReactCommon/react/renderer/uimanager/", "react/renderer/uimanager/"),
// react_utils
Pair("../ReactCommon/react/utils/", "react/utils/"),
// rrc_image
Expand All @@ -274,6 +220,10 @@ val preparePrefab by
"../ReactCommon/react/renderer/components/view/",
"react/renderer/components/view/"),
Pair("../ReactCommon/react/renderer/components/view/platform/android/", ""),
// rrc_root
Pair(
"../ReactCommon/react/renderer/components/root/",
"react/renderer/components/root/"),
// runtimeexecutor
Pair("../ReactCommon/runtimeexecutor/", ""),
// react_render_textlayoutmanager
Expand Down Expand Up @@ -333,6 +283,17 @@ val preparePrefab by
Pair("src/main/jni/react/jni", "react/jni/"),
// react_cxxreactpackage
Pair("src/main/jni/react/runtime/cxxreactpackage", ""),
// react_performance_timeline
Pair(
"../ReactCommon/react/performance/timeline/",
"react/performance/timeline/"),
// react_render_observers_events
Pair(
"../ReactCommon/react/renderer/observers/events/",
"react/renderer/observers/events/"),
// yoga
Pair("../ReactCommon/yoga/", ""),
Pair("src/main/jni/first-party/yogajni/jni", ""),
)),
))
outputDir.set(prefabHeadersDir)
Expand Down Expand Up @@ -614,28 +575,12 @@ android {
"uimanagerjni",
"jscinstance",
"react_devsupportjni",
"react_render_core",
// prefab targets
"reactnativejni",
"turbomodulejsijni",
"react_featureflags",
"react_performance_timeline",
"react_utils",
"react_render_componentregistry",
"react_render_animations",
"react_render_consistency",
"react_render_dom",
"react_render_graphics",
"react_render_observers_events",
"rrc_image",
"rrc_root",
"jsi",
"react_render_mapbuffer",
"react_render_textlayoutmanager",
"yoga",
"react_render_uimanager",
"react_render_scheduler",
"react_render_mounting",
"hermes_executor",
"jscexecutor",
"jsinspector",
Expand Down Expand Up @@ -717,49 +662,7 @@ android {
}

prefab {
create("turbomodulejsijni") {
headers = File(prefabHeadersDir, "turbomodulejsijni").absolutePath
}
create("react_render_animations") {
headers = File(prefabHeadersDir, "react_render_animations").absolutePath
}
create("react_render_core") {
headers = File(prefabHeadersDir, "react_render_core").absolutePath
}
create("react_render_graphics") {
headers = File(prefabHeadersDir, "react_render_graphics").absolutePath
}
create("react_render_consistency") {
headers = File(prefabHeadersDir, "react_render_consistency").absolutePath
}
create("react_featureflags") {
headers = File(prefabHeadersDir, "react_featureflags").absolutePath
}
create("react_performance_timeline") {
headers = File(prefabHeadersDir, "react_performance_timeline").absolutePath
}
create("react_render_observers_events") {
headers = File(prefabHeadersDir, "react_render_observers_events").absolutePath
}
create("rrc_image") { headers = File(prefabHeadersDir, "rrc_image").absolutePath }
create("rrc_root") { headers = File(prefabHeadersDir, "rrc_root").absolutePath }
create("jsi") { headers = File(prefabHeadersDir, "jsi").absolutePath }
create("react_render_mapbuffer") {
headers = File(prefabHeadersDir, "react_render_mapbuffer").absolutePath
}
create("react_render_textlayoutmanager") {
headers = File(prefabHeadersDir, "react_render_textlayoutmanager").absolutePath
}
create("yoga") { headers = File(prefabHeadersDir, "yoga").absolutePath }
create("react_render_uimanager") {
headers = File(prefabHeadersDir, "react_render_uimanager").absolutePath
}
create("react_render_scheduler") {
headers = File(prefabHeadersDir, "react_render_scheduler").absolutePath
}
create("react_render_mounting") {
headers = File(prefabHeadersDir, "react_render_mounting").absolutePath
}
create("reactnativejni") { headers = File(prefabHeadersDir, "reactnativejni").absolutePath }
create("hermes_executor") { headers = File(prefabHeadersDir, "hermes_executor").absolutePath }
create("jscexecutor") { headers = File(prefabHeadersDir, "jscexecutor").absolutePath }
Expand Down
Loading
Loading