Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
lockieluke committed Jan 13, 2024
1 parent 9a44184 commit a192063
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
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")
```

0 comments on commit a192063

Please sign in to comment.