Skip to content

Commit 1e212f9

Browse files
andrewdacenkofacebook-github-bot
authored andcommitted
Add remaining dependencies (facebook#52202)
Summary: Pull Request resolved: facebook#52202 Changelog: [Internal] Build fantom_tester for OSS Reviewed By: mdvacca Differential Revision: D76928253 fbshipit-source-id: a95e8751326f45a25cd512b7a5d05260b37a0305
1 parent 4f1f72e commit 1e212f9

14 files changed

Lines changed: 342 additions & 217 deletions

File tree

packages/react-native/ReactCommon/react/renderer/observers/events/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ target_link_libraries(react_renderer_observers_events
2020
react_renderer_runtimescheduler
2121
react_featureflags
2222
react_renderer_uimanager
23-
react_utils)
23+
react_utils
24+
rrc_view)
2425
target_compile_reactnative_options(react_renderer_observers_events PRIVATE)
2526
target_compile_options(react_renderer_observers_events PRIVATE -Wpedantic)

packages/react-native/gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fmt="11.0.2"
4747
folly="2024.11.18.00"
4848
glog="0.3.5"
4949
gflags="2.2.0"
50+
nlohmannjson="3.11.2"
5051

5152
[libraries]
5253
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" }

private/react-native-fantom/build.gradle.kts

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ plugins {
1515
alias(libs.plugins.download)
1616
}
1717

18+
val FOLLY_VERSION = libs.versions.folly.get()
1819
val GFLAGS_VERSION = libs.versions.gflags.get()
20+
val NLOHMANNJSON_VERSION = libs.versions.nlohmannjson.get()
1921

2022
val buildDir = project.layout.buildDirectory.get().asFile
2123
val downloadsDir =
@@ -27,13 +29,28 @@ val downloadsDir =
2729
val thirdParty = File("$buildDir/third-party")
2830
val reactNativeRootDir = projectDir.parentFile.parentFile
2931
val reactAndroidBuildDir = File("$reactNativeRootDir/packages/react-native/ReactAndroid/build")
32+
val reactAndroidDownloasdDir =
33+
File("$reactNativeRootDir/packages/react-native/ReactAndroid/build/downloads")
3034

3135
val createNativeDepsDirectories by
3236
tasks.registering {
3337
downloadsDir.mkdirs()
3438
thirdParty.mkdirs()
3539
}
3640

41+
val downloadFollyDest = File(reactAndroidDownloasdDir, "folly-${FOLLY_VERSION}.tar.gz")
42+
43+
val prepareFolly by
44+
tasks.registering(Copy::class) {
45+
dependsOn(listOf(":packages:react-native:ReactAndroid:downloadFolly"))
46+
from(tarTree(downloadFollyDest))
47+
from("tester/third-party/folly/")
48+
include("folly-${FOLLY_VERSION}/folly/**/*", "CMakeLists.txt")
49+
eachFile { path = path.substringAfter("/") }
50+
includeEmptyDirs = false
51+
into("$thirdParty/folly")
52+
}
53+
3754
val downloadGflagsDest = File(downloadsDir, "gflags-${GFLAGS_VERSION}.tar.gz")
3855
val downloadGflags by
3956
tasks.registering(Download::class) {
@@ -55,16 +72,42 @@ val prepareGflags by
5572
outputDir.set(File(thirdParty, "gflags"))
5673
}
5774

