Skip to content

Commit a192063

Browse files
committed
Add README
1 parent 9a44184 commit a192063

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Swift Precompiler
2+
3+
⚡ A fast, lightweight precompiler for Swift
4+
5+
### Features
6+
7+
- Add Rust's `includeStr!` like functionality to Swift with the `precompileIncludeStr` function
8+
9+
### Installation
10+
11+
Cargo:
12+
```shell
13+
cargo install swift-precompiler
14+
```
15+
16+
### Configuration
17+
18+
Run `swift-precompiler init` to initialise a config file `swift-precompiled.toml` with the default values
19+
20+
Available options:
21+
- `dirs` - An array of directories to search for Swift source files that require precompilation
22+
- `path_aliases` - A dictionary of path aliases to use in `precompileIncludeStr` calls
23+
24+
Example:
25+
```toml
26+
dirs = ["Cider/", "CiderPlaybackAgent/"]
27+
28+
[path_aliases]
29+
# "@" as a path alias refers to the current working directory in most cases
30+
"@" = "./"
31+
```
32+
33+
### Usage
34+
35+
Including a file as a string literal at compile time:
36+
```swift
37+
let javaScript = precompileIncludeStr("path/to/file.js")
38+
```
39+

0 commit comments

Comments
 (0)