hectr / ErrorKit

iOS library for making NSError handling easier
MIT License
97 stars 7 forks source link

ErrorKitDefines.h breaks the usage of subspecs #7

Closed sguillope closed 11 years ago

sguillope commented 11 years ago

ErrorKitDefines.h defines the macros based on what library/framework is imported in the project. The problem is that if, for example, I link to the Security framework but don't want to use the ErrorKit/Security subspec ErrorKit will still define ERROR_KIT_SECURITY and then fail on importing MRErrorFormatter_Security.h

What are your thoughts on this?

hectr commented 11 years ago

Er… my bad… again.

I added these lines to ErrorKit.h:

#ifndef ERROR_KIT
#import "ErrorKitDefines.h"
#endif

And I thought that adding #define ERROR_KIT 1 to the podspec would prevent the import of the new header, but I didn't tested it.

s.subspec 'Core' do |c|
    c.source_files = 'ErrorKit'
    c.resources  = 'ErrorKit/ErrorKit.bundle'
    c.prefix_header_contents = '#define ERROR_KIT 1'
end

I made this change for fixing the compilation of a project were I am using the lib as submodule.

I may need to move the development to another branch were my hasty changes are harmless...