|
| 1 | +require "json" |
| 2 | + |
| 3 | +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) |
| 4 | +folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' |
| 5 | + |
| 6 | +Pod::Spec.new do |s| |
| 7 | + s.name = "RNDocumentPicker" |
| 8 | + s.version = package["version"] |
| 9 | + s.summary = package["description"] |
| 10 | + s.homepage = package["homepage"] |
| 11 | + s.license = package["license"] |
| 12 | + s.authors = package["author"] |
| 13 | + |
| 14 | + s.platforms = { :osx => "10.15" } |
| 15 | + s.source = { :git => "https://github.com/victorhenrion/react-native-document-picker-macos.git", :tag => "#{s.version}" } |
| 16 | + |
| 17 | + s.source_files = "macos/**/*.{h,m,mm}" |
| 18 | + |
| 19 | + # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. |
| 20 | + # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. |
| 21 | + if respond_to?(:install_modules_dependencies, true) |
| 22 | + install_modules_dependencies(s) |
| 23 | + else |
| 24 | + s.dependency "React-Core" |
| 25 | + |
| 26 | + # Don't install the dependencies when we run `pod install` in the old architecture. |
| 27 | + if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then |
| 28 | + s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1" |
| 29 | + s.pod_target_xcconfig = { |
| 30 | + "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", |
| 31 | + "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1", |
| 32 | + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" |
| 33 | + } |
| 34 | + s.dependency "React-RCTFabric" |
| 35 | + s.dependency "React-Codegen" |
| 36 | + s.dependency "RCT-Folly" |
| 37 | + s.dependency "RCTRequired" |
| 38 | + s.dependency "RCTTypeSafety" |
| 39 | + s.dependency "ReactCommon/turbomodule/core" |
| 40 | + end |
| 41 | + end |
| 42 | +end |
0 commit comments