我已经通过本教程创建了一个简单的私有(private) pod:http://pablin.org/2013/05/18/cocoapods-for-internal-libraries/
事实上我的仓库只有一组类
一切正常,我可以完美地安装我的 pod。唯一的问题是所有文件都安装在主文件夹中,因此它不会保留文件夹结构。
我有这个文件夹结构,存储库名为:myRepository
Classes
|
------ foo.h and foo.m
------ Controller Layer
|
----------- foo2.h and foo2.m
------ ViewLayer
|
----------- foo3.h and foo3.m
所有文件都复制到名为 myRepository 的文件夹中。
这是我的 podspec:
Pod::Spec.new do |s|
s.name = "fooClasses"
s.version = "0.0.1"
s.summary = "Common clases of foo"
s.homepage = "http://foo.com"
s.license = 'BSD'
s.license = { :type => 'Foo License', :file => 'LICENSE.txt' }
s.author = { "me" => "me@me.com" }
s.platform = :ios, '7.0'
s.source = { :git => "https://github.com/myRepository.git", :tag => "0.0.1" }
s.source_files = "**/*.{h,m}"
s.requires_arc = true
end
我试过 s.preserve_path = "*"和 s.preserve_path = "Classes"
有什么想法吗?
谢谢!!!!!!!!!
最佳答案
好吧,我已经实现了使用 subspec 创建自己的文件夹。
您可以使用此行创建子规范:
s.subspec 'folder name' do |ss|
ss.source_files = 'files'
ss.frameworks = 'frameworks'
end
ss.frameworks 不是强制性的。
您可以从 CocoaPods 邮件列表中看到完整的答案:
https://groups.google.com/forum/#!topic/cocoapods/0kV8r2xnqA8
谢谢你
我更喜欢遵循 AFNetworking pod 规范:
https://github.com/AFNetworking/AFNetworking/blob/master/AFNetworking.podspec
关于ios - 保留文件夹结构 Cocoa Pods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21168826/