# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'BodyTune' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'
  pod 'Firebase/RemoteConfig'
  pod 'Alamofire'
  pod 'SDWebImage'
  pod 'ViewAnimator'
  pod 'AFNetworking'
  pod 'FacebookSDK'
  pod 'FacebookSDK/LoginKit'
  pod 'FacebookSDK/ShareKit'
  pod 'FacebookSDK/PlacesKit'
  pod 'SwiftyStoreKit'
  pod 'Firebase/Crashlytics'
  pod 'Bugsnag'
  pod 'Reusable'
  pod 'AppMetricaCore'
  pod 'OpenCV'
  pod 'DeviceKit'
  pod 'SSZipArchive'
  pod 'RealmSwift'
  #  plugin 'cocoapods-bugsnag'
  # Pods for BodyTune
end


#target 'OneSignalNotificationServiceExtension' do
#  use_frameworks!
#  pod 'OneSignal'
#end


post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'BoringSSL-GRPC'
          target.source_build_phase.files.each do |file|
            if file.settings && file.settings['COMPILER_FLAGS']
              flags = file.settings['COMPILER_FLAGS'].split
              flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
              file.settings['COMPILER_FLAGS'] = flags.join(' ')
            end
          end
        end
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      xcconfig_path = config.base_configuration_reference.real_path
      xcconfig = File.read(xcconfig_path)
      xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
      File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
    end
  end
end
