Skip to content

Commit f912d16

Browse files
authored
Update README.md with installation instructions and SPI badges (#35)
* feat: Update README.md Add installation guide * fix: Update README.md * feat: Add SPI badges
1 parent 2a72944 commit f912d16

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Swift Macro Toolkit
22

3+
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fstackotter%2Fswift-macro-toolkit%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/stackotter/swift-macro-toolkit) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fstackotter%2Fswift-macro-toolkit%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/stackotter/swift-macro-toolkit)
4+
35
**Did you know that `-0xF_ep-0_2` is a valid floating point literal in Swift?** Well you probably didn't
46
(it's equal to -63.5), and as a macro author you shouldn't even have to care! Among many things, Macro
57
Toolkit shields you from edge cases so that users can use your macros in whatever weird (but correct)
@@ -340,3 +342,45 @@ let diagnostic = Diagnostic(
340342
]
341343
)
342344
```
345+
346+
## Installation
347+
348+
Add `swift-macro-toolkit` dependency to your package file.
349+
350+
```swift
351+
.package(
352+
url: "https://github.com/stackotter/swift-macro-toolkit.git",
353+
.upToNextMinor(from: "0.8.0") // swift-syntax 602.0.0
354+
)
355+
```
356+
357+
Do not forget about target dependencies:
358+
359+
```swift
360+
.product(
361+
name: "MacroToolkit",
362+
package: "swift-macro-toolkit"
363+
)
364+
```
365+
366+
> [!TIP]
367+
>
368+
> _You can extend compatibility by supporting multiple [`swift-syntax`](https://github.com/swiftlang/swift-syntax) versions_
369+
>
370+
> ```swift
371+
> .package(
372+
> url: "https://github.com/stackotter/swift-macro-toolkit.git",
373+
> "0.3.1"..."0.8.0" // swift-syntax 509.0.0...602.0.0
374+
> )
375+
> ```
376+
>
377+
> **Version map**
378+
>
379+
> | swift-macro-toolkit | swift-syntax |
380+
> | ------------------- | ------------------------------ |
381+
> | `0.3.1` | `apple/swift-syntax` `509.0.0` |
382+
> | `0.4.0` | `apple/swift-syntax` `510.0.0` |
383+
> | `0.5.0` | `510.0.0` |
384+
> | `0.6.0` | `600.0.0` |
385+
> | `0.7.0` | `601.0.0` |
386+
> | `0.8.0` | `602.0.0` |

0 commit comments

Comments
 (0)