Created
January 23, 2020 11:48
-
-
Save 0xced/61b2ccbeb07d1e4e90973e1238e7d7b8 to your computer and use it in GitHub Desktop.
Sample Podfile with common workarounds: disable warnings for pods, using a branch, deleting deployment target from pods project, deleting swift files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
platform :ios, '12.0' | |
target 'MyApp' do | |
inhibit_all_warnings! | |
pod 'libextobjc/EXTKeyPathCoding', '0.6' | |
pod 'libextobjc/EXTScope', '0.6' | |
pod 'Mantle', '~> 2.1' | |
pod 'RSParser', :git => 'https://github.com/0xced/RSParser', :branch => 'nsarray' | |
end | |
# Fixes Xcode warning about pods projects, see https://stackoverflow.com/questions/37160688/set-deployment-target-for-cocoapodss-pod/51416359#51416359 | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' | |
end | |
# Delete swift files from RSParser pod, they are not needed and generate hundreds compilation errors. | |
# Started from https://github.com/CocoaPods/CocoaPods/issues/3107#issuecomment-232586353 and read documentation | |
# on https://www.rubydoc.info/gems/xcodeproj/Xcodeproj/Project/Object/AbstractBuildPhase and related classes. | |
# The generated project is weird, it has empty "BuildFile" but Xcode is able to cope with it | |
if target.name == 'RSParser' | |
target.source_build_phase.files_references.each do |file| | |
if file.name and file.name.end_with? 'swift' | |
puts "➖ Deleting #{file.display_name}" | |
file.remove_from_project | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment