platform :ios, '14.0'
use_frameworks!

def shared_pods
    ooni_version = "v3.27.0"
    ooni_pods_location = "https://github.com/ooni/probe-cli/releases/download/#{ooni_version}"

    pod 'composeApp', :path => '../composeApp'

    pod 'sqlite3', '~> 3.42.0'

    pod "libcrypto", :podspec => "#{ooni_pods_location}/libcrypto.podspec"
    pod "libevent", :podspec => "#{ooni_pods_location}/libevent.podspec"
    pod "libssl", :podspec => "#{ooni_pods_location}/libssl.podspec"
    pod "libtor", :podspec => "#{ooni_pods_location}/libtor.podspec"
    pod "libz", :podspec => "#{ooni_pods_location}/libz.podspec"
    pod "oonimkall", :podspec => "#{ooni_pods_location}/oonimkall.podspec"
    pod "Siren"
end

target 'OONIProbe' do
    shared_pods
end

target 'OONIProbeUITests' do
    shared_pods
end

target 'NewsMediaScan' do
    shared_pods
end

target 'NewsMediaScanUITests' do
    shared_pods
end
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
    end
  end
end
