Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 3a7db2f

Browse files
authored
Update to Swift 5.3 (#29)
* Update swift-syntax dependency for Swift 5.3 * Update swift-argument-parser dependency to 0.3.1 * Update swift-log dependency to 1.4.0 * Update macOS platform target to 10.12 * Update to swift-tools-version:5.3 * Update CI workflow for macOS Big Sur and Swift 5.3 * Update Requirements section in README * Add changelog entry for #29
1 parent 37995d5 commit 3a7db2f

File tree

6 files changed

+100
-33
lines changed

6 files changed

+100
-33
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,73 @@ on:
77
branches: [master]
88

99
jobs:
10-
macos:
11-
runs-on: macOS-latest
10+
macos_big_sur:
11+
runs-on: macos-11.0
12+
13+
strategy:
14+
matrix:
15+
xcode:
16+
- "12.2" # Swift 5.3
17+
18+
name: "macOS Big Sur (Xcode ${{ matrix.xcode }})"
1219

1320
steps:
1421
- name: Checkout
1522
uses: actions/checkout@v1
23+
- uses: actions/cache@v2
24+
with:
25+
path: .build
26+
key: ${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
27+
restore-keys: |
28+
${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-
1629
- name: Build and Test
17-
run: swift test
30+
run: |
31+
swift test
1832
env:
19-
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
33+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
34+
35+
macos_catalina:
36+
runs-on: macos-10.15
37+
38+
strategy:
39+
matrix:
40+
xcode:
41+
- "12" # Swift 5.3
42+
43+
name: "macOS Catalina (Xcode ${{ matrix.xcode }})"
44+
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v1
48+
- uses: actions/cache@v2
49+
with:
50+
path: .build
51+
key: ${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
52+
restore-keys: |
53+
${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-
54+
- name: Build and Test
55+
run: |
56+
swift test
57+
env:
58+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
2059

2160
linux:
2261
runs-on: ubuntu-latest
2362

63+
strategy:
64+
matrix:
65+
swift:
66+
- "5.3"
67+
68+
name: "Linux (Swift ${{ matrix.swift }})"
69+
2470
container:
25-
image: swift:5.2
71+
image: swift:${{ matrix.swift }}
2672
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined
2773

2874
steps:
2975
- name: Checkout
3076
uses: actions/checkout@v1
3177
- name: Build and Test
32-
run: swift test --enable-test-discovery
78+
run: |
79+
swift test --enable-test-discovery

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Changed Swift version requirement to 5.3.
13+
#29 by @mattt.
14+
1015
## [0.1.0] - 2020-05-04
1116

1217
### Added

Package.resolved

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,53 @@
1-
// swift-tools-version:5.1
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
1+
// swift-tools-version:5.3
32

43
import PackageDescription
54

65
let package = Package(
76
name: "DocTest",
87
platforms: [
9-
.macOS(.v10_10)
8+
.macOS(.v10_12)
109
],
1110
products: [
1211
.executable(name: "swift-doctest", targets: ["swift-doctest"]),
1312
.library(name: "DocTest", targets: ["DocTest"])
1413
],
1514
dependencies: [
16-
// Dependencies declare other packages that this package depends on.
17-
.package(url: "https://github.com/apple/swift-syntax.git", .revision("0.50200.0")),
18-
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.4")),
19-
.package(url: "https://github.com/SwiftDocOrg/TAP.git", .upToNextMinor(from: "0.1.1")),
20-
.package(url: "https://github.com/SwiftDocOrg/StringLocationConverter.git", .upToNextMinor(from: "0.0.1")),
21-
.package(url: "https://github.com/apple/swift-log.git", .upToNextMinor(from: "1.2.0")),
15+
.package(name: "SwiftSyntax",
16+
url: "https://github.com/apple/swift-syntax.git",
17+
.revision("0.50300.0")
18+
),
19+
.package(url: "https://github.com/apple/swift-argument-parser.git",
20+
.upToNextMinor(from: "0.3.1")
21+
),
22+
.package(url: "https://github.com/SwiftDocOrg/TAP.git",
23+
.upToNextMinor(from: "0.1.1")
24+
),
25+
.package(url: "https://github.com/SwiftDocOrg/StringLocationConverter.git",
26+
.upToNextMinor(from: "0.0.1")
27+
),
28+
.package(url: "https://github.com/apple/swift-log.git",
29+
.upToNextMinor(from: "1.4.0")
30+
),
2231
],
2332
targets: [
24-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
25-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2633
.target(
2734
name: "swift-doctest",
28-
dependencies: ["DocTest", "StringLocationConverter", "ArgumentParser", "Logging"]),
35+
dependencies: [
36+
.target(name: "DocTest"),
37+
.product(name: "StringLocationConverter", package: "StringLocationConverter"),
38+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
39+
.product(name: "Logging", package: "swift-log"),
40+
]),
2941
.target(
3042
name: "DocTest",
31-
dependencies: ["SwiftSyntax", "TAP"]),
43+
dependencies: [
44+
.product(name: "SwiftSyntax", package: "SwiftSyntax"),
45+
.product(name: "TAP", package: "TAP"),
46+
]),
3247
.testTarget(
3348
name: "DocTestTests",
34-
dependencies: ["DocTest"]),
49+
dependencies: [
50+
.target(name: "DocTest"),
51+
]),
3552
]
3653
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ just like a unit test.
2929

3030
## Requirements
3131

32-
- Swift 5.2
32+
- Swift 5.3
3333

3434
> **Note**:
3535
> When running `swift-doctest` from a Docker container,

Sources/swift-doctest/main.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,19 @@ struct SwiftDocTest: ParsableCommand {
3030
var input: String
3131

3232
@Option(name: [.customLong("swift-launch-path")],
33-
default: REPL.Configuration.default.launchPath,
3433
help: "The path to the swift executable.")
35-
var launchPath: String
34+
var launchPath: String = REPL.Configuration.default.launchPath
3635

3736
@Flag(name: [.customShort("p"), .customLong("package")],
3837
help: "Whether to run the REPL through Swift Package Manager (`swift run --repl`).")
39-
var runThroughPackageManager: Bool
38+
var runThroughPackageManager: Bool = false
4039

4140
@Option(name: [.customLong("assumed-filename")],
42-
default: "Untitled.swift",
4341
help: "The assumed filename to use for reporting when parsing from standard input.")
44-
var assumedFilename: String
42+
var assumedFilename: String = "Untitled.swift"
4543

4644
@Flag(help: "Use verbose output")
47-
var verbose: Bool
45+
var verbose: Bool = false
4846
}
4947

5048
static var configuration = CommandConfiguration(

0 commit comments

Comments
 (0)