plugin 'cocoapods-acknowledgements'
# pod "MSColorPicker"
platform :ios, '15.2'
pod 'IQKeyboardManager', '6.5.16'
pod 'SSZipArchive', '2.4.3'
post_install do |installer|
    # Scanner backup/restore never accepts ZIP passwords. Remove the unused
    # implementations from this target, rather than merely disabling callers.
    zip_pod = installer.pod_targets.find { |pod| pod.pod_name == 'SSZipArchive' }
    raise 'Expected audited SSZipArchive 2.4.3' unless zip_pod && zip_pod.root_spec.version.to_s == '2.4.3'
    zip_target = installer.pods_project.targets.find { |target| target.name == 'SSZipArchive' }
    raise 'SSZipArchive build target missing' unless zip_target
    excluded_zip_sources = %w[mz_strm_wzaes.c mz_strm_pkcrypt.c mz_crypt_apple.c]
    excluded_zip_sources.each do |filename|
        matches = zip_target.source_build_phase.files.select do |build_file|
            build_file.file_ref && File.basename(build_file.file_ref.path) == filename
        end
        raise "Expected one SSZipArchive source #{filename}, found #{matches.length}" unless matches.length == 1
        matches.first.remove_from_project
    end
    zip_target.build_configurations.each do |config|
        # Do not use $(inherited): the upstream xcconfig enables both ZIP ciphers.
        # Defining HAVE_WZAES/HAVE_PKCRYPT=0 would still satisfy their #ifdef.
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = %w[
            COCOAPODS=1 HAVE_INTTYPES_H HAVE_STDINT_H HAVE_ZLIB
            HAVE_ARC4RANDOM_BUF MZ_ZIP_NO_ENCRYPTION MZ_ZIP_NO_CRYPTO
        ]
    end
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
            config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.2'
            config.build_settings['SWIFT_VERSION'] = '5.1'
            config.build_settings['DEVELOPMENT_TEAM'] = ENV.fetch('APPLE_TEAM_ID', 'M5FZ5BR46W')
            config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
            config.build_settings['OTHER_SWIFT_FLAGS'] = '-DSUPPRESS_WARNINGS'
        end
    end
end
