我正在尝试使用BitBucket配置我的第一个CocoaPods存储库,并努力解决可能非常基本的问题。
在我的本地机器上,我创建了一个名为'CocoaPods'的根目录,在这个目录中,我创建了一个名为'HelloWorld'的Xcode项目,还有一个HelloWorld.podspec。如果我正确理解了事情,根目录将包含我所有的* .podspec文件,然后这些文件将指向相关的文件/项目,问题1这个结构/概念是否正确?
然后这个目录与我的BitBucket帐户同步,该帐户有一个名为CocoaPods的存储库,然后我使用以下命令添加了存储库:
pod repo add Cocoapods https://bitbucket.org/username/CocoaPods.git
此时我无法对此进行测试,因为当我发出以下内容时:
pod spec lint HelloWorld.podspec
我创建的pod规范未通过验证:
-> HelloWorld (1.0.0)
- WARN | The summary is not meaningful.
- WARN | The description is shorter than the summary.
- ERROR | [iOS] The `source_files` pattern did not match any file.
- WARN | [iOS] Unable to find a license file
Analyzed 1 podspec.
[!] The spec did not pass validation.
HelloWorld.podspec文件是:
Pod::Spec.new do |s|
s.name = "HelloWorld"
s.version = "1.0.0"
s.summary = "A short description of the hello world pod"
s.description = "Stuff to describe the app here"
s.homepage = "https://www.mywebsite-it.co.uk"
s.license = "MIT"
s.author = { "a18041967" => "myemail@somedomain.co.uk" }
s.source = { :git => "git@bitbucket.org:myusername/cocoapods.git", :tag => "v1.0.0" }
s.source_files = "HelloWorld/*"
s.requires_arc = true
s.ios.deployment_target = "6.0"
s.platform = :ios, "6.0"
end
问题2,我的理解是s.source_files是相对于podspec文件的位置,在上面的例子中有一个名为HelloWorld的目录,它包含所有标准的Xcode项目文件。
所有文件都已被推送到远程原点,bitbucket上的结构是CocoaPods / HelloWorld / HelloWorld / podspec文件在CocoaPods中,Xcode项目文件在CocoaPods / HelloWorld /中,以及CocoaPods / HelloWorld中的所有其他项目文件/的HelloWorld /