保留文件夹结构Cocoa Pods [英] Preserve folder structure Cocoa Pods
问题描述
我已经使用本教程创建了一个简单的私有窗格: http ://pablin.org/2013/05/18/cocoapods-for-internal-libraries/
I have create a simple and private pod with this tutorial: http://pablin.org/2013/05/18/cocoapods-for-internal-libraries/
实际上我的仓库只有一组类
In fact my repo has just a group of classes
一切正常,我可以完美地安装我的吊舱。唯一的问题是所有文件都安装在主文件夹内,所以它不保留文件夹结构。
All is ok and I can install my pod perfectly. The only problem is all files are installed inside of the main folder so it doesn't preserve the folder structure.
我有这个文件夹结构,存储库名为:myRepository
I have this folder structure, repository named: myRepository
Classes
|
------ foo.h and foo.m
------ Controller Layer
|
----------- foo2.h and foo2.m
------ ViewLayer
|
----------- foo3.h and foo3.m
所有文件都复制到名为myRepository的文件夹中。
All files are copied inside of a folder called myRepository.
这是我的podspec:
This is my 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
I have tried with s.preserve_path = "*" and s.preserve_path = "Classes"
任何想法?
谢谢!!!!!!!!
Thanks!!!!!!!!
推荐答案
我已经完成了使用subspec创建自己的文件夹。
Well I have achieved to create my own folders with subspec.
您可以使用以下行创建子规划:
You can create a subspec with this line:
s.subspec 'folder name' do |ss|
ss.source_files = 'files'
ss.frameworks = 'frameworks'
end
ss.frameworks不是强制性的。
The ss.frameworks is not mandatory.
您可以从cocoaPods邮件列表中看到完整的答案:
You can see the complete answer from cocoaPods mail list:
https://groups.google.com/forum/#! topic / cocoapods / 0kV8r2xnqA8
谢谢mcitrrus
Thanks mcitrrus
我更喜欢关注AFNetworking pod规范:
I preferred to follow the AFNetworking pod spec:
https:// github.com/AFNetworking/AFNetworking/blob/master/AFNetworking.podspec
这篇关于保留文件夹结构Cocoa Pods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!