Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to start a new Xcode Project using Commandant? #28

Open
alvivi opened this issue Jul 29, 2015 · 7 comments
Open

How to start a new Xcode Project using Commandant? #28

alvivi opened this issue Jul 29, 2015 · 7 comments

Comments

@alvivi
Copy link

alvivi commented Jul 29, 2015

I want to create new Xcode project to build a CLI tool. So I open Xcode, I create a new command line tool project (using swift), then I try to add Commandant as a dependency, but, I cannot add frameworks as a dependency.

All the projects using Commandant have very peculiar xcodeproj. They seem standard OSX apps, but they are using build phases like "Extract CLI Tool".

Am I missing a tool or a bootstrap project?

@mdiep
Copy link
Member

mdiep commented Jul 29, 2015

You have to jump through some hoops to use Swift in a CLI tool. I'd try to copy what Carthage does.

@neilpa
Copy link
Member

neilpa commented Jul 30, 2015

The root of the problem is that CLI tools statically link the swift stdlib while frameworks dynamically link it. AFAIK there's no way to force dynamic linkage of the stdlib for non-app bundles (c.f. Carthage/Carthage#16).

@Danappelxx
Copy link

Can anyone create a summary of how to use Commandant in a CLI Xcode project (and put it in the README)? Sure, I could look through Carthage's source, but there's a lot more to Carthage than just Commandant, so I would be wasting my time looking through it.
Thanks

@griffin-stewie
Copy link

I agree with @Danappelxx . I need some simple template project for creating CLI tool with Commandant. Carthage it self is too complicated as starting point to learn how to use Commandant.

@mdiep
Copy link
Member

mdiep commented Sep 25, 2016

This would be a great thing to add to the Commandant repo. PRs welcome!

@vknabel
Copy link

vknabel commented Dec 8, 2016

The easiest way probably is to use the SwiftPM and generating the xcodeproj.

$ swift package init --type executable
Then adding Commandant as dependency.
At the end just run
$ swift package generate-xcodeproj

@griffin-stewie
Copy link

Thank you @vknabel . It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants