Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

cfr/burningbar

Repository files navigation

Burning Bar 📏🔥Join the chat at https://gitter.im/cfr/burningbar Unlicensed Build Status Coverage Status

Swift RPC generator.

Available online with simple spec editor and output viewer.

Clone and run:

$ git clone https://github.com/cfr/burningbar.git
$ cd burningbar
$ make example

See INSTALL for general installation and Xcode integration instruction.

Usage

Command

$ burningbar --spec-file spec.bb

reads spec.bb and generates Interface.swift (RPC funcs) and Entities.swift (structs/mappers), Interface class is parameterized by Transport protocol containing call, cast, listen, cancel funcs and CancellationToken typealias. Struct's init?(json:) takes [String: AnyObject] representing JSON object, json returns this object back.

See help for more options:

$ burningbar --help
burningbar: Usage: burningbar [-vhtirdsbpc]
http:https://j.mp/burnbar v0.6.1-α
  -v                  --version                         print version number
  -h                  --help                            print help
  -t Transport        --transport=Transport             transport protocol name
  -i Iterface         --interface=Iterface              interface class name
  -r Interface.swift  --interface-file=Interface.swift  interface out filename
  -d Entities.swift   --entities-file=Entities.swift    entities out filename
  -s spec.bb     --spec-file=spec.bb          input spec file
  -b                  --dynamicity-shield               accept weak-typed json
  -p .                --path=.                          output path prefix
  -c                  --validate                        validate spec, exit on error