Skip to content

Commit

Permalink
Add "Adding resources" doc
Browse files Browse the repository at this point in the history
  • Loading branch information
akesson committed Jan 16, 2023
1 parent 279d395 commit 4cda9a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions book/src/building/swift-packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,19 @@ cd SwiftProject
swift run
# You should see "Hello from Rust!" in your terminal.
```

## Adding resources

You can add resources to your Swift Package by specifying them when running the `swift-bridge-cli`
with the `--resource` flag. Use colon-separated source and destination paths.
Examples:

- `--resource=source:destination`
- `--resource=some_folder/some_file.txt:to_folder/some_file.txt`
- `--resource=source_folder:destination_folder`.

These resources will be accessible from your Swift Package's `Bundle` as a property.

```swift
Bundle.<camel cased cargo package name>
```

0 comments on commit 4cda9a7

Please sign in to comment.