Skip to content

Commit 0d3f3e3

Browse files
authored
Merge pull request #2362 from KaitoMuraoka/fix/document-tutorial
Tutorial updated to support Xcode15
2 parents 7c1c56c + ed33fe6 commit 0d3f3e3

File tree

6 files changed

+29
-34
lines changed

6 files changed

+29
-34
lines changed

Sources/SwiftSyntax/Documentation.docc/Resources/Package.step1.swift

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "importformatter",
88
products: [
9-
// Products define the executables and libraries a package produces, and make them visible to other packages.
9+
// Products define the executables and libraries a package produces, making them visible to other packages.
1010
.library(
1111
name: "importformatter",
1212
targets: ["importformatter"]
1313
)
1414
],
15-
dependencies: [
16-
// Dependencies declare other packages that this package depends on.
17-
// .package(url: /* package url */, from: "1.0.0"),
18-
],
1915
targets: [
20-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
16+
// Targets are the basic building blocks of a package, defining a module or a test suite.
17+
// Targets can depend on other targets in this package and products from dependencies.
2218
.target(
23-
name: "importformatter",
24-
dependencies: []
19+
name: "importformatter"
2520
),
2621
.testTarget(
2722
name: "importformatterTests",

Sources/SwiftSyntax/Documentation.docc/Resources/Package.step2.swift

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "importformatter",
88
products: [
9-
// Products define the executables and libraries a package produces, and make them visible to other packages.
9+
// Products define the executables and libraries a package produces, making them visible to other packages.
1010
.executable(
1111
name: "importformatter",
1212
targets: ["importformatter"]
1313
)
1414
],
15-
dependencies: [
16-
// Dependencies declare other packages that this package depends on.
17-
// .package(url: /* package url */, from: "1.0.0"),
18-
],
1915
targets: [
20-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
16+
// Targets are the basic building blocks of a package, defining a module or a test suite.
17+
// Targets can depend on other targets in this package and products from dependencies.
2218
.executableTarget(
23-
name: "importformatter",
24-
dependencies: []
19+
name: "importformatter"
2520
),
2621
.testTarget(
2722
name: "importformatterTests",

Sources/SwiftSyntax/Documentation.docc/Resources/Package.step3.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "importformatter",
88
products: [
9-
// Products define the executables and libraries a package produces, and make them visible to other packages.
9+
// Products define the executables and libraries a package produces, making them visible to other packages.
1010
.executable(
1111
name: "importformatter",
1212
targets: ["importformatter"]
@@ -17,11 +17,10 @@ let package = Package(
1717
.package(url: "https://github.com/apple/swift-syntax.git", branch: "main")
1818
],
1919
targets: [
20-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
20+
// Targets are the basic building blocks of a package, defining a module or a test suite.
21+
// Targets can depend on other targets in this package and products from dependencies.
2222
.executableTarget(
23-
name: "importformatter",
24-
dependencies: []
23+
name: "importformatter"
2524
),
2625
.testTarget(
2726
name: "importformatterTests",

Sources/SwiftSyntax/Documentation.docc/Resources/Package.step4.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "importformatter",
88
products: [
9-
// Products define the executables and libraries a package produces, and make them visible to other packages.
9+
// Products define the executables and libraries a package produces, making them visible to other packages.
1010
.executable(
1111
name: "importformatter",
1212
targets: ["importformatter"]
@@ -17,8 +17,8 @@ let package = Package(
1717
.package(url: "https://github.com/apple/swift-syntax.git", branch: "main")
1818
],
1919
targets: [
20-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
20+
// Targets are the basic building blocks of a package, defining a module or a test suite.
21+
// Targets can depend on other targets in this package and products from dependencies.
2222
.executableTarget(
2323
name: "importformatter",
2424
dependencies: [

Sources/SwiftSyntax/Documentation.docc/Resources/Package.step5.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -9,7 +9,7 @@ let package = Package(
99
.macOS(.v10_15)
1010
],
1111
products: [
12-
// Products define the executables and libraries a package produces, and make them visible to other packages.
12+
// Products define the executables and libraries a package produces, making them visible to other packages.
1313
.executable(
1414
name: "importformatter",
1515
targets: ["importformatter"]
@@ -20,8 +20,8 @@ let package = Package(
2020
.package(url: "https://github.com/apple/swift-syntax.git", branch: "main")
2121
],
2222
targets: [
23-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
23+
// Targets are the basic building blocks of a package, defining a module or a test suite.
24+
// Targets can depend on other targets in this package and products from dependencies.
2525
.executableTarget(
2626
name: "importformatter",
2727
dependencies: [

Sources/SwiftSyntax/Documentation.docc/Tutorials/SwiftSyntax By Example.tutorial

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
}
5252

5353
@Steps {
54+
@Step {
55+
Open the `Package.swift` file created in the previous section.
56+
57+
@Code(name: "Package.swift", file: Package.step2.swift)
58+
}
59+
5460
@Step {
5561
Add the `swift-syntax` package to the dependencies section of your
5662
`Package.swift` file.

0 commit comments

Comments
 (0)