React-Fabric.podspec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # Copyright (c) Facebook, Inc. and its affiliates.
  2. #
  3. # This source code is licensed under the MIT license found in the
  4. # LICENSE file in the root directory of this source tree.
  5. require "json"
  6. package = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
  7. version = package['version']
  8. source = { :git => 'https://github.com/facebook/react-native.git' }
  9. if version == '1000.0.0'
  10. # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
  11. source[:commit] = `git rev-parse HEAD`.strip
  12. else
  13. source[:tag] = "v#{version}"
  14. end
  15. folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
  16. folly_version = '2020.01.13.00'
  17. folly_dep_name = 'Folly/Fabric'
  18. boost_compiler_flags = '-Wno-documentation'
  19. Pod::Spec.new do |s|
  20. s.name = "React-Fabric"
  21. s.version = version
  22. s.summary = "Fabric for React Native."
  23. s.homepage = "https://reactnative.dev/"
  24. s.license = package["license"]
  25. s.author = "Facebook, Inc. and its affiliates"
  26. s.platforms = { :ios => "10.0", :tvos => "10.0" }
  27. s.source = source
  28. s.prepare_command = File.read("../scripts/generate-rncore.sh")
  29. s.source_files = "dummyFile.cpp"
  30. s.library = "stdc++"
  31. s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES",
  32. "CLANG_CXX_LANGUAGE_STANDARD" => "c++14" }
  33. s.dependency folly_dep_name, folly_version
  34. s.dependency "React-graphics", version
  35. s.dependency "React-jsiexecutor", version
  36. s.dependency "RCTRequired", version
  37. s.dependency "RCTTypeSafety", version
  38. s.dependency "ReactCommon/turbomodule/core", version
  39. s.dependency "React-jsi", version
  40. s.subspec "attributedstring" do |ss|
  41. ss.dependency folly_dep_name, folly_version
  42. ss.compiler_flags = folly_compiler_flags
  43. ss.source_files = "fabric/attributedstring/**/*.{m,mm,cpp,h}"
  44. ss.exclude_files = "**/tests/*"
  45. ss.header_dir = "react/attributedstring"
  46. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  47. end
  48. s.subspec "better" do |ss|
  49. ss.dependency folly_dep_name, folly_version
  50. ss.compiler_flags = folly_compiler_flags
  51. ss.source_files = "better/**/*.{m,mm,cpp,h}"
  52. ss.exclude_files = "**/tests/*"
  53. ss.header_dir = "better"
  54. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  55. end
  56. s.subspec "config" do |ss|
  57. ss.source_files = "config/*.{m,mm,cpp,h}"
  58. ss.header_dir = "react/config"
  59. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" }
  60. end
  61. s.subspec "core" do |ss|
  62. ss.dependency folly_dep_name, folly_version
  63. ss.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
  64. ss.source_files = "fabric/core/**/*.{m,mm,cpp,h}"
  65. ss.exclude_files = "**/tests/**/*"
  66. ss.header_dir = "react/core"
  67. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  68. end
  69. s.subspec "components" do |ss|
  70. ss.subspec "activityindicator" do |sss|
  71. sss.dependency folly_dep_name, folly_version
  72. sss.compiler_flags = folly_compiler_flags
  73. sss.source_files = "fabric/components/activityindicator/**/*.{m,mm,cpp,h}"
  74. sss.exclude_files = "**/tests/*"
  75. sss.header_dir = "react/components/activityindicator"
  76. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  77. end
  78. ss.subspec "image" do |sss|
  79. sss.dependency folly_dep_name, folly_version
  80. sss.compiler_flags = folly_compiler_flags
  81. sss.source_files = "fabric/components/image/**/*.{m,mm,cpp,h}"
  82. sss.exclude_files = "**/tests/*"
  83. sss.header_dir = "react/components/image"
  84. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  85. end
  86. ss.subspec "modal" do |sss|
  87. sss.dependency folly_dep_name, folly_version
  88. sss.compiler_flags = folly_compiler_flags
  89. sss.source_files = "fabric/components/modal/**/*.{m,mm,cpp,h}"
  90. sss.exclude_files = "**/tests/*"
  91. sss.header_dir = "react/components/modal"
  92. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  93. end
  94. ss.subspec "rncore" do |sss|
  95. sss.dependency folly_dep_name, folly_version
  96. sss.compiler_flags = folly_compiler_flags
  97. sss.source_files = "fabric/components/rncore/*.{m,mm,cpp,h}"
  98. sss.exclude_files = "**/tests/*", "fabric/components/rncore/*Tests.{h,cpp}"
  99. sss.header_dir = "react/components/rncore"
  100. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  101. end
  102. ss.subspec "root" do |sss|
  103. sss.dependency folly_dep_name, folly_version
  104. sss.compiler_flags = folly_compiler_flags
  105. sss.source_files = "fabric/components/root/**/*.{m,mm,cpp,h}"
  106. sss.exclude_files = "**/tests/*"
  107. sss.header_dir = "react/components/root"
  108. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  109. end
  110. ss.subspec "scrollview" do |sss|
  111. sss.dependency folly_dep_name, folly_version
  112. sss.compiler_flags = folly_compiler_flags
  113. sss.source_files = "fabric/components/scrollview/**/*.{m,mm,cpp,h}"
  114. sss.exclude_files = "**/tests/*"
  115. sss.header_dir = "react/components/scrollview"
  116. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  117. end
  118. ss.subspec "slider" do |sss|
  119. sss.dependency folly_dep_name, folly_version
  120. sss.compiler_flags = folly_compiler_flags
  121. sss.source_files = "fabric/components/slider/**/*.{m,mm,cpp,h}"
  122. sss.exclude_files = "**/tests/*",
  123. "**/android/*"
  124. sss.header_dir = "react/components/slider"
  125. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  126. end
  127. ss.subspec "text" do |sss|
  128. sss.dependency folly_dep_name, folly_version
  129. sss.compiler_flags = folly_compiler_flags
  130. sss.source_files = "fabric/components/text/**/*.{m,mm,cpp,h}"
  131. sss.exclude_files = "**/tests/*"
  132. sss.header_dir = "react/components/text"
  133. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  134. end
  135. ss.subspec "view" do |sss|
  136. sss.dependency folly_dep_name, folly_version
  137. sss.dependency "Yoga"
  138. sss.compiler_flags = folly_compiler_flags
  139. sss.source_files = "fabric/components/view/**/*.{m,mm,cpp,h}"
  140. sss.exclude_files = "**/tests/*"
  141. sss.header_dir = "react/components/view"
  142. sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  143. end
  144. end
  145. s.subspec "debug" do |ss|
  146. ss.dependency folly_dep_name, folly_version
  147. ss.compiler_flags = folly_compiler_flags
  148. ss.source_files = "fabric/debug/**/*.{m,mm,cpp,h}"
  149. ss.exclude_files = "**/tests/*"
  150. ss.header_dir = "react/debug"
  151. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  152. end
  153. s.subspec "imagemanager" do |ss|
  154. ss.dependency "React-RCTImage", version
  155. ss.dependency folly_dep_name, folly_version
  156. ss.compiler_flags = folly_compiler_flags
  157. ss.source_files = "fabric/imagemanager/**/*.{m,mm,cpp,h}"
  158. ss.exclude_files = "**/tests/*",
  159. "**/android/*",
  160. "**/cxx/*"
  161. ss.header_dir = "react/imagemanager"
  162. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  163. end
  164. s.subspec "mounting" do |ss|
  165. ss.dependency folly_dep_name, folly_version
  166. ss.compiler_flags = folly_compiler_flags
  167. ss.source_files = "fabric/mounting/**/*.{m,mm,cpp,h}"
  168. ss.exclude_files = "**/tests/*"
  169. ss.header_dir = "react/mounting"
  170. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  171. end
  172. s.subspec "textlayoutmanager" do |ss|
  173. ss.dependency folly_dep_name, folly_version
  174. ss.compiler_flags = folly_compiler_flags
  175. ss.source_files = "fabric/textlayoutmanager/**/*.{m,mm,cpp,h}"
  176. ss.exclude_files = "**/tests/*",
  177. "**/android/*",
  178. "**/cxx/*"
  179. ss.header_dir = "react/textlayoutmanager"
  180. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  181. end
  182. s.subspec "uimanager" do |ss|
  183. ss.dependency folly_dep_name, folly_version
  184. ss.compiler_flags = folly_compiler_flags
  185. ss.source_files = "fabric/uimanager/**/*.{m,mm,cpp,h}"
  186. ss.exclude_files = "**/tests/*",
  187. ss.header_dir = "react/uimanager"
  188. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  189. end
  190. s.subspec "utils" do |ss|
  191. ss.source_files = "utils/*.{m,mm,cpp,h}"
  192. ss.header_dir = "react/utils"
  193. ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/Folly\"" }
  194. end
  195. end