CocoaPods Header Search

I'm experiencing what would seem a very basic problem and that is header files not being found. Below is a basic directory structure for a test POD I've created, my requirement is to retain the directory structure and for both root and SubPods to have access to header files. To retain the directory structure I'm using SubPods, if none of the classes make any reference to other classes the POD validates and the structure is correct. But if TSTSubClasses1.h includes TSTRootClass.h the POD lint validation fails 'fatal error: 'TSTRootClass.h' file not found.

Classes/TSTRootClass.h
Classes/TSTRootClass.m
Classes/SubPod-1/TSTSubClass1.h
Classes/SubPod-1/TSTSubClass1.m
Classes/SubPod-2/TSTSubClass2.h   
Classes/SubPod-2/TSTSubClass2.m

I've tried various combinations of public_header_files, preserve_paths & s.xcconfig = { 'HEADER_SEARCH_PATHS' => '${PODS_ROOT}/**'} but no luck. Is there any where that explains how to resolve search issues, also is there any way of outputting PATH details?

Detailed below is the podspec file, the source has been pushed to the repo and the structure and files do exist.

Pod::Spec.new do |s|
  s.name                       = "PODTest"
  s.version                    = "0.1.0"
  s.summary                    = "PODTest dg dghjghj fghj ."
  s.description                = <<-DESC
                               sdfg sdfg adfg sdfgn of PODTest
                               DESC
  s.homepage                   = "http://myhomepage"
  s.license                    = 'MIT'
  s.author                     = { "Duncan Hill" => "myemail@somedomain.com" }
  #s.source                    = { :git => "git@bitbucket.org:reponame/podtest.git"}
  s.source                     = { :git => "git@bitbucket.org:reponame/podtest.git", :tag     => s.version.to_s }

  s.platform                   = :ios, '5.0'
  s.ios.deployment_target      = '5.0'
  s.requires_arc               = true
  #s.xcconfig                  = { 'HEADER_SEARCH_PATHS' => '${PODS_ROOT}/#{s.name}/**'}
  s.xcconfig                   = { 'HEADER_SEARCH_PATHS' => '${PODS_ROOT}/**'}

  s.source_files               = "Classes/*.{h,m}"
  s.preserve_paths             = "Classes/*"

  s.subspec "SubPod-1" do |ss|
    ss.public_header_files = "Classes/*.h"
    ss.source_files        = "Classes/SubPod-1/*.{h,m}"
  end

  s.subspec "SubPod-2" do |ss|
    ss.public_header_files = "Classes/*.h"
    ss.source_files        = "Classes/SubPod-2/*.{h,m}"
  end

end  

Thanks for any help.


Your subspecs cannot depend on the parent spec, but can depend on other subspecs. You probably want to create some sort of "Core" subspec, then have SubPod 1 and 2 depend on that.

链接地址: http://www.djcxy.com/p/89636.html

上一篇: CocoaPods中间文件使用xcodebuild构建失败

下一篇: CocoaPods标题搜索