1load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "APPLE", "FBJNI_TARGET", "get_objc_arc_preprocessor_flags", "get_preprocessor_flags_for_build_mode", "get_static_library_ios_flags", "react_native_dep", "react_native_target", "react_native_xplat_target", "rn_android_library", "rn_xplat_cxx_library", "subdir_glob")
2
3rn_xplat_cxx_library(
4    name = "samples",
5    srcs = glob(
6        ["ReactCommon/**/*.cpp"],
7    ),
8    header_namespace = "",
9    exported_headers = subdir_glob(
10        [
11            ("ReactCommon", "*.h"),
12        ],
13        prefix = "ReactCommon",
14    ),
15    fbandroid_deps = [
16        react_native_target("jni/react/jni:jni"),
17        FBJNI_TARGET,
18    ],
19    fbandroid_exported_headers = subdir_glob(
20        [
21            ("platform/android/ReactCommon", "*.h"),
22        ],
23        prefix = "ReactCommon",
24    ),
25    fbandroid_srcs = glob(
26        [
27            "platform/android/**/*.cpp",
28        ],
29    ),
30    fbobjc_compiler_flags = [
31        "-fobjc-arc-exceptions",
32    ],
33    fbobjc_inherited_buck_flags = get_static_library_ios_flags(),
34    fbobjc_preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
35    force_static = True,
36    ios_deps = [
37        "//xplat/FBBaseLite:FBBaseLite",
38        "//xplat/js/react-native-github:RCTCxxBridge",
39        "//xplat/js/react-native-github:RCTCxxModule",
40        "//xplat/js/react-native-github:RCTLinking",
41        "//xplat/js/react-native-github:RCTPushNotification",
42        "//xplat/js/react-native-github:ReactInternal",
43    ],
44    ios_exported_headers = subdir_glob(
45        [
46            ("platform/ios", "*.h"),
47        ],
48        prefix = "ReactCommon",
49    ),
50    ios_frameworks = [
51        "$SDKROOT/System/Library/Frameworks/Foundation.framework",
52    ],
53    ios_srcs = glob(
54        [
55            "platform/ios/**/*.cpp",
56            "platform/ios/**/*.mm",
57        ],
58    ),
59    labels = [
60        "pfh:ReactNative_CommonInfrastructurePlaceholder",
61        "supermodule:xplat/default/public.react_native.infra",
62    ],
63    platforms = (ANDROID, APPLE),
64    preprocessor_flags = [
65        "-DLOG_TAG=\"ReactNative\"",
66        "-DWITH_FBSYSTRACE=1",
67    ],
68    visibility = [
69        "PUBLIC",
70    ],
71    deps = [
72        react_native_xplat_target("cxxreact:module"),
73    ],
74    exported_deps = [
75        "//xplat/jsi:jsi",
76        react_native_xplat_target("react/nativemodule/core:core"),
77    ],
78)
79
80rn_android_library(
81    name = "impl",
82    srcs = glob(["platform/android/*.java"]),
83    autoglob = False,
84    language = "JAVA",
85    required_for_source_only_abi = True,
86    visibility = [
87        "PUBLIC",
88    ],
89    deps = [
90        "//fbandroid/java/com/facebook/debug/log:log",
91        react_native_dep("third-party/java/jsr-305:jsr-305"),
92        react_native_dep("third-party/java/jsr-330:jsr-330"),
93        react_native_target("java/com/facebook/react/bridge:bridge"),
94        react_native_target("java/com/facebook/react/common:common"),
95        react_native_target("java/com/facebook/react/module/annotations:annotations"),
96        ":samples",
97    ],
98    exported_deps = [
99        react_native_target("java/com/facebook/react/turbomodule/core/interfaces:interfaces"),
100    ],
101)
102