Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mtj0928/swiftyconst
- Owner: mtj0928
- Created: 2021-01-04T08:19:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-25T12:54:13.000Z (over 1 year ago)
- Last Synced: 2024-10-30T19:07:33.524Z (about 2 months ago)
- Language: Swift
- Homepage:
- Size: 25.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.