Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mtj0928/swiftyconst

SwiftyConst can automatically embed your enviroment values to Swift files.
https://github.com/mtj0928/swiftyconst

Last synced: 6 days ago
JSON representation

SwiftyConst can automatically embed your enviroment values to Swift files.

Awesome Lists containing this project

README

        

# SwiftyConst

SwiftyConst can automatically embed your constant values to Swift files.

## Input File
Prepare such following swift file.
```swift
let token = __const__TOKEN__text__ABCD__
```
SwiftyConst can replace `__const__TOKEN__text__ABCD__` with `$TOKEN`.

The variable such `__const__TOKEN__text__ABCD__` consists of four components, `prefix`, `key`, `type` and `default value`.
The components must be joined with `__`.
- prefix: This is a just prefix, `const`
- key: This is a key for a constant
- type: This is an optional component. You can select `text` or `num`. The default value is `text`
- default value: This is an optional component. This value will be embed when the value which matches the key does not exist.

## Installation
### Mint
```
$ mint install mtj0928/SwiftyConst
$ swifty-const --help
```

### Manual
```
$ swift build -c release
$ ./.build/release/swifty-const --help
```

## Usage
```
$ swifty-const --o -e
```
If `-e` option is set, SwiftyConst embe constant in YAML file.