GithubHelp home page GithubHelp logo

binarybirds / swift-template Goto Github PK

View Code? Open in Web Editor NEW
46.0 6.0 6.0 23 KB

A template based module generator for Swift projects.

License: MIT License

Swift 98.96% Makefile 1.04%
swift swift-5 template boilerplate module generator

swift-template's Introduction

Swift template

A template based generator for Swift projects.

Install

Clone or download the repository & run:

git clone https://github.com/BinaryBirds/swift-template.git
cd swift-template
make install

Usage

Help:

swift run swift-template-cli --help

Install a new template using a git repository:

swift template install <git-url-of-the-template> [-g]

# install local template
swift template install https://github.com/corekit/viper-module-template

# install global template
swift template install https://github.com/feathercms/feather-module-template -g

Update all templates, both local & global:

swift template update

List available templates:

swift template list

Remove template:

swift template remove [template-name]

Create an empty template project repository:

swift template create [template-name] [-g]

Generate a new module based on a template

swift template generate [name] --use [template-name] --output [path]

# examples
swift template generate MyModule --use viper-module
swift template generate MyModule --use viper-module --output ~/
swift template generate MyModule -u viper-module -o ~/

Scope

Templates can be stored locally or globally inside the .swift-template directory. Local templates are being loaded from the current work dir, globals from the home folder. The system will prefer local templates (with the same name) over the global ones.

Parameters

You can use the following parameters in the templates (even in file names):

  • name - given module name

  • Name - given module name (capitalized first letter)

  • NAME - given module name (uppercased)

  • project - based on .xcodeproj or .xcworkspace name or input name

  • author - based on git config user name

  • date - current date in local short format

eg. {name} -> MyModule

swift-template's People

Contributors

felixlisczyk avatar tib avatar viaszkadi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.