File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments