-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generator: header.rb: umbrella always imports UIKit on iOS, even if the pod doesn't depend on it. #6815
Comments
This commit replaces the UIKit import made in the header generator by a Foundation import when targetting iOS and tvOS. This is done because we don't know if the framework that is built depends or not on UIKit. For example, frameworks that do not use UI do not need to import UIKit. Issue: CocoaPods#6815
This commit replaces the UIKit import made in the header generator by a Foundation import when targetting iOS and tvOS. This is done because we don't know if the framework that is built depends or not on UIKit. For example, frameworks that do not use UI do not need to import UIKit. Issue: CocoaPods#6815
This commit replaces the UIKit import made in the header generator by a Foundation import when targetting iOS and tvOS. This is done because we don't know if the framework that is built depends or not on UIKit. For example, frameworks that do not use UI do not need to import UIKit. Issue: CocoaPods#6815
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This one hasn’t been resolved bot 😛
…--
Keith Smiley
On Sep 16, 2017, at 01:29, stale[bot] ***@***.***> wrote:
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
What's a good way to fix this without breaking all of the existing podspecs that are unknowingly depending upon the CocoaPods generated pch file? |
@paulb777 not sure......need to think about this. Perhaps a new |
In the meantime, I've done something horrible and created a CP plugin that just always uses "Foundation" in these headers. https://github.com/keith/cocoapods-foundation-headers This could end up being a problem if someone developed a library only using CocoaPods and is somehow relying on this behavior. If that comes up I guess I'll take arguments and allow exclusions. But in the meantime this works on our project! |
One possible solution would be adding to Would such Core and CocoaPod implementation PRs be accepted? |
I discovered that I was conflating two related issues. Both the generated umbrella header and the generated pch header have the issue of bringing in an import of UIKit.h. See also #1691 and #1746 for more detailed descriptions of the pch issue. And from me in June https://stackoverflow.com/questions/44401464/is-there-a-way-to-disable-the-default-pch-file-in-cocoapods |
FWIW this same codepath is responsible for both of those. |
@paulb777 What about supporting podspecs specifying the entire PCH and umbrella header? That way those who do not want it could just provide an empty header, or maybe it could provide a default but allow setting it to nil |
@amorde Hmm. It's already possible to specify a pch to inject into the generated pch - https://guides.cocoapods.org/syntax/podspec.html#prefix_header_file. It could get confusing if a new option also allows specifying pch's. For umbrella headers, I suspect many users want the umbrella header to be generated, but without adding UIKit.h or Cocoa.h to it. |
Ah, good catch. That's unfortunate. I'm just worried about having a bunch of |
@amorde good feedback, that was exactly what I was thinking also. @paulb777 I'm also wanting to avoid a spec.pod_target_shared_pch = :skip Which would allow the attribute to potentially evolve if there are other unanticipated cases. Make sense? |
@orta I agree that I'm not following the logic about breaking the build, since my understanding is that a separate pch is generated for each pod. Instead of creating a new
Still, any of these approaches would solve the unwanted pch file issue but don't provide a pathway towards turning off the unwanted additional imports in generated umbrella headers. |
I like the ability to provide a different configuration for the prefix header generation. I am more in favor as well than adding a flag to the DSL. |
Ah, I was conflating the two of these issues:
Into one attribute. I agree with the addition of I think for the umbrella we'll have to add a new attribute for that. |
Sounds good. I'll update #7044 accordingly. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
It looks like that attribute has been merged, so if we don't want to go down any other route of consumers of specs being able to also disable this, (without just altering the build setting, this can be closed. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Hello! Without interfering with your decision here, could you please explain me what the current status of this is? Thanks! |
@r-mckay this also seems available already in CocoaPods 1.4.0. |
@dnkoutso Yes it seems so, that's what I tried. @paulb777, sorry to bother you but could you confirm that the UIKit import, with |
#7044 turns off prefix header generation. I don't think any of the discussed solutions to turn off the UIKit import in umbrella header's were implemented. |
I implemented a quick CocoaPods plugin that imports foundation instead, it seems to work correctly for our project https://github.com/keith/cocoapods-foundation-headers |
@keith nice thank you! |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
@stalebot not stale |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍 |
Yeah so |
I've created a cocoapods plugin for removing autoimports of |
Report
What did you do?
I wanted to install pods that do not depend on UIKit, RxSwift for example.
What did you expect to happen?
I expected that these pods that do not depend on UIKit didn't import it.
What happened instead?
The pods imported UIKit.
Project that demonstrates the issue
Adding pod RxSwift, for example, demonstrates it. It is confirmed that it does not depend on UIKit, but if I'm not mistaken it imports it when installed via CocoaPods.
Please see: ReactiveX/RxSwift#1298
The text was updated successfully, but these errors were encountered: