1*af2ec015STomasz Sapeta# Copyright (c) Meta Platforms, Inc. and affiliates.
2*af2ec015STomasz Sapeta#
3*af2ec015STomasz Sapeta# This source code is licensed under the MIT license found in the
4*af2ec015STomasz Sapeta# LICENSE file in the root directory of this source tree.
5*af2ec015STomasz Sapeta
6*af2ec015STomasz Sapetarequire "json"
7*af2ec015STomasz Sapeta
8*af2ec015STomasz Sapetapackage = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
9*af2ec015STomasz Sapetaversion = package['version']
10*af2ec015STomasz Sapeta
11*af2ec015STomasz Sapeta
12*af2ec015STomasz Sapeta
13*af2ec015STomasz Sapetafolly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
14*af2ec015STomasz Sapetafolly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
15*af2ec015STomasz Sapetafolly_version = '2021.07.22.00'
16*af2ec015STomasz Sapetaboost_compiler_flags = '-Wno-documentation'
17*af2ec015STomasz Sapeta
18*af2ec015STomasz Sapetaheader_search_paths = [
19*af2ec015STomasz Sapeta  "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"",
20*af2ec015STomasz Sapeta  "\"$(PODS_ROOT)/boost\"",
21*af2ec015STomasz Sapeta  "\"$(PODS_ROOT)/DoubleConversion\"",
22*af2ec015STomasz Sapeta  "\"$(PODS_ROOT)/RCT-Folly\"",
23*af2ec015STomasz Sapeta  "\"$(PODS_ROOT)/Headers/Private/React-Core\"",
24*af2ec015STomasz Sapeta  "\"$(PODS_ROOT)/Headers/Public/React-Codegen\"",
25*af2ec015STomasz Sapeta  "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"",
26*af2ec015STomasz Sapeta]
27*af2ec015STomasz Sapeta
28*af2ec015STomasz Sapetaif ENV['USE_FRAMEWORKS']
29*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\""
30*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/textlayoutmanager/platform/ios\""
31*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/textinput/iostextinput\""
32*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/imagemanager/platform/ios\""
33*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\""
34*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\""
35*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-ImageManager/React_ImageManager.framework/Headers\""
36*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\""
37*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\""
38*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\""
39*af2ec015STomasz Sapeta  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers\""
40*af2ec015STomasz Sapetaend
41*af2ec015STomasz Sapeta
42*af2ec015STomasz SapetaPod::Spec.new do |s|
43*af2ec015STomasz Sapeta  s.name                   = "ABI49_0_0React-RCTFabric"
44*af2ec015STomasz Sapeta  s.version                = version
45*af2ec015STomasz Sapeta  s.summary                = "RCTFabric for React Native."
46*af2ec015STomasz Sapeta  s.homepage               = "https://reactnative.dev/"
47*af2ec015STomasz Sapeta  s.license                = package["license"]
48*af2ec015STomasz Sapeta  s.author                 = "Meta Platforms, Inc. and its affiliates"
49*af2ec015STomasz Sapeta  s.platforms              = { :ios => "12.4" }
50*af2ec015STomasz Sapeta  s.source                 = { :path => "." }
51*af2ec015STomasz Sapeta  s.source_files           = "Fabric/**/*.{c,h,m,mm,S,cpp}"
52*af2ec015STomasz Sapeta  s.exclude_files          = "**/tests/*",
53*af2ec015STomasz Sapeta                             "**/android/*",
54*af2ec015STomasz Sapeta  s.compiler_flags         = folly_compiler_flags + ' ' + boost_compiler_flags
55*af2ec015STomasz Sapeta  s.header_dir             = "ABI49_0_0React"
56*af2ec015STomasz Sapeta  s.module_name            = "ABI49_0_0RCTFabric"
57*af2ec015STomasz Sapeta  s.framework              = "JavaScriptCore"
58*af2ec015STomasz Sapeta  s.pod_target_xcconfig    = {
59*af2ec015STomasz Sapeta    "HEADER_SEARCH_PATHS" => header_search_paths,
60*af2ec015STomasz Sapeta    "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags,
61*af2ec015STomasz Sapeta    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
62*af2ec015STomasz Sapeta  }.merge!(ENV['USE_FRAMEWORKS'] != nil ? {
63*af2ec015STomasz Sapeta    "PUBLIC_HEADERS_FOLDER_PATH" => "$(CONTENTS_FOLDER_PATH)/Headers/React"
64*af2ec015STomasz Sapeta  }: {})
65*af2ec015STomasz Sapeta
66*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0React-Core", version
67*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0React-Fabric", version
68*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0React-RCTImage", version
69*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0React-ImageManager"
70*af2ec015STomasz Sapeta  s.dependency "RCT-Folly/Fabric", folly_version
71*af2ec015STomasz Sapeta  s.dependency "glog"
72*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0Yoga"
73*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0React-RCTText"
74*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0React-utils"
75*af2ec015STomasz Sapeta  s.dependency "ABI49_0_0React-runtimescheduler"
76*af2ec015STomasz Sapeta
77*af2ec015STomasz Sapeta  if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
78*af2ec015STomasz Sapeta    s.dependency "ABI49_0_0hermes-engine"
79*af2ec015STomasz Sapeta  else
80*af2ec015STomasz Sapeta    s.dependency "ABI49_0_0React-jsi"
81*af2ec015STomasz Sapeta  end
82*af2ec015STomasz Sapeta
83*af2ec015STomasz Sapeta  s.test_spec 'Tests' do |test_spec|
84*af2ec015STomasz Sapeta    test_spec.source_files = "Tests/**/*.{mm}"
85*af2ec015STomasz Sapeta    test_spec.framework = "XCTest"
86*af2ec015STomasz Sapeta  end
87*af2ec015STomasz Sapetaend
88