58-
var codegenSrcDir = File("$reactAndroidBuildDir/generated/source/codegen/jni/react")
59-
var codegenOutDir = File("$buildDir/codegen/react")
75+
val downloadNlohmannJsonDest = File(downloadsDir, "nlohmann_json-${NLOHMANNJSON_VERSION}.tar.gz")
76+
val downloadNlohmannJson by
77+
tasks.registering(Download::class) {
78+
dependsOn(createNativeDepsDirectories)
79+
src("https://github.com/nlohmann/json/archive/v${NLOHMANNJSON_VERSION}.tar.gz")
80+
onlyIfModified(true)
81+
overwrite(false)
82+
retries(5)
83+
quiet(true)
84+
dest(downloadNlohmannJsonDest)
85+
}
86+
87+
val prepareNlohmannJson by
88+
tasks.registering(Copy::class) {
89+
dependsOn(listOf(downloadNlohmannJson))
90+
from(tarTree(downloadNlohmannJsonDest))
91+
from("tester/third-party/nlohmann_json/")
92+
include(
93+
"json-${NLOHMANNJSON_VERSION}/src/**/*",
94+
"json-${NLOHMANNJSON_VERSION}/include/**/*",
95+
"CMakeLists.txt")
96+
eachFile { path = path.substringAfter("/") }
97+
includeEmptyDirs = false
98+
into("$thirdParty/nlohmann_json")
99+
}
100+
101+
var codegenSrcDir = File("$reactAndroidBuildDir/generated/source/codegen/jni")
102+
var codegenOutDir = File("$buildDir/codegen")
60103
val prepareRNCodegen by
61104
tasks.registering(Copy::class) {
62105
dependsOn(":packages:react-native:ReactAndroid:generateCodegenArtifactsFromSchema")
63106
from(codegenSrcDir)
64-
from("tester/codegen/react")
65-
include(
66-
"**/FBReactNativeSpecJSI.h", "**/FBReactNativeSpecJSI-generated.cpp", "CMakeLists.txt")
107+
from("tester/codegen")
108+
include("react/**/*.h", "react/**/*.cpp", "CMakeLists.txt")
67109
includeEmptyDirs = false
110+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
68111
into(codegenOutDir)
69112
}
70113

@@ -80,7 +123,13 @@ val prepareNative3pDependencies by
80123
tasks.registering {
81124
dependsOn(
82125
prepareGflags,
83-
":packages:react-native:ReactAndroid:prepareNative3pDependencies",
126+
prepareNlohmannJson,
127+
prepareFolly,
128+
":packages:react-native:ReactAndroid:prepareBoost",
129+
":packages:react-native:ReactAndroid:prepareDoubleConversion",
130+
":packages:react-native:ReactAndroid:prepareFastFloat",
131+
":packages:react-native:ReactAndroid:prepareFmt",
132+
":packages:react-native:ReactAndroid:prepareGlog",
84133
)
85134
}
86135

private/react-native-fantom/tester/CMakeLists.txt

Lines changed: 144 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(CMAKE_VERBOSE_MAKEFILE on)
88

99
project(fantom_tester)
1010
find_library(LIB_HERMES libhermes
11+
NAMES hermes
1112
HINTS ${REACT_ANDROID_DIR}/hermes-engine/build/hermes/API/hermes
1213
REQUIRED)
1314
# Ensure the library path is correct and the library exists
@@ -26,6 +27,8 @@ else()
2627
add_library(hermes-engine::libhermes ALIAS ${LIB_HERMES})
2728
endif()
2829

30+
find_package(OpenSSL REQUIRED)
31+
2932
include_directories(${REACT_ANDROID_DIR}/hermes-engine/build/prefab-headers)
3033

3134
include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake)
@@ -42,16 +45,20 @@ add_react_third_party_ndk_subdir(glog)
4245
add_react_third_party_ndk_subdir(double-conversion)
4346
add_react_third_party_ndk_subdir(fast_float)
4447
add_react_third_party_ndk_subdir(fmt)
45-
add_react_third_party_ndk_subdir(folly)
48+
add_fantom_third_party_subdir(folly)
4649
add_fantom_third_party_subdir(gflags)
50+
add_fantom_third_party_subdir(nlohmann_json)
51+
52+
add_subdirectory(${FANTOM_CODEGEN_DIR} codegen)
4753

48-
add_fantom_codegen_subdir(react)
54+
add_library(glog_init INTERFACE)
4955

