我正在尝试使用我们可以在所有项目中使用的spec repo和cocoapods共享私有SDK。
我通过创建一个新的Cocoatouch静态库Xcode项目创建了一个虚拟/测试SDK(DummySDK)。项目中还没有代码。我没有添加pod文件或任何其他代码。
我将项目添加到bitbucket (https://bitbucket.org/foo/dummysdk)
。项目文件位于https://bitbucket.org/foo/dummysdk/DummySDK.xcodeproj
,.h文件位于https://bitbucket.org/grantspilsbury/dummysdk/dummysdk/dummysdk.h
然后我添加了一个许可文件并将其推送到位桶(https://bitbucket.org/foo/dummysdk/license.txt
),以及该版本的标签1.0。
然后我在https://bitbucket.org/foo/podspecs/PodSpec/1.0/PodSpec.podspec
Pod::Spec.new do |s|
s.name = 'PodSpec'
s.version = '1.0'
s.summary = 'Lightweight ad mediation for iOS'
s.author = {
'Grant' => 'myemail@here.com'
}
s.source = {
:git => 'https://foo@bitbucket.org/foo/testsdk.git',
:tag => '1.0'
}
s.source_files = 'Source/*.{h,m}'
s.homepage = "http://www.testsdk.com"
s.license = "MIT"
s.license = { :type => "MIT", :file => "license.txt" }
s.requires_arc = true
end
然后我运行了命令> ~/Source/PodSpecs/PodSpec/1.0$ pod repo add PodSpecs https://bitbucket.org/foo/podspecs
(来自spec文件所在的位置)
然后我运行了>~/.cocoapods/repos/PodSpecs$ pod repo lint .
(来自spec文件的根文件夹
我收到了输出消息:
Linting spec repo `PodSpecs`
.
Analyzed 1 podspecs files.
All the specs passed validation.
然后我删除并再次添加了spec文件,因为我之前添加了许可证文件
pod repo remove PodSpecs
然后运行> ~/Source/PodSpecs/PodSpec/1.0$ pod repo add PodSpecs https://bitbucket.org/foo/podspecs
然后我尝试通过运行:
来推送pod规范文件>~/Source/PodSpecs/PodSpec/1.0$ pod repo push PodSpecs PodSpec.podspec --verbose
我收到以下消息:
Validating spec
[!] The `PodSpec.podspec` specification does not validate.
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/repo/push.rb:91:in `rescue in block in validate_podspec_files'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/repo/push.rb:88:in `block in validate_podspec_files'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/repo/push.rb:85:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/repo/push.rb:85:in `validate_podspec_files'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/repo/push.rb:42:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:281:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command.rb:48:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:33:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
我也试过>~/Source/PodSpecs/PodSpec/1.0$ pod repo push PodSpecs PodSpec.podspec --allow-warnings
并收到消息:
Validating spec
[!] The `PodSpec.podspec` specification does not validate.
就我而言。我还需要知道如何将sdk包含到其他项目中,我假设使用podfile?
我还尝试将pod规范文件名更改为DummySDK并在pod规范文件中使用它:
Pod::Spec.new do |s|
s.name = 'DummySDK'
s.version = '1.0'
s.summary = 'Lightweight ad mediation for iOS'
s.author = {
'Grant' => 'myemail@here.com'
}
s.source = {
:git => 'https://foo@bitbucket.org/foo/testsdk.git',
:tag => '1.0'
}
s.source_files = 'Source/*.{h,m}'
s.homepage = "http://www.testsdk.com"
s.license = "MIT"
s.license = { :type => "MIT", :file => "license.txt" }
s.requires_arc = true
end
但是得到错误:
~/.cocoapods/repos/PodSpecs$ pod spec lint
-> DummySDK (1.0)
- ERROR | [OSX] [xcodebuild] 2014-09-25 11:06:37.481 xcodebuild[6872:2403] error: InputFile /Applications/Xcode 2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/SDKSettings.plist 0 1377395452 1100 33188... malformed line 7; 'InputFile' should have exactly five arguments
- ERROR | The `source_files` pattern did not match any file.
- ERROR | [iOS] [xcodebuild] 2014-09-25 11:06:40.900 xcodebuild[6918:3d07] error: InputFile /Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/SDKSettings.plist 0 1407358670 911 33188... malformed line 7; 'InputFile' should have exactly five arguments
- ERROR | [iOS] [xcodebuild] 2014-09-25 11:06:40.902 xcodebuild[6918:3d07] error: InputFile /Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/SDKSettings.plist 0 1407358670 911 33188... malformed line 7; 'InputFile' should have exactly five arguments
Analyzed 1 podspec.
修改
在我的sdk存储库中有代码,但没有什么真正意义。
即。 .h文件看起来像这样:
//
// DummySDK.h
// DummySDK
//
// Created by Grant Spilsbury on 2014/09/25.
// Copyright (c) 2014 Grant Spilsbury. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DummySDK : NSObject
@end
sdk存储库的整个文件结构如下所示:
/dummysdk
/dummysdk/DummySDK
/dummysdk/DummySDK/DummySDK.h
/dummysdk/DummySDK/DummySDK.m
/dummysdk/DummySDK.xcodeproj
/dummysdk/DummySDK.xcodeproj/project.xcworkspace
/dummysdk/DummySDK.xcodeproj/xcuserdata
/dummysdk/DummySDK.xcodeproj/project.pbxproj
/dummysdk/DummySDKTests
我重命名了Xcode似乎解决了一个问题,但我现在得到以下lint错误:
~/.cocoapods/repos/PodSpecs$ pod spec lint .
-> DummySDK
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
### Report
* What did you do?
* What did you expect to happen?
* What happened instead?
### Stack
```
CocoaPods : 0.33.1
Ruby : ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
RubyGems : 2.0.14
Host : Mac OS X 10.9.4 (13E28)
Xcode : 6.0 (6A313)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : Cocoapods - https://bitbucket.org/afrozaar/specs @ df68442fba9e1d7259248b1f2d46cc00835c6114
PodSpecs - https://bitbucket.org/grantspilsbury/podspecs @ f3547e07e39e8a804c3a4238415cc86e5908d95f
master - https://github.com/CocoaPods/Specs.git @ b99e5bad41d73c1c575dc2237ac7e7eab55b0dcc
```
### Error
```
REST::DisconnectedError - end of file reached
/Library/Ruby/Gems/2.0.0/gems/nap-0.8.0/lib/rest/request.rb:190:in `rescue in perform'
/Library/Ruby/Gems/2.0.0/gems/nap-0.8.0/lib/rest/request.rb:187:in `perform'
/Library/Ruby/Gems/2.0.0/gems/nap-0.8.0/lib/rest/request.rb:200:in `perform'
/Library/Ruby/Gems/2.0.0/gems/nap-0.8.0/lib/rest.rb:41:in `head'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.33.1/lib/cocoapods-core/http.rb:63:in `perform_head_request'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.33.1/lib/cocoapods-core/http.rb:13:in `block in get_actual_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.33.1/lib/cocoapods-core/http.rb:12:in `loop'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.33.1/lib/cocoapods-core/http.rb:12:in `get_actual_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.33.1/lib/cocoapods-core/http.rb:43:in `validate_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/validator.rb:232:in `validate_url'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/validator.rb:247:in `validate_homepage'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/validator.rb:199:in `perform_extensive_analysis'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/validator.rb:71:in `validate'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/spec.rb:93:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/spec.rb:86:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command/spec.rb:86:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:281:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command.rb:48:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:33:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
```
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing github issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=end+of+file+reached&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Don't forget to anonymize any private data!
答案 0 :(得分:1)
所以我看到你最后的lint中有两个问题:
error: InputFile
消息与Xcode 6相关的问题有关,请参阅https://github.com/CocoaPods/CocoaPods/issues/2394#issuecomment-56658587 - 作为解决方法,您可以将Xcode 2.app
重命名为其他不包含空格的内容
source_files
相关消息表示.h
目录中实际不存在.m
或Source
个文件。你说&#34;项目中还没有代码&#34; ,这肯定会导致lint失败。