platform :ios, '16.0'
project 'Example/Example.xcodeproj'

install! 'cocoapods',
         generate_multiple_pod_projects: ENV['MULTIPLE_PROJECTS'] || false

target 'ExampleFrameworks' do
  use_frameworks!

  pod 'SnapKit'
  pod 'Keyboard+LayoutGuide'
  pod 'Moya/Core'
  pod 'Kingfisher'
  pod 'LocalPod', :path => 'LocalPods', :testspecs => ['Tests', 'ResourceBundleTests']

  target 'ExampleFrameworksTests' do
    inherit! :search_paths
  end
end

target 'ExampleLibs' do
  use_modular_headers!

  pod 'SnapKit'
  pod 'Keyboard+LayoutGuide'
  pod 'Moya/Core'
  pod 'Kingfisher'
  pod 'LocalPod', :path => 'LocalPods', :testspecs => ['Tests', 'ResourceBundleTests']

  target 'ExampleLibsTests' do
    inherit! :search_paths
  end
end

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      if target.name.include? 'LocalPod'
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
          config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
        end
      end
      
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
      end
    end
  end
end
