-
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
Allow the user to customize the prefix headers and the xcconfigs #833
Comments
I have been held back to implement this feature because I believe that configurations should be set up in the runtime instead of using macros. However as there are cases in which this setup makes sense, I think that we should support this feature it. I am of the opinion that the best way to implement this feature is to create a header for each Pod library imported at the end of its prefix header. This file should be created only if doesn't exits and should never be overwritten by CocoaPods as it would be under the user control. I think that would be a more manageable solution rather than adding some sort of DSL to the Podfile. The only open question, for me, is where to store this file as the |
@irrationalfab +1 Regarding the Pods directory, it’s indeed time for another clean-up, your suggestions sound good, we could then also start telling people to keep external specs in Pods/User/Specs, or something along those lines. |
This setup should also generate xcconfigs. Maybe we could also generate xcconfigs for the user targets which imports the Pods xcconfig so the users have the last say on the build settings. |
I have to 👍 whatever solution to this might be, because it seems often than not you have to do something special for the Pods to make them play nice with your project. Having ability to overwrite and include extra stuff in the Pods-prefix.pch is invaluable. The only solution I can come up with is ether a custom I also hope that having a special directory under Anyways, this is just my 2 cents on the issue. |
The access to the config has been deprecated in order to preserve the needed flexibility for our private interfaces. I'm assuming that you need this information in the post-install hook of the Podfile where the InstallerRepresentation#sandbox_root is available. Isn't this suitable for your needs?
We plan to move all the generated content (everything in the Pods folder at the moment) in the |
This is an interesting approach to getting around this issue: #891 |
👍 |
@irrationalfab With the recent deprecation of |
@bachand You can use the prefix_header_contents or prefix_header_file attributes. |
I'm trying to modify the .pch file in a |
same as @bachand +1 |
@bachand & @rromanchuk Sorry about this issue, I didn't consider the usage from the Podfile while introducing the warning. This deprecated method is not going to be removed before this issue is implemented. For this reason, if the warning is not an issue for you, you can keep relying on it. If you would like to avoid the warning in the meanwhile you can use: installer_representation.installer.libraries.map(&:prefix_header_path) Please see library/#prefix_header_path for more information. |
Got it, thanks @irrationalfab! |
After some discussion we conclude that the best approach is to have a single public (user editable) prefix header for all the aggregate targets (target definitions) and for all the Pods targets. Regarding xccofings there should be a public one per each aggregate target. |
Agreed. |
Note: the user should have the possibility to just restore one user configurable file to the empty state as generated by CocoaPods simply deleting it. |
However we could also implement a system where we create one per target by default and then we have a naming convention and if the user creates one because he needs to configure just a single Pod, it is detected and used by the next pod install /c @alloy |
US2FormValidator 1.0.6, 1.0.7 and 1.0.8
what's the state of this issue?, there's a way to include macro o redefine constants for a library? |
Issue has been confirmed by @neonichu |
A lot of people have the problem where settings defined on PROJECT LEVEL are not inherited by cocoapods in its xcconfig file. That really needs to be fixed. I need to set Linker Flags and header search paths on project level so it can get inherited by all of my targets. Currently, because Pods.xcconfig doen not inherit them I must specify this information on all of my targets which is not a good way of doing that. |
This is terrible on large projects. We have many targets and configurations which means ~30 xcconfig files. To start using CocoaPods on this project we need to rearrange everything in our xcconfig files manually. It seems like CocoPods should be able to work with existing xcconfig files. The safest way to augment the existing |
With the advent of frameworks, I'm really not sure we need to implement this beyond the already-supported post-install hooks. |
Also does anything keep people from setting their own XCConfig in the project and including the one created by CP? They'd get a warning when doing a |
They won't even get the warning any more, if they actually include the CocoaPods one. |
And prefix headers should 🔥 anyways - I'd also say this is not relevant anymore. |
What's the solution to this after all? |
See this thread for some context: http://stackoverflow.com/questions/12967220/i-want-to-allow-invalid-ssl-certificates-with-afnetworking
Essentially we should be able to declare in the podfile that I want pods to run with some other c flags that can manipulate the pod libraries themselves.
Renamed from:Add an ability to apply #defines to pods target from podfile
The text was updated successfully, but these errors were encountered: