balloonsys
9/21/2017 - 2:19 AM

Resolve warnings when upgrade to Xcode 9

Resolve warnings when upgrade to Xcode 9

post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings['CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING'] = 'YES'
        config.build_settings['CLANG_WARN_NON_LITERAL_NULL_CONVERSION'] = 'YES'
        config.build_settings['CLANG_WARN_OBJC_LITERAL_CONVERSION'] = 'YES'
        config.build_settings['CLANG_WARN_COMMA'] = 'YES'
        config.build_settings['CLANG_WARN_RANGE_LOOP_ANALYSIS'] = 'YES'
        config.build_settings['CLANG_WARN_STRICT_PROTOTYPES'] = 'YES'
        config.build_settings['ENABLE_STRICT_OBJC_MSGSEND'] = 'YES'
        config.build_settings['GCC_NO_COMMON_BLOCKS'] = 'YES'
    end
    
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            # Check if any deployment target is lower than 8
            versions = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].split('.').map{|s|s.to_i}
            if versions.first < 8
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
            end
        end
    end
end