swiftcsv / SwiftCSV

CSV parser for Swift
MIT License
962 stars 193 forks source link

couldn't add swiftCSV as dependency in podspec #60

Closed yaronj3 closed 5 years ago

yaronj3 commented 7 years ago

Hi,

I am trying to create a pod file which uses the swiftCSV so I need to add it as dependency.

I added the line: s.dependency 'SwiftCSV'

And the result:

** BUILD FAILED **

The following build commands failed:
    CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler
    CompileSwift normal i386
(2 failures)
 -> ReportySdk (0.2.70)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/CSV.swift:45:83: error: 'NSStringEncoding' has been renamed to 'String.Encoding'
    - NOTE  | xcodebuild:  Foundation.NSStringEncoding:2:18: note: 'NSStringEncoding' has been explicitly marked unavailable here
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/CSV.swift:57:81: error: 'NSStringEncoding' has been renamed to 'String.Encoding'
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/CSV.swift:64:45: error: 'NSStringEncoding' has been renamed to 'String.Encoding'
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/CSV.swift:33:27: error: single argument function types require parentheses
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Parser.swift:12:34: error: single argument function types require parentheses
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/ParserHelpers.swift:43:41: error: single argument function types require parentheses
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/CSV.swift:36:25: error: missing argument label 'block:' in call
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Description.swift:13:27: error: 'joinWithSeparator' has been renamed to 'joined(separator:)'
    - NOTE  | xcodebuild:  Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Description.swift:16:37: error: 'joinWithSeparator' has been renamed to 'joined(separator:)'
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Description.swift:17:11: error: 'joinWithSeparator' has been renamed to 'joined(separator:)'
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Parser.swift:45:41: error: missing argument label 'char:' in call
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Parser.swift:69:45: error: missing argument label 'char:' in call
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Parser.swift:89:45: error: missing argument label 'char:' in call
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Parser.swift:115:41: error: 'successor()' is unavailable: To get the next index call 'index(after:)' on the CharacterView instance that produced the index.
    - NOTE  | xcodebuild:  Swift.String.CharacterView.Index:3:17: note: 'successor()' has been explicitly marked unavailable here
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Parser.swift:30:17: error: closure use of non-escaping parameter 'block' may allow it to escape
    - NOTE  | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/Parser.swift:12:27: note: parameter 'block' is implicitly non-escaping
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/ParserHelpers.swift:30:40: error: single argument function types require parentheses
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/ParserHelpers.swift:31:39: error: 'enumerate()' has been renamed to 'enumerated()'
    - NOTE  | [iOS] xcodebuild:  Swift.Sequence:3:17: note: 'enumerate()' has been explicitly marked unavailable here
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/ParserHelpers.swift:44:30: error: missing argument label 'block:' in call
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/String+Lines.swift:14:27: error: 'successor()' is unavailable: To get the next index call 'index(after:)' on the CharacterView instance that produced the index.
    - ERROR | [iOS] xcodebuild:  SwiftCSV/SwiftCSV/String+Lines.swift:16:16: error: use of unresolved identifier 'substringToIndex'

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 21 errors.
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: 
    `echo "2.3" > .swift-version`.

Please advise.

GaelPeBer commented 7 years ago

I guess that is because this library does not support Swift 3. I recommend you https://github.com/masteage/SwiftCSV/commits/master

It is forked from master but It has been updated to Swift 3.

ghost commented 7 years ago

@GaelPeBer How would one specify that in the podspec, instead of the default repo defined in the Cocoapods Spec Repo?

GaelPeBer commented 7 years ago

Sorry, I didn't read you are using CocoaPods. I guess It is not going to work with pods unless Masteage has created one podspec for his version. I recommend to you that if it is possible move to Carthage, you only have to add:

github "masteage/SwiftCSV" "master"

to your cartfile.

Good luck

ghost commented 7 years ago

It is not possible to move to Carthage.

Swift 3 has been out for a year, and the code to support it is sitting on a branch. It needs to be merged back in to master so pods work.

sorinmiroiu97 commented 6 years ago

Hey guys. I wanted to use this pod in a project, where i need to parse a csv. The thing is I created the podfile, i typed in there this specific pod, and then pod install. Everything was ok. Opened the workspace and did a build....26 errors only in the pod's classes. I tried to put the swift version to both 3.3 and 4.1 in the settings, but it doesn't look like it's changing anything. Can someone please please tell something? Thanks in advance

DivineDominion commented 5 years ago

Since this is so old and the repo currently builds on all modern Swift versions, I'm closing this. @soryncrash13 if the problem persists, please open a new issue with the current Pod v0.5.0