|
| 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 | + |
| 6 | +require "json" |
| 7 | + |
| 8 | +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) |
| 9 | +version = package['version'] |
| 10 | + |
| 11 | +source = { :git => 'https://github.com/facebook/react-native.git' } |
| 12 | +if version == '1000.0.0' |
| 13 | + # This is an unpublished version, use the latest commit hash of the react-native repo, which we're presumably in. |
| 14 | + source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") |
| 15 | +else |
| 16 | + source[:tag] = "v#{version}" |
| 17 | +end |
| 18 | + |
| 19 | +is_new_arch_enabled = ENV["RCT_NEW_ARCH_ENABLED"] != "0" |
| 20 | +new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED=1" : "") |
| 21 | +other_cflags = "$(inherited) " + new_arch_enabled_flag + js_engine_flags() |
| 22 | + |
| 23 | +header_search_paths = [ |
| 24 | + "$(PODS_TARGET_SRCROOT)/../../ReactCommon", |
| 25 | + "$(PODS_ROOT)/Headers/Private/React-Core", |
| 26 | + "$(PODS_ROOT)/Headers/Public/ReactCommon", |
| 27 | +] |
| 28 | + |
| 29 | +Pod::Spec.new do |s| |
| 30 | + s.name = "React-RCTAnimatedModuleProvider" |
| 31 | + s.version = version |
| 32 | + s.summary = "Provides the C++ Native Animated TurboModule to React Native apps." |
| 33 | + s.homepage = "https://reactnative.dev/" |
| 34 | + s.documentation_url = "https://reactnative.dev/" |
| 35 | + s.license = package["license"] |
| 36 | + s.author = "Meta Platforms, Inc. and its affiliates" |
| 37 | + s.platforms = min_supported_versions |
| 38 | + s.source = source |
| 39 | + s.source_files = podspec_sources("*.{m,mm,h}", "*.h") |
| 40 | + s.public_header_files = "*.h" |
| 41 | + s.module_name = "RCTAnimatedModuleProvider" |
| 42 | + s.header_dir = "RCTAnimatedModuleProvider" |
| 43 | + |
| 44 | + s.compiler_flags = other_cflags |
| 45 | + s.pod_target_xcconfig = { |
| 46 | + "HEADER_SEARCH_PATHS" => header_search_paths, |
| 47 | + "OTHER_CPLUSPLUSFLAGS" => other_cflags, |
| 48 | + "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), |
| 49 | + "DEFINES_MODULE" => "YES" |
| 50 | + } |
| 51 | + |
| 52 | + s.dependency "React-Core" |
| 53 | + s.dependency "React-featureflags" |
| 54 | + s.dependency "React-Fabric/animated" |
| 55 | + |
| 56 | + add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"]) |
| 57 | + |
| 58 | + depend_on_js_engine(s) |
| 59 | + add_rn_third_party_dependencies(s) |
| 60 | + add_rncore_dependency(s) |
| 61 | +end |
0 commit comments