platform :ios, '15.6'
use_frameworks!

workspace 'ReadViewSDK.xcworkspace'
project 'ReadViewSDK.xcodeproj'

target 'ReadViewSDK' do
  pod 'RDEpubReaderView', :path => '..'
end

post_install do |installer|
  apply_settings = lambda do |config|
    config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO'
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.6'
  end

  # Pods project (Pods.xcodeproj)
  installer.pods_project.build_configurations.each { |c| apply_settings.call(c) }
  installer.pods_project.targets.each { |t| t.build_configurations.each { |c| apply_settings.call(c) } }

  installer.aggregate_targets.each do |at|
    p = at.user_project
    next unless p

    # User project(s) that integrate Pods (e.g. ReadViewDemo / ReadViewSDK)
    p.build_configurations.each { |c| apply_settings.call(c) }
    p.targets.each { |t| t.build_configurations.each { |c| apply_settings.call(c) } }
    p.save
  end
end
