krzyzanowskim / Natalie

Natalie - Storyboard Code Generator (for Swift)
http://blog.krzyzanowskim.com/2015/04/15/natalie-storyboard-code-generator/
MIT License
1.17k stars 74 forks source link

Build failure on macOS 10.13 with Xcode 9 (swift 3.2) #106

Closed fxcoudert closed 6 years ago

fxcoudert commented 6 years ago

Cannot build 0.5.0 on macOS 10.13 with Xcode 9:

$ swift build -c release -Xswiftc -static-stdlib
Compile Swift Module 'natalie' (14 sources)
natalie.XMLIndexer:72:22: error: invalid redeclaration of 'Element'
    public typealias Element = natalie.XMLIndexer
                     ^
/private/tmp/Natalie-0.5.0/Sources/natalie/SWXMLHash/SWXMLHash.swift:359:10: note: 'Element' previously declared here
    case Element(XMLElement)
         ^
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /private/tmp/Natalie-0.5.0/.build/release.yaml main
phimage commented 6 years ago

You try to compile with swift 4.

The project has not been update for it. So you could find a way to use swift 3 until that.

fxcoudert commented 6 years ago

I am using the Apple-provided tools (Xcode 9) on macOS 10.13. So Natalie is not supported on latest macOS or with Xcode 9?

phimage commented 6 years ago

Xcode 9 could compile with swift 3.2 But by default swift 4

You could open the project with xcode and compile it

I do not know the command line argument to force swift version

fxcoudert commented 6 years ago

If I open in Xcode and compile it I get the same error:

capture d ecran 2017-10-10 a 16 21 10

phimage commented 6 years ago

I have not maybe due to some compile cash But when I clean my project I have also the same error with swift 3,2

I you want to make a rapid patch Edit SWXMLHash.swift go to public enum XMLIndexer: Sequence { and in next line rename case Element to case element using refactor (or replace each .Element to .element)

OR

SWXMLHash has been updated, but Nathalie provide a old version You can try with this one if in swift 3.2 https://github.com/drmohundro/SWXMLHash/blob/master/Source/SWXMLHash.swift

krzyzanowskim commented 6 years ago

do you want to prepare PR with that update? I'm happy to merge

phimage commented 6 years ago

I could, by updating SWXMLHash You could assign to me this issue, if you want (a way to not forget)