BUCK 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode")
  2. load(
  3. "//tools/build_defs/oss:rn_defs.bzl",
  4. "ANDROID",
  5. "APPLE",
  6. "CXX",
  7. "YOGA_CXX_TARGET",
  8. "fb_xplat_cxx_test",
  9. "get_apple_compiler_flags",
  10. "get_apple_inspector_flags",
  11. "react_native_xplat_target",
  12. "rn_xplat_cxx_library",
  13. "subdir_glob",
  14. )
  15. APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
  16. rn_xplat_cxx_library(
  17. name = "androidtextinput",
  18. srcs = glob(
  19. ["androidtextinput/**/*.cpp"],
  20. exclude = glob(["tests/**/*.cpp"]),
  21. ),
  22. headers = glob(
  23. ["androidtextinput/**/*.h"],
  24. exclude = glob(["tests/**/*.h"]),
  25. ),
  26. header_namespace = "",
  27. exported_headers = subdir_glob(
  28. [
  29. ("", "*.h"),
  30. ("androidtextinput", "*.h"),
  31. ],
  32. prefix = "react/components/androidtextinput",
  33. ),
  34. compiler_flags = [
  35. "-fexceptions",
  36. "-frtti",
  37. "-std=c++14",
  38. "-Wall",
  39. ],
  40. cxx_tests = [":tests"],
  41. fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
  42. fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
  43. fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
  44. force_static = True,
  45. platforms = (ANDROID, APPLE, CXX),
  46. preprocessor_flags = [
  47. "-DLOG_TAG=\"ReactNative\"",
  48. "-DWITH_FBSYSTRACE=1",
  49. ],
  50. visibility = ["PUBLIC"],
  51. deps = [
  52. "//xplat/fbsystrace:fbsystrace",
  53. "//xplat/folly:container_evicting_cache_map",
  54. "//xplat/folly:headers_only",
  55. "//xplat/folly:memory",
  56. "//xplat/folly:molly",
  57. "//xplat/third-party/glog:glog",
  58. YOGA_CXX_TARGET,
  59. react_native_xplat_target("utils:utils"),
  60. react_native_xplat_target("fabric/attributedstring:attributedstring"),
  61. react_native_xplat_target("fabric/core:core"),
  62. react_native_xplat_target("fabric/debug:debug"),
  63. react_native_xplat_target("fabric/graphics:graphics"),
  64. react_native_xplat_target("fabric/textlayoutmanager:textlayoutmanager"),
  65. react_native_xplat_target("fabric/components/text:text"),
  66. react_native_xplat_target("fabric/components/view:view"),
  67. react_native_xplat_target("fabric/components/image:image"),
  68. react_native_xplat_target("fabric/uimanager:uimanager"),
  69. react_native_xplat_target("fabric/imagemanager:imagemanager"),
  70. ],
  71. )
  72. fb_xplat_cxx_test(
  73. name = "tests",
  74. srcs = glob(["tests/**/*.cpp"]),
  75. headers = glob(["tests/**/*.h"]),
  76. compiler_flags = [
  77. "-fexceptions",
  78. "-frtti",
  79. "-std=c++14",
  80. "-Wall",
  81. ],
  82. contacts = ["oncall+react_native@xmail.facebook.com"],
  83. platforms = (
  84. # `Apple` and `Android` flavors are disabled because the module depends on `textlayoutmanager` which requires real an Emulator/Simulator to run.
  85. # At the same time, the code of tests does not rely on the simulator capabilities and it would be wasteful to add `fbandroid_use_instrumentation_test = True`.
  86. # (Beware of this option though.)
  87. # ANDROID,
  88. # APPLE,
  89. CXX
  90. ),
  91. deps = [
  92. ":androidtextinput",
  93. "//xplat/folly:molly",
  94. "//xplat/third-party/gmock:gtest",
  95. ],
  96. )