50-
#add_react_common_subdir(hermes/executor)
51-
#add_react_common_subdir(hermes/inspector-modern)
52-
#add_react_common_subdir(react/runtime/hermes)
5356
add_react_common_subdir(callinvoker)
5457
add_react_common_subdir(cxxreact)
58+
add_react_common_subdir(devtoolsruntimesettings)
59+
add_react_common_subdir(hermes/executor)
60+
add_react_common_subdir(hermes/inspector-modern)
61+
add_react_common_subdir(jserrorhandler)
5562
add_react_common_subdir(jsi)
5663
add_react_common_subdir(jsiexecutor)
5764
add_react_common_subdir(jsinspector-modern)
@@ -64,32 +71,102 @@ add_react_common_subdir(oscompat)
6471
add_react_common_subdir(react/bridging)
6572
add_react_common_subdir(react/debug)
6673
add_react_common_subdir(react/featureflags)
74+
add_react_common_subdir(react/nativemodule/core)
75+
add_react_common_subdir(react/nativemodule/cputime)
76+
add_react_common_subdir(react/nativemodule/defaults)
77+
add_react_common_subdir(react/nativemodule/devtoolsruntimesettings)
78+
add_react_common_subdir(react/nativemodule/dom)
79+
add_react_common_subdir(react/nativemodule/fantomtestspecificmethods)
80+
add_react_common_subdir(react/nativemodule/featureflags)
81+
add_react_common_subdir(react/nativemodule/idlecallbacks)
82+
add_react_common_subdir(react/nativemodule/intersectionobserver)
83+
add_react_common_subdir(react/nativemodule/microtasks)
84+
add_react_common_subdir(react/nativemodule/mutationobserver)
85+
add_react_common_subdir(react/nativemodule/webperformance)
6786
add_react_common_subdir(react/performance/timeline)
87+
add_react_common_subdir(react/renderer/attributedstring)
88+
add_react_common_subdir(react/renderer/bridging)
89+
add_react_common_subdir(react/renderer/componentregistry)
90+
add_react_common_subdir(react/renderer/componentregistry/native)
91+
add_react_common_subdir(react/renderer/components/image)
92+
add_react_common_subdir(react/renderer/components/legacyviewmanagerinterop)
93+
add_react_common_subdir(react/renderer/components/modal)
94+
add_react_common_subdir(react/renderer/components/root)
95+
add_react_common_subdir(react/renderer/components/scrollview)
96+
add_react_common_subdir(react/renderer/components/text)
97+
add_react_common_subdir(react/renderer/components/view)
98+
add_react_common_subdir(react/renderer/consistency)
99+
add_react_common_subdir(react/renderer/core)
100+
add_react_common_subdir(react/renderer/css)
101+
add_react_common_subdir(react/renderer/debug)
102+
add_react_common_subdir(react/renderer/dom)
103+
add_react_common_subdir(react/renderer/graphics)
104+
add_react_common_subdir(react/renderer/imagemanager)
105+
add_react_common_subdir(react/renderer/leakchecker)
106+
add_react_common_subdir(react/renderer/mapbuffer)
107+
add_react_common_subdir(react/renderer/mounting)
108+
add_react_common_subdir(react/renderer/observers/events)
109+
add_react_common_subdir(react/renderer/observers/intersection)
110+
add_react_common_subdir(react/renderer/observers/mutation)
111+
add_react_common_subdir(react/renderer/runtimescheduler)
112+
add_react_common_subdir(react/renderer/scheduler)
113+
add_react_common_subdir(react/renderer/telemetry)
114+
add_react_common_subdir(react/renderer/textlayoutmanager)
115+
add_react_common_subdir(react/renderer/uimanager)
116+
add_react_common_subdir(react/renderer/uimanager/consistency)
117+
add_react_common_subdir(react/runtime)
118+
add_react_common_subdir(react/runtime/hermes)
68119
add_react_common_subdir(react/timing)
120+
add_react_common_subdir(react/utils)
69121
add_react_common_subdir(reactperflogger)
70122
add_react_common_subdir(runtimeexecutor)
71123
add_react_common_subdir(yoga)
72124

73-
add_fantom_react_common_subdir(react/nativemodule/core)
74-
add_fantom_react_common_subdir(react/utils)
75-
add_fantom_react_common_subdir(react/runtime/hermes)
76-
add_fantom_react_common_subdir(hermes/inspector-modern)
77-
add_fantom_react_common_subdir(hermes/executor)
125+
# This is a hack to make sure that libraries that depend on jni yoga are linked
126+
add_library(yoga ALIAS yogacore)
127+
128+
add_react_cxx_platform_subdir(react/coremodules)
129+
add_react_cxx_platform_subdir(react/devsupport)
130+
add_react_cxx_platform_subdir(react/http)
131+
add_react_cxx_platform_subdir(react/io)
132+
add_react_cxx_platform_subdir(react/logging)
133+
add_react_cxx_platform_subdir(react/nativemodule)
134+
add_react_cxx_platform_subdir(react/profiling)
135+
add_react_cxx_platform_subdir(react/renderer/animated)
136+
add_react_cxx_platform_subdir(react/renderer/scheduler)
137+
add_react_cxx_platform_subdir(react/renderer/uimanager)
138+
add_react_cxx_platform_subdir(react/runtime)
139+
add_react_cxx_platform_subdir(react/threading)
140+
add_react_cxx_platform_subdir(react/utils)
78141

79-
file(GLOB SOURCES "src/*.cpp" "src/*.h")
142+
file(GLOB SOURCES src/*.cpp src/**/*.cpp)
80143
add_executable(fantom_tester ${SOURCES})
81144

145+
target_include_directories(fantom_tester PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
146+
82147
target_link_libraries(fantom_tester
83148
PRIVATE
84-
${LIB_HERMES}
149+
# third-party
85150
boost
86-
bridgelesshermes
87-
callinvoker
151+
double-conversion
152+
fmt
88153
folly_runtime
89154
gflags
90155
glog
156+
157+
# hermes
158+
hermes-engine::libhermes
159+
160+
# codegen
161+
react_codegen_rncore
162+
163+
# ReactCommon
164+
bridgeless
165+
bridgelesshermes
166+
devtoolsruntimesettings
91167
hermes_executor_common
92168
hermes_inspector_modern
169+
jserrorhandler
93170
jsi
94171
jsinspector
95172
jsinspector_cdp
@@ -100,17 +177,68 @@ target_link_libraries(fantom_tester
100177
logger
101178
oscompat
102179
react_bridging
103-
react_codegen_rncore
104180
react_cxxreact
105181
react_debug
106182
react_featureflags
107183
react_nativemodule_core
184+
react_nativemodule_cpu
185+
react_nativemodule_defaults
186+
react_nativemodule_devtoolsruntimesettings
187+
react_nativemodule_dom
188+
react_nativemodule_fantomspecificmethods
189+
react_nativemodule_featureflags
190+
react_nativemodule_idlecallbacks
191+
react_nativemodule_intersectionobserver
192+
react_nativemodule_microtasks
193+
react_nativemodule_mutationobserver
194+
react_nativemodule_webperformance
108195
react_performance_timeline
109-
react_timing
196+
react_renderer_attributedstring
197+
react_renderer_componentregistry
198+
react_renderer_consistency
199+
react_renderer_core
200+
react_renderer_css
201+
react_renderer_debug
202+
react_renderer_dom
203+
react_renderer_graphics
204+
react_renderer_imagemanager
205+
react_renderer_leakchecker
206+
react_renderer_mapbuffer
207+
react_renderer_mounting
208+
react_renderer_observers_events
209+
react_renderer_observers_intersection
210+
react_renderer_observers_mutation
211+
react_renderer_runtimescheduler
212+
react_renderer_scheduler
213+
react_renderer_telemetry
214+
react_renderer_textlayoutmanager
215+
react_renderer_uimanager
216+
react_renderer_uimanager_consistency
110217
react_utils
111218
reactperflogger
219+
rrc_legacyviewmanagerinterop
220+
rrc_image
221+
rrc_modal
222+
rrc_native
223+
rrc_root
224+
rrc_scrollview
225+
rrc_text
226+
rrc_view
112227
runtimeexecutor
113228
yogacore
229+
230+
# ReactCxxPlatform
231+
react_cxx_platform_react_coremodules
232+
react_cxx_platform_react_devsupport
233+
react_cxx_platform_react_http
234+
react_cxx_platform_react_io
235+
react_cxx_platform_react_logging
236+
react_cxx_platform_react_profiling
237+
react_cxx_platform_react_renderer_animated
238+
react_cxx_platform_react_renderer_scheduler
239+
react_cxx_platform_react_runtime
240+
react_cxx_platform_react_threading
241+
react_cxx_platform_react_utils
114242
)
115243

116244
target_compile_options(fantom_tester

private/react-native-fantom/tester/ReactCommon/hermes/executor/CMakeLists.txt

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)