From fc46247836be0303bf714ad3736b2f21956bcdb9 Mon Sep 17 00:00:00 2001 From: Logan Wright Date: Tue, 2 Aug 2016 13:16:24 -0400 Subject: [PATCH] adding xcode page --- couscous.yml | 6 ++++++ getting-started/xcode.md | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 getting-started/xcode.md diff --git a/couscous.yml b/couscous.yml index c840f026..b03a1647 100644 --- a/couscous.yml +++ b/couscous.yml @@ -20,12 +20,18 @@ menu: getting-started-install-swift-3: text: Install Swift 3 relativeUrl: getting-started/install-swift-3.html + getting-started-quickstart: + text: Manual QuickStart + relativeUrl: getting-started/quickstart.html getting-started-install-toolbox: text: Install Toolbox relativeUrl: getting-started/install-toolbox.html getting-started-hello-world: text: Hello, World relativeUrl: getting-started/hello-world.html + getting-started-xcode: + text: Xcode + relativeUrl: getting-started/xcode.html guide: name: Guide items: diff --git a/getting-started/xcode.md b/getting-started/xcode.md new file mode 100644 index 00000000..2fae9596 --- /dev/null +++ b/getting-started/xcode.md @@ -0,0 +1,45 @@ +--- +currentMenu: getting-started-xcode +--- + +# Xcode + +The first thing you'll probably notice about Vapor and SwiftPM projects in general is that we don't include an Xcode project. In fact, when SwiftPM generates packages, the `.xcodeproj` file is gitignored by default. + +This means we don't have to worry about pbxproj conflicts, and it's easy for different platforms to utilize their own editors. + +# Generate Project + +### Vapor Toolbox + +To generate a new Xcode project for a project, use: + +```bash +vapor xcode +``` + +> If you'd like to automatically open the Xcode project, use `vapor xcode -y` + +### Manual + +To generate a new Xcode project manually. + +```bash +swift package generate-xcodeproj +``` + +Open the project and continue normally. + +## Flags + +For many packages with underlying c-dependencies, users will need to pass linker flags during **build** AND **project generation**. Make sure to consult the guides associated with those dependencies. For example: + +``` +vapor xcode --mysql +``` + +or + +``` +swift package generate-xcodeproj -Xswiftc -I/usr/local/include/mysql -Xlinker -L/usr/local/lib +```