1require 'json' 2 3package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) 4 5Pod::Spec.new do |s| 6 s.name = 'ExpoModulesCore' 7 s.version = package['version'] 8 s.summary = package['description'] 9 s.description = package['description'] 10 s.license = package['license'] 11 s.author = package['author'] 12 s.homepage = package['homepage'] 13 s.platform = :ios, '12.0' 14 s.swift_version = '5.4' 15 s.source = { git: 'https://github.com/expo/expo.git' } 16 s.static_framework = true 17 s.header_dir = 'ExpoModulesCore' 18 19 # Swift/Objective-C compatibility 20 s.pod_target_xcconfig = { 21 'USE_HEADERMAP' => 'YES', 22 'DEFINES_MODULE' => 'YES', 23 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14', 24 'SWIFT_COMPILATION_MODE' => 'wholemodule', 25 'HEADER_SEARCH_PATHS' => "\"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers\"", 26 } 27 s.user_target_xcconfig = { 28 "HEADER_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/ExpoModulesCore/Swift Compatibility Header\" \"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers\"", 29 } 30 31 s.dependency 'React-Core' 32 s.dependency 'ReactCommon/turbomodule/core' 33 34 if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("ios/#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0') 35 s.source_files = 'ios/**/*.h', 'common/cpp/**/*.h' 36 s.vendored_frameworks = "ios/#{s.name}.xcframework" 37 else 38 s.source_files = 'ios/**/*.{h,m,mm,swift,cpp}', 'common/cpp/**/*.{h,cpp}' 39 end 40 41 s.exclude_files = 'ios/Tests/' 42 s.private_header_files = ['ios/**/*+Private.h', 'ios/**/Swift.h'] 43 44 s.test_spec 'Tests' do |test_spec| 45 test_spec.dependency 'ExpoModulesTestCore' 46 47 test_spec.source_files = 'ios/Tests/**/*.{m,swift}' 48 end 49end 50