我有一个项目,我想成为cocoapods的一部分或只是通过cocoapods轻松安装。
好的,让我们看看吧。
它有根目录:
Tools/ #directory where all items of project stored
ExternalLibraries/ # directory where all external libraries stored (.a libraries of third party guys with their .h header files)
Submodules/ # directory where all external projects stored that have open source code and can be placed as submodule
Example/ # directory with example
好的,我应该在Podspec文件中指定哪些选项以获得正确的行为?
我最终得到了这个规范。
Pod::Spec.new do |s|
s.name = "WowProjectTools"
s.source = {
:git => "https://github.com/wow/WowProjectTools.git",
:submodules => true
}
s.source_files = "Tools/**/*.{h,m}" # include all tools files
s.exclude_files = "Example" # exclude all examples
s.frameworks = "Foundation", "SystemConfiguration", "CoreData" # add all frameworks (system frameworks)
s.libraries = "icucore", "z" # ok, I need these libraries like libz.dylib and libicucore.dylib
s.vendored_libraries = 'ExternalLibraries/**' # hmm, these libraries are third party, no?
s.requires_arc = true #
s.xcconfig = { "HEADER_SEARCH_PATHS" => ["./Submodules/**/*.h","./ExternalLibraries/**/*.h"] } # add header search paths
end