|
1 | | -# Code-Generation for SwiftSyntax |
| 1 | +# SwiftSyntaxCLI |
| 2 | + |
| 3 | +## Code-Generation for SwiftSyntax |
2 | 4 |
|
3 | 5 | This directory contains file to generate source code that is part of the SwiftSyntax package. If you are looking to generate Swift code yourself, you might be interested in [SwiftSyntaxBuilder](../Sources/SwiftSyntaxBuilder). |
4 | 6 |
|
5 | 7 | Some source code inside SwiftSyntax is generated using [SwiftSyntaxBuilder](../Sources/SwiftSyntaxBuilder), a Swift library whose purpose is to generate Swift code using Swift itself. This kind of code generation is performed by the Swift package defined in this directory. |
6 | 8 |
|
7 | | -This directory is a standalone package that uses HEAD of the current branch. This guarantees that when `generate-swiftsyntax` is run, it can't break its own build when run multiple times without committing. |
8 | | -This means that `CodeGeneration` will build against your latest local commit of SwiftSyntax. If you are making changes to `SwiftSyntax` that affect how code is being generated, commit your SwiftSyntax changes (pushing is not necessary) and re-generate files afterwards. |
| 9 | +This directory is a standalone package that uses HEAD of the current branch. This guarantees that when `generate-source-code` is run, it can't break its own build when run multiple times without committing. |
| 10 | +This means that `SwiftSyntaxCLI` will build against your latest local commit of SwiftSyntax. If you are making changes to `SwiftSyntax` that affect how code is being generated, commit your SwiftSyntax changes (pushing is not necessary) and re-generate files afterwards. |
9 | 11 |
|
10 | | -To re-generate the files after changing `CodeGeneration` run the `generate-swiftsyntax` |
11 | | -target of `CodeGeneration` and pass `path/to/swift-syntax/Sources` as the argument. |
| 12 | +To re-generate the files after changing `SwiftSyntaxCLI` run the `swift-syntax-cli` |
| 13 | +target of `SwiftSyntaxCLI` and pass `path/to/swift-syntax/Sources` as the argument. |
12 | 14 |
|
13 | 15 | On the command line, this would be |
14 | 16 | ```bash |
15 | | -swift run --package-path CodeGeneration generate-swiftsyntax Sources |
| 17 | +swift run --package-path SwiftSyntaxCLI swift-syntax-cli generate-source-code Sources |
16 | 18 | ``` |
17 | 19 |
|
18 | | -Or if you open the `CodeGeneration` package in Xcode, you can add the |
19 | | -`generate-swift syntax ../Sources` arguments using Product -> Scheme -> Edit Scheme… |
20 | | - |
| 20 | +Or if you open the `SwiftSyntaxCLI` package in Xcode, you can add the |
| 21 | +`swift-syntax-cli generate-source-code ../Sources` arguments using Product -> Scheme -> Edit Scheme… |
0 commit comments