this repo has no description
at main 5.6 kB view raw
1# Copyright (c) Meta Platforms, Inc. and 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 6version = "0.81.4" 7source = { :git => 'https://github.com/facebook/react-native.git' } 8if version == '1000.0.0' 9 # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. 10 source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") 11else 12 source[:tag] = "v#{version}" 13end 14 15use_frameworks = ENV['USE_FRAMEWORKS'] != nil 16folly_compiler_flags = Helpers::Constants.folly_config[:compiler_flags] 17boost_compiler_flags = Helpers::Constants.boost_config[:compiler_flags] 18 19header_search_paths = [] 20framework_search_paths = [] 21 22header_search_paths = [ 23 "\"$(PODS_ROOT)/ReactNativeDependencies\"", 24 "\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"", 25 "\"$(PODS_ROOT)/Headers/Private/React-Fabric\"", 26 "\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"", 27 "\"$(PODS_ROOT)/Headers/Private/Yoga\"", 28 "\"$(PODS_TARGET_SRCROOT)\"", 29] 30 31if use_frameworks 32 ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"]) 33 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-FabricImage", "React_FabricImage", [])) 34 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-graphics", "React_graphics", ["react/renderer/graphics/platform/ios"])) 35 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"])) 36 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"])) 37 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", [])) 38 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-RCTFabric", "RCTFabric", [])) 39 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-debug", "React_debug", [])) 40 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-rendererdebug", "React_rendererdebug", [])) 41 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-utils", "React_utils", [])) 42 .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-featureflags", "React_featureflags", [])) 43 .each { |search_path| 44 header_search_paths << "\"#{search_path}\"" 45 } 46 end 47 48Pod::Spec.new do |s| 49 s.name = "ReactCodegen" 50 s.version = version 51 s.summary = 'Temp pod for generated files for React Native' 52 s.homepage = 'https://facebook.com/' 53 s.license = 'Unlicense' 54 s.authors = 'Facebook' 55 s.compiler_flags = "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++20" 56 s.source = { :git => '' } 57 s.header_mappings_dir = './' 58 s.platforms = min_supported_versions 59 s.source_files = "**/*.{h,mm,cpp}" 60 s.exclude_files = "RCTAppDependencyProvider.{h,mm}" # these files are generated in the same codegen path but needs to belong to a different pod 61 s.pod_target_xcconfig = { 62 "HEADER_SEARCH_PATHS" => header_search_paths.join(' '), 63 "FRAMEWORK_SEARCH_PATHS" => framework_search_paths, 64 "OTHER_CPLUSPLUSFLAGS" => "$(inherited) #{folly_compiler_flags} #{boost_compiler_flags}" 65 } 66 67 s.dependency "React-jsiexecutor" 68 s.dependency "RCTRequired" 69 s.dependency "RCTTypeSafety" 70 s.dependency "React-Core" 71 s.dependency "React-jsi" 72 s.dependency "ReactCommon/turbomodule/bridging" 73 s.dependency "ReactCommon/turbomodule/core" 74 s.dependency "React-NativeModulesApple" 75 s.dependency 'React-graphics' 76 s.dependency 'React-rendererdebug' 77 s.dependency 'React-Fabric' 78 s.dependency 'React-FabricImage' 79 s.dependency 'React-debug' 80 s.dependency 'React-utils' 81 s.dependency 'React-featureflags' 82 s.dependency 'React-RCTAppDelegate' 83 84 depend_on_js_engine(s) 85 add_rn_third_party_dependencies(s) 86 add_rncore_dependency(s) 87 88 s.script_phases = { 89 'name' => 'Generate Specs', 90 'execution_position' => :before_compile, 91 'input_files' => [], 92 'show_env_vars_in_log' => true, 93 'output_files' => ["${DERIVED_FILE_DIR}/react-codegen.log"], 94 'script': <<-SCRIPT 95pushd "$PODS_ROOT/../" > /dev/null 96RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd) 97popd >/dev/null 98 99export RCT_SCRIPT_RN_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../node_modules/.pnpm/react-native@0.81.4_@babel+core@7.28.4_@types+react@19.1.17_react@19.1.0/node_modules/react-native" 100export RCT_SCRIPT_APP_PATH="$RCT_SCRIPT_POD_INSTALLATION_ROOT/.." 101export RCT_SCRIPT_OUTPUT_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT" 102export RCT_SCRIPT_TYPE="withCodegenDiscovery" 103 104export SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh" 105export WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh" 106/bin/sh -c '"$WITH_ENVIRONMENT" "$SCRIPT_PHASES_SCRIPT"' 107SCRIPT 108 } 109 110end