我正在创建一个使用SwiftState pod的私有pod。对于这个库,我正在使用Swift3分支:
pod 'SwiftState', :git=> 'https://github.com/ReactKit/SwiftState.git', :branch => 'swift/3.0'
项目编译,但是当我将此pod添加为依赖项时:
s.dependency 'SwiftState'
然后,执行pod repo push,我在项目中使用Swift 2.3分支时遇到了同样的错误,之前我注意到master分支没有使用Swift 3版本更新:
ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- ERROR | xcodebuild: SwiftState/Sources/EventType.swift:17:5: error: expected identifier in enum 'case' declaration
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:31:38: error: function types cannot have argument label 'event'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:31:49: error: function types cannot have argument label 'fromState'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:31:63: error: function types cannot have argument label 'userInfo'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:74:13: error: expected 'let' in conditional
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:146:17: error: expected ',' joining parts of a multi-clause condition
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:381:17: error: expected ',' joining parts of a multi-clause condition
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:555:87: error: 'inout' before a parameter name is not allowed, place it before the parameter type instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:569:87: error: 'inout' before a parameter name is not allowed, place it before the parameter type instead
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:19:43: error: function types cannot have argument label 'fromState'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:19:57: error: function types cannot have argument label 'userInfo'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:53:13: error: expected 'let' in conditional
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:493:17: error: expected ',' joining parts of a multi-clause condition
- ERROR | xcodebuild: SwiftState/Sources/StateType.swift:17:5: error: expected identifier in enum 'case' declaration
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:27:32: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/_HandlerInfo.swift:19:24: error: assigning non-escaping parameter 'handler' to an @escaping closure
- NOTE | [iOS] xcodebuild: SwiftState/Sources/_HandlerInfo.swift:15:53: note: parameter 'handler' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Disposable.swift:38:23: error: assigning non-escaping parameter 'action' to an @escaping closure
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Disposable.swift:37:17: note: parameter 'action' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:26:19: error: enum case 'Any' not found in type 'Event<E>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:39:21: error: type 'Event<_>' has no member 'Any'
- NOTE | xcodebuild: SwiftState/Sources/EventType.swift:17:10: note: did you mean 'Any#'?
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:57:16: error: enum case 'Any' not found in type 'Event<E>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:69:11: error: enum case 'Any' not found in type 'Event<E>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:79:11: error: enum case 'Any' not found in type 'Event<E>'
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:71:26: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:84:26: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:89:29: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:103:34: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:142:41: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:215:37: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:233:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:238:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:244:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:249:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:259:29: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:290:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:295:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:301:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:306:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:414:28: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:419:28: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:433:30: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:456:33: warning: extraneous duplicate parameter name; 'order' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:503:20: warning: operator should no longer be declared with body; use a precedence group instead
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:540:47: warning: extraneous duplicate parameter name; 'fromState' already has an argument label
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:24:34: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:49:41: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:56:36: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:95:86: error: 'Some' has been renamed to 'some'
- NOTE | [iOS] xcodebuild: Swift.Optional<Wrapped>:5:24: note: 'Some' has been explicitly marked unavailable here
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:113:51: error: binary operator '==' cannot be applied to operands of type 'Event<E>' and '_'
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:113:51: note: overloads for '==' exist with these partially matching parameter lists: (Event<E>, Event<E>), (Event<E>, E), (T, T), (Self, Self)
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:130:45: error: missing argument label 'condition:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:145:46: error: extraneous argument labels 'event:fromState:userInfo:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:163:77: error: ambiguous subscript with base type '[Event<E> : [Transition<S> : [String : (event: E?, fromState: S, toState: S, userInfo: Any?) -> Bool?]]]' and index type '_'
- NOTE | xcodebuild: Swift.Dictionary:261:12: note: found this candidate
- NOTE | xcodebuild: Swift.Dictionary:306:12: note: found this candidate
- NOTE | xcodebuild: Swift.Collection:25:12: note: found this candidate
- NOTE | xcodebuild: Swift.Indexable:23:12: note: found this candidate
- NOTE | xcodebuild: Swift.Indexable:45:12: note: found this candidate
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:190:42: error: missing argument label 'event:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:217:79: error: ambiguous subscript with base type '[Event<E> : [_HandlerInfo<S, E>]]' and index type '_'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:259:54: error: type 'Event<E>' has no member 'Any'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:284:32: error: missing argument label '_routeID:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:363:36: error: assigning non-escaping parameter 'routeMapping' to an @escaping closure
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:359:33: note: parameter 'routeMapping' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:368:39: error: missing argument label 'routeMappingID:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:376:52: error: missing argument label 'routeMapping:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:378:58: error: type 'Event<_>' has no member 'Any'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:427:58: error: binary operator '==' cannot be applied to operands of type 'Event<E>' and '_'
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:427:58: note: overloads for '==' exist with these partially matching parameter lists: (Event<E>, Event<E>), (Event<E>, E), (T, T), (Self, Self)
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:447:49: error: cannot convert value of type 'Event<E>' to expected argument type 'Event<_>?'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:466:34: error: missing argument label 'handlerID:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:507:22: error: missing argument label 'event:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:513:21: error: missing argument label 'event:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:535:54: error: missing argument label 'upperBound:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:543:19: error: cannot convert value of type 'Transition<S>' to expected element type 'Transition<_>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:380:42: error: closure use of non-escaping parameter 'routeMapping' may allow it to escape
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:374:33: note: parameter 'routeMapping' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:386:13: error: closure use of non-escaping parameter 'handler' may allow it to escape
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:374:98: note: parameter 'handler' is implicitly non-escaping
所以看来pod规范文件没有正确获取pod文件信息,关于repo和分支。
我错过了什么吗?
非常感谢。
答案 0 :(得分:1)
Cocoapods不允许用户使用s.dependency
语法指定分支。
解决方案:
swift/3.0
分支Podfile
使用私有广告的位置
pod 'SwiftState', :git=> 'https://github.com/ReactKit/SwiftState.git', :branch => 'swift/3.0'
答案 1 :(得分:0)
不可以,只能在Podfile中设置未发布的依赖项。