# Podspec *must* be located at package root level or it will not be find for React # Native's autolinking. # # It would be great to move this to the RN folder and still have the # relative paths work in production somehow. Maybe when RN will stop forcing # the podspec to exist at root level or allow us to modify it via some property. require "json" require 'fileutils' framework_path = File.join(File.dirname(__FILE__), 'react-native', 'ios', 'DittoCore.xcframework') local_framework_exists = File.exist?(framework_path) package = JSON.parse(File.read(File.join(__dir__, "package.json"))) Pod::Spec.new do |s| s.name = "DittoReactNative" s.version = package["version"] s.summary = package["description"] s.homepage = package["homepage"] s.license = package["license"] s.authors = package["author"] s.platforms = { :ios => '14.0', :osx => '11.0' } s.source = { :http => 'https://ditto.com' } s.source_files = "react-native/ios/**/*.{h,m,mm}", "react-native/cpp/**/*.{h,cpp,hpp}", if local_framework_exists s.vendored_frameworks = "react-native/ios/DittoCore.xcframework" else s.dependency 'DittoReactNativeIOS', package["version"] end # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. if respond_to?(:install_modules_dependencies, true) install_modules_dependencies(s) else s.dependency "React-Core" end end