Git Product home page Git Product logo

sbg's Introduction

Swift boilerplate generator

Swift boilerplate generator is a command line tool which helps reducing unnecessary work of creating over and over files which follow some scheme.

Installation

Homebrew

Homebrew is a package manager for MacOS. You can install it with the following command:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

When you have homebrew you can install SBG just by running:

$ brew install tooploox/sbg/sbg

Usage

  • Init

    SBG requires specific structure of catalogs and files. To create them go to the root of your project and simply run the command:

    $ SBG init

    It will create .sbg catalog with SBGConfig file inside. Under .sbg it also creates catalogs templates and generators with example files inside.

  • Command Line

    Usage of SBG is pretty simple. It has only 2 commands. One described above and second one is running generator. Syntax is:

    $ SBG generator_name --parameter_one value_one --parameter_two value_two

    where generator_name is a name of your generator to run and then you have list of parameters. This list can be endless and you can provide any parameters you want.

  • SBGConfig

    It is a JSON format file. You can place there any parameters and values you want. It can be empty but then you have to provide parameters and values through console command. All parameters will be searched in your generator and template files and filled up with corresponding values so keep in mind that name of parameters must match. Parameters specified in command line have priority over those from SBGConfig.

  • Generators

    This is JSON format file which describes what files you want to generate. It contains generator's name and list of steps to follow. Every step consists of name of template file, output file name, group and target where file should be added. Please remember that name of this file should match value of the name parameter inside.

  • Templates

    We use Stencil as out template engine. You can read about their syntax on their site. Those files represent how generated files will look like. Generator in every step takes one template, fills corresponding variable with given value and adds this file to proper group and target.

sbg's People

Contributors

vyeczorny avatar dwdmarkowski avatar skarol avatar pchmiel avatar

Stargazers

 avatar Krzysztof Tarnowski avatar

Watchers

Pawel Solyga avatar Krzysztof Tarnowski avatar James Cloos avatar  avatar Oskar Szydłowski avatar  avatar Mateusz Nadolski avatar Jeremi Kaczmarczyk 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.