require_relative '../node_modules/react-native/scripts/react_native_pods'

ENV['RCT_USE_PREBUILT_RNCORE'] = '0'

platform :ios, '15.1'

target 'RNSentryCocoaTesterTests' do
  use_react_native!(
    :hermes_enabled => false,
  )
  pod 'RNSentry', :path => '../RNSentry.podspec'
  pod 'OCMock', '3.9.1'

  post_install do |installer|
    react_native_post_install(installer)

    # React-timing pod in RN 0.86 is missing PrivacyInfo.xcprivacy
    timing_privacy = File.join(__dir__, '..', 'node_modules', 'react-native', 'ReactCommon', 'react', 'timing', 'PrivacyInfo.xcprivacy')
    unless File.exist?(timing_privacy)
      File.write(timing_privacy, <<~PLIST)
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
          <key>NSPrivacyCollectedDataTypes</key>
          <array/>
          <key>NSPrivacyTracking</key>
          <false/>
        </dict>
        </plist>
      PLIST
    end
  end
end

