Saber
Dependency Injection (DI) / Inversion of Control (IoC) command line tool for Swift based on code generation.
Saber requires no frameworks, just parses sources (via SourceKitten), finds annotations and generates containers.
Documentation
Please, see wiki and examples.
Installation
Building on macOS requires Xcode w/ Swift 4.2 and Swift Package Manager.
$ mint install apleshkov/saber
Homebrew
TODO (not notable enough yet)
Make
Clone & run make install in the root directory of this project.
Run make uninstall to uninstall.
Usage
$ saber help
Available commands:
help Display general or command-specific help
sources Generate containers from sources
version Print current version
xcodeproj Generate containers from Xcode project
sources
Saber traverses swift-files --from recursively and generates container classes to --out.
Example: saber sources --workDir . --from Sources --out Sources/Saber
$ saber help sources
Generate containers from sources
[--workDir (string)]
Working directory (optional)
[--from (string)]
Directory with sources (is relative to --workDir if any)
[--out (string)]
Output directory (is relative to --workDir if any)
[--config (string)]
Path to *.yml or YAML text (optional)
[--log (string)]
Could be 'info' (by default) or 'debug' (optional)