-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a44184
commit a192063
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Swift Precompiler | ||
|
||
⚡ A fast, lightweight precompiler for Swift | ||
|
||
### Features | ||
|
||
- Add Rust's `includeStr!` like functionality to Swift with the `precompileIncludeStr` function | ||
|
||
### Installation | ||
|
||
Cargo: | ||
```shell | ||
cargo install swift-precompiler | ||
``` | ||
|
||
### Configuration | ||
|
||
Run `swift-precompiler init` to initialise a config file `swift-precompiled.toml` with the default values | ||
|
||
Available options: | ||
- `dirs` - An array of directories to search for Swift source files that require precompilation | ||
- `path_aliases` - A dictionary of path aliases to use in `precompileIncludeStr` calls | ||
|
||
Example: | ||
```toml | ||
dirs = ["Cider/", "CiderPlaybackAgent/"] | ||
|
||
[path_aliases] | ||
# "@" as a path alias refers to the current working directory in most cases | ||
"@" = "./" | ||
``` | ||
|
||
### Usage | ||
|
||
Including a file as a string literal at compile time: | ||
```swift | ||
let javaScript = precompileIncludeStr("path/to/file.js") | ||
``` | ||
|