Cocoapods: Add inihibit_warnings to Podspec dependencies like in Podfile

Created on 5 Jun 2014  Â·  13Comments  Â·  Source: CocoaPods/CocoaPods

Can this be added? In a private Pod I'd like to remove warnings for 3rd party pods (because there's nothing I can do about them)....this was previously possible using the post_install hook...but of course it has gone ....e.g.

spec.post_install do |installer|
    installer.project.targets.each do |target|
      if !target.name.start_with?('Pods-FLO')
        target.build_configurations.each do |config|
          puts config
          config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
        end
      end
    end
  end

Most helpful comment

I don't want to inhibit ALL warnings, only 3rd Party Pods, not my private pods. The same syntax as Podfile in PodSpec would be great.

All 13 comments

inhibit_all_warnings!

I don't want to inhibit ALL warnings, only 3rd Party Pods, not my private pods. The same syntax as Podfile in PodSpec would be great.

See http://guides.cocoapods.org/syntax/podfile.html#inhibit_all_warnings_bang.
Basically, for each non-private pod, you declare it pod 'podname', :inhibit_warnings => true

Yes that's exactly what I want to do BUT within a Podspec, not the Podfile. This syntax does not work on a dependency within a Podspec.... In order that our internal libraries show up warnings, so I can nag them to be fixed...

Nor should it work in a podspec. This is a configuration that is meant to be done _client_-side, and hence in the podfile.

If I am developing a Pod that uses 3rd party libraries, inhibit the warnings in the Podfile, then it inhibits ALL warnings including that ones from dependencies that I am developing, which I want to see.

e.g.

I am developing MyApp. In my Podfile I include MyCorePod. MyCorePod is dependent on MyNetworkStack, MyMathsLib and some 3rd Party Pods, lets use AWSSDK and Facebook SDK as examples since they are rife with warnings....how do I inhibit AWS and Facebook warnings but still see the ones for my project?

Explicitly declare a dependency in your Podfile for those pods and explicitly inhibit warnings.

-Samuel E. Giddins

On Jun 5, 2014, at 12:36 PM, kevindudley [email protected] wrote:

If I am developing a Pod that uses 3rd party libraries, inhibit the warnings in the Podfile, then it inhibits ALL warnings including that ones from dependencies that I am developing, which I want to see.

e.g.

I am developing MyApp. In my Podfile I include MyCorePod. MyCorePod is dependent on MyNetworkStack, MyMathsLib and some 3rd Party Pods, lets use AWSSDK and Facebook SDK as examples since they are rife with warnings....how do I inhibit AWS and Facebook warnings but still see the ones for my project?

—
Reply to this email directly or view it on GitHub.

So duplicate the dependency?? I guess this will be fine but will be something extra to think about. I'll give it a go, will let you know how I get on...but tomorrow now.

Let’s move this discussion over to https://github.com/CocoaPods/CocoaPods/issues/1587

Duplicating the dependencies did work. So thank you for that suggestion.It will, however, require some extra maintenance...we have lots of projects, but I'm reasonably happy now ;o) Another solution might be to add an option that overrides inhibit_all_warnings! to allow warnings on Development/Local Pods. I'll summarise this discussion as a post on the other thread.

If @kylef / @irrationalfab agree, I'd be all for making inhibit_all_warnings! ignore development (i.e. only local) pods

The overrides don't seem to work for me. I get warnings, and it basically undoes the inhibit_warnings :/

@jpmcglone So do I. The override cannot work now in version 1.4.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jhudsonWA picture jhudsonWA  Â·  65Comments

churowa picture churowa  Â·  64Comments

keith picture keith  Â·  98Comments

wolfAle picture wolfAle  Â·  98Comments

MatrixSenpai picture MatrixSenpai  Â·  100Comments