-
-
Save edwardean/592cc0301a4f6234035b0046dfcc761b to your computer and use it in GitHub Desktop.
Inhibit warnings developer pods iOS
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
# inhibit_all_warnings! | |
# If you enable inhibit_all_warnings, we will not see warnings from our developer Pods. | |
# inhibit_all_warnings Оключает отображение warning во всех подключенных Pods. И мы не видим предупреждение в наших developer Pods | |
# Solution: Disable warning only for third party Pods | |
# Решение: Отключить показ warning только для сторонних подов | |
# Solution: for custom pods https://stackoverflow.com/a/44530816 | |
# Решение: для выборочного отключения https://stackoverflow.com/a/44530816 | |
# Pod's | |
pod 'GoogleAnalytics' | |
pod 'Firebase' | |
...other pods | |
# Inhibit warnings for custom Pod: | |
# pod 'Firebase', :inhibit_warnings => true | |
# My developer Pods | |
pod 'MyPod1', :path => '../../devPods/MyPod1' | |
pod 'MyPod2', :path => '../../devPods/MyPod2' | |
... my other developer pods | |
$local_pods = Hash[] | |
def inhibit_warnings_for_third_party_pods(target, build_settings) | |
return if $local_pods[target.name] | |
if build_settings["OTHER_SWIFT_FLAGS"].nil? | |
build_settings["OTHER_SWIFT_FLAGS"] = "-suppress-warnings" | |
else | |
build_settings["OTHER_SWIFT_FLAGS"] += " -suppress-warnings" | |
end | |
build_settings["GCC_WARN_INHIBIT_ALL_WARNINGS"] = "YES" | |
end | |
pre_install do |installer| | |
installer.development_pod_targets.each do |target| | |
$local_pods.merge!(Hash[target.name => true]) | |
end | |
end | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
inhibit_warnings_for_third_party_pods(target, config.build_settings) | |
# other post_install code if needed | |
... | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment