Cocoanetics / DTFoundation

Standard toolset classes and categories
BSD 2-Clause "Simplified" License
805 stars 237 forks source link

Framework not compiling with latest CocoaPods 1.0 beta #102

Closed UnsafePointer closed 8 years ago

UnsafePointer commented 8 years ago

The project is not compiling with the latest CocoaPods beta version, as a dynamic framework, I got the following error:

screen shot 2016-02-26 at 09 30 55

Which I can fix by changing all DTWeakSupport and DTCompatibility import statements in the project to modular imports: #import <DTFoundation/...> but that doesn't look right to me, they're exported in the umbrella header either way: https://github.com/Cocoanetics/DTFoundation/blob/develop/Core/DTFoundation.h#L27

Do you have any idea why this is not working? This happens on a beta version of CocoaPods either way, so maybe it's a bug on CocoaPods but I'm opening this PR to gather some information before filling an issue there.

odrobnik commented 8 years ago

I think that this is a result of some change in Xcode. We should probably update all imports to use the @ outside of modules as well as the normal import "DTWeakSupport.h" in the umbrella header as well as all code inside the module.

YoniTsafir commented 8 years ago

:+1: Having the same issue and thought of same solution

I would think that having DTWeakSupport.h both in DTFoundation and in DTCoreText might be a cause for troubles here...

odrobnik commented 8 years ago

I am open to pull requests fixing that.

ropiku commented 8 years ago

I have a branch that fixes the build and works in cocoapods beta but not sure if that's the solution you want to use https://github.com/ropiku/DTFoundation/commits/modular_import

odrobnik commented 8 years ago

That should help, all public headers from the framework should be imported with the framework prefixed.

odrobnik commented 8 years ago

@ropiku I ended up with exactly the same change as you mentioned.

Can somebody please confirm that this now builds with CocoaPods 1.0?

ropiku commented 8 years ago

I can confirm that building from develop works in 1.0.0.beta.6 with pod 'DTFoundation/Core', git: 'https://github.com/Cocoanetics/DTFoundation.git', branch: 'develop'.

It would be great if you could release it to cocoapods soon.

odrobnik commented 8 years ago

@ropiku thanks for checking! I guess I'll make a release today then!

UnsafePointer commented 8 years ago

@odrobnik @ropiku thank you guys!

ropiku commented 8 years ago

@odrobnik Thanks ! Could you release an updated DTCoreText that updates the dependency against DTFoundation ? I have the foundation pod fixed in my podspec but I think new users would still get an error in cocoapods beta.

odrobnik commented 8 years ago

I am working on the 1.7.10 release of DTFoundation.

odrobnik commented 8 years ago

ok, released. @Ruenzuo please update and - if that hopefully resolves your issue - close this issue.

https://www.cocoanetics.com/2016/04/dtfoundation-1-7-10/