Pregunta

I have a git repo in this format:

MyApp/
  Podfile
  ....
TestHelperPod/
  Classes/
    .h & .m files
  TestHelperPod.podspec

My podfile in the MyApp folder has a line that looks like so:

pod 'TestHelperPod', :path => '../TestHelperPod'

and my podspec's source_files pattern looks like this:

Pod::Spec.new do |s|
  //...
  s.source_files  = "TestHelperPod/Classes/*.{h,m}"    
end

When i do a pod spec lint on the podspec, it seems to succeed and picks up all the classes in the Classes directory to build them. However when I actually try to pod install in MyApp, the Pods project is not generated with references to the classes in the Classesdirectory. This used to work when the Classes directory was also named TestHelperPod and the source_files pattern was TestHelperPod/**/*.{h,m}, but I don't want the repetition in the folder structure there. The pattern with ** in it doesn't work with this new structure either. Any ideas? I'm running the latest version of cocoapods at the time of writing, 0.32.1.

¿Fue útil?

Solución

Figured it out; changing the source_files line to this:

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

Worked; the documentation on cocoapods.org suggested that the source files pattern must be at the top of the repo which is why i thought I needed TestHelperPod in there, even though the podspec was already in that folder.

Otros consejos

I had the same issue where I am not able get the swift files inside the project . Below code worked for me .

s.source_files = 'Podname/Podname/**/*.{h,m,swift}'

adding swift along with h,m made it work .

NOTE: install the pod again after updating podspec file .

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top