Found it in the spec docs.
spec.header_dir = 'LibName'
did the trick just fine, all includes both in the project and in the pod itself work correctly.
Domanda
In the Specs repo, there is a pod. It used to build correctly and work, but the library creators changed the way they distribute the files to iOS framework, and with it some headers.
Pod is called LibNameSDK
. New framework is called LibName.framework
, and it's public headers are now referencing sibling files by including the lib name:
#import <LibName/HeaderName.h>
I wanted to create a new podspec for the new version, but I am failing to keep its name the same. If I use a podspec
file that's still called LibNameSDK
, none of the imports work when building the pod itself. Unless the podspec and its folder are changed to LibName
, compiler cannot resolve headers.
The question is, can this be fixed with some additional podspec configurations? How to cheat a pod to look for headers in non-existing path? I was thinking either custom header search paths for the pod or some fake path creation, but I cannot find similar references on the web: all problems seems to be about pod usage, not podspec creation.
The .podspec
for the reference, omitting summary and such:
Pod::Spec.new do |s|
s.name = 'LibNameSDK'
s.version = '1.2.3'
s.platform = :ios, '5.0'
s.requires_arc = true
s.source_files = 'LibName.framework/Versions/A/Headers/*.h'
s.vendored_frameworks = 'LibName.framework'
end
Soluzione
Found it in the spec docs.
spec.header_dir = 'LibName'
did the trick just fine, all includes both in the project and in the pod itself work correctly.