docopt.swift icon indicating copy to clipboard operation
docopt.swift copied to clipboard

Linux Build

Open samdeane opened this issue 7 years ago • 6 comments

NB This is work in progress. It incorporates the changes from #12 and #13 so it would make sense to review/merge them first. I've changed the project layout slightly so the Cocoapods file may need tweaking.

Changes to build on Linux:

  • removed use of @objc
  • removed lots of casting to AnyObject, in favour of just using Any
  • added a basic mechanism for matching dictionaries without NSObject
  • removed other cases of reliance on NSObject/NSValue/etc
  • changed project layout to match SwiftPM's default expectations
  • added LinuxMain.swift for tests and hooked it up to the existing tests

samdeane avatar Mar 08 '18 17:03 samdeane

That looks great, massive thanks for the effort!

One thing I'm concerned about is Objective-C support, which this PR is dropping in favor of Linux. I'll think about it and get back to you.

Another thing - if we decide that Linux is the way to go, then travis ci should also run tests on Linux. Do you think they support swift on Linux by now?

kovpas avatar Mar 09 '18 20:03 kovpas

One thing I'm concerned about is Objective-C support, which this PR is dropping in favor of Linux. I'll think about it and get back to you.

Ah, hmm - I wasn't specifically intending to drop Obj-C support, but of course I did. Is there an existing Obj-C port of Docopt? I suppose I'd say that if people are working in a mixed environment they should use that (if it exists), and that this one should aim to be a pure-Swift one. I can see though that it's hard to please everyone :)

Another thing - if we decide that Linux is the way to go, then travis ci should also run tests on Linux. Do you think they support swift on Linux by now?

Funnily enough I'm in the process of figuring this out at the moment for one of my other packages. It looks like it works with a bit of tweaking. I'll update #14 when I've got it going.

samdeane avatar Mar 10 '18 13:03 samdeane

Unfortunately, I don't know any obj-c compatible ports of docopt. On the other hand, I think it would be fair to say that version 0.6.6 is the last that supports objective-c. And obj-c compatible version will still be available to download and use.

Again, thanks a lot for the effort, I really appreciate it!

kovpas avatar Mar 10 '18 15:03 kovpas

@samdeane tests on Linux are failing even tough travis reports a success.

kovpas avatar Mar 11 '18 09:03 kovpas

Hmm. Looks like the final run did pass, although there are some warnings. I'll see if I can stomp them. There seems to be a subtle difference between the Mac and Linux compilers that I'm testing with, probably because the Linux one is a development snapshot.

samdeane avatar Mar 12 '18 12:03 samdeane

Perhaps this project needs to be split, having the ObjC one in another repo?

lf-araujo avatar Aug 21 '18 22:08 lf-araujo