Giter Club home page Giter Club logo

create-swift-package's Introduction

create-swift-package header

create-swift-package

create-swift-package demo

A command-line utility to create Swift packages with ✨ flair ✨

  • 🔮 Interactive: Answer a set of questions interactively to configure your shiny new Swift package.
  • ⚒️ Feature-rich: Built-in support for generating library and executable products, mixed-language targets and more.
  • 👷 Extensive support: Allows you to generate packages targeting macOS, iOS, watchOS and tvOS from Swift 5.4+.
  • 🚦 Well-tested: Supported by unit and integration tests over various Swift tools versions.

🎁 Installation

create-swift-package is distributed via npm and for best results requires Node 16.10+ or 18.0.0+. You can run it with npx:

$ npx create-swift-package

🧑‍💻 Usage

Run create-swift-package without any arguments. It runs in interactive mode to prompt you to configure your product and targets. You can optionally provide a directory that you want your new package to be located in.

There are also a couple of command-line flags which are supported:

  • --no-prompt-xcode: When the package has been successfully created, don't prompt you to open it in Xcode.
  • --no-swift-build: By default create-swift-package runs swift build in your new package directory to validate that it has been set up correctly. Disable this check with this flag.
  • --dry-run: Do everything apart from actually creating the package and files.

📦 Supported setups

🛠️ Swift tools

Support for Swift tools versions >= 5.4. Defaults to your currently installed Swift version. Versions greater than your currently installed Swift version are disabled.

📱 Platforms

Supports generating packages for iOS 8.0+, macOS 10.10+, watchOS 2.0+ and tvOS 9.0+

📦 Products

Supports generating both library and executable products.

🗣️ Language support

Swift targets can include either Swift or C-family (C/C++/Objective-C/Objective-C++) code but not both. create-swift-package allows you to create packages that support either Swift code, C-family code or a mix of both:

  • Swift and C-family packages are created with a single target containing either Swift or C-family code.
  • Mixed packages are created with two targets: one which includes Swift code, and another (postfixed with ObjCxx) including C-family code. The swift target depends on the C-family target.

C-style Headers

  • C-family targets require a public headers directory; this defaults to include but can be configured.
  • create-swift-package creates a single umbrella header in your public headers directory with the same name as your C-family target

🏎️ Tests

Test targets can be created for library or executable products, for both Swift and Objective-C targets.

🙋‍♂️ FAQ

Why isn't this written in Swift?

Swift is great for lots of things, but this is a good case of using the right tool for the job. create-swift-package is built using some great npm packages including prompts and ora for its interactivity, which would have been much harder to do in Swift.

create-swift-package's People

Contributors

alexrozanski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.