Skip to content

Commit 529be49

Browse files
committed
Migrate build script to Swift
1 parent cecb034 commit 529be49

File tree

73 files changed

+612
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+612
-30
lines changed

CodeGeneration/Package.swift renamed to SwiftSyntaxCLI/Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import PackageDescription
44
import Foundation
55

66
let package = Package(
7-
name: "CodeGeneration",
7+
name: "SwiftSyntaxCLI",
88
platforms: [
99
.macOS(.v10_15)
1010
],
1111
products: [
12-
.executable(name: "generate-swiftsyntax", targets: ["generate-swiftsyntax"])
12+
.executable(name: "swift-syntax-cli", targets: ["swift-syntax-cli"])
1313
],
1414
dependencies: [
1515
.package(url: "..", revision: "HEAD")
1616
],
1717
targets: [
1818
.executableTarget(
19-
name: "generate-swiftsyntax",
19+
name: "swift-syntax-cli",
2020
dependencies: [
2121
.product(name: "SwiftSyntax", package: "swift-syntax"),
2222
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
# Code-Generation for SwiftSyntax
1+
# SwiftSyntaxCLI
2+
3+
## Code-Generation for SwiftSyntax
24

35
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).
46

57
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.
68

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.
911

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.
1214

1315
On the command line, this would be
1416
```bash
15-
swift run --package-path CodeGeneration generate-swiftsyntax Sources
17+
swift run --package-path SwiftSyntaxCLI swift-syntax-cli generate-source-code Sources
1618
```
1719

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

Comments
 (0)