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

Commit

Permalink
Update to Swift 5.3 (#29)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mattt authored Nov 24, 2020
1 parent 37995d5 commit 3a7db2f
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 33 deletions.
59 changes: 53 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,73 @@ on:
branches: [master]

jobs:
macos:
runs-on: macOS-latest
macos_big_sur:
runs-on: macos-11.0

strategy:
matrix:
xcode:
- "12.2" # Swift 5.3

name: "macOS Big Sur (Xcode ${{ matrix.xcode }})"

steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-
- name: Build and Test
run: swift test
run: |
swift test
env:
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

macos_catalina:
runs-on: macos-10.15

strategy:
matrix:
xcode:
- "12" # Swift 5.3

name: "macOS Catalina (Xcode ${{ matrix.xcode }})"

steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-
- name: Build and Test
run: |
swift test
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

linux:
runs-on: ubuntu-latest

strategy:
matrix:
swift:
- "5.3"

name: "Linux (Swift ${{ matrix.swift }})"

container:
image: swift:5.2
image: swift:${{ matrix.swift }}
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build and Test
run: swift test --enable-test-discovery
run: |
swift test --enable-test-discovery
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Changed Swift version requirement to 5.3.
#29 by @mattt.

## [0.1.0] - 2020-05-04

### Added
Expand Down
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "9f04d1ff1afbccd02279338a2c91e5f27c45e93a",
"version": "0.0.5"
"revision": "92646c0cdbaca076c8d3d0207891785b3379cbff",
"version": "0.3.1"
}
},
{
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "74d7b91ceebc85daf387ebb206003f78813f71aa",
"version": "1.2.0"
"revision": "173f567a2dfec11d74588eea82cecea555bdc0bc",
"version": "1.4.0"
}
},
{
"package": "SwiftSyntax",
"repositoryURL": "https://github.com/apple/swift-syntax.git",
"state": {
"branch": "0.50200.0",
"revision": "0688b9cfc4c3dd234e4f55f1f056b2affc849873",
"branch": "0.50300.0",
"revision": "844574d683f53d0737a9c6d706c3ef31ed2955eb",
"version": null
}
},
Expand Down
45 changes: 31 additions & 14 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,36 +1,53 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "DocTest",
platforms: [
.macOS(.v10_10)
.macOS(.v10_12)
],
products: [
.executable(name: "swift-doctest", targets: ["swift-doctest"]),
.library(name: "DocTest", targets: ["DocTest"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/apple/swift-syntax.git", .revision("0.50200.0")),
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.4")),
.package(url: "https://github.com/SwiftDocOrg/TAP.git", .upToNextMinor(from: "0.1.1")),
.package(url: "https://github.com/SwiftDocOrg/StringLocationConverter.git", .upToNextMinor(from: "0.0.1")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMinor(from: "1.2.0")),
.package(name: "SwiftSyntax",
url: "https://github.com/apple/swift-syntax.git",
.revision("0.50300.0")
),
.package(url: "https://github.com/apple/swift-argument-parser.git",
.upToNextMinor(from: "0.3.1")
),
.package(url: "https://github.com/SwiftDocOrg/TAP.git",
.upToNextMinor(from: "0.1.1")
),
.package(url: "https://github.com/SwiftDocOrg/StringLocationConverter.git",
.upToNextMinor(from: "0.0.1")
),
.package(url: "https://github.com/apple/swift-log.git",
.upToNextMinor(from: "1.4.0")
),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "swift-doctest",
dependencies: ["DocTest", "StringLocationConverter", "ArgumentParser", "Logging"]),
dependencies: [
.target(name: "DocTest"),
.product(name: "StringLocationConverter", package: "StringLocationConverter"),
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "Logging", package: "swift-log"),
]),
.target(
name: "DocTest",
dependencies: ["SwiftSyntax", "TAP"]),
dependencies: [
.product(name: "SwiftSyntax", package: "SwiftSyntax"),
.product(name: "TAP", package: "TAP"),
]),
.testTarget(
name: "DocTestTests",
dependencies: ["DocTest"]),
dependencies: [
.target(name: "DocTest"),
]),
]
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ just like a unit test.

## Requirements

- Swift 5.2
- Swift 5.3

> **Note**:
> When running `swift-doctest` from a Docker container,
Expand Down
10 changes: 4 additions & 6 deletions Sources/swift-doctest/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,19 @@ struct SwiftDocTest: ParsableCommand {
var input: String

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

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

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

@Flag(help: "Use verbose output")
var verbose: Bool
var verbose: Bool = false
}

static var configuration = CommandConfiguration(
Expand Down

0 comments on commit 3a7db2f

Please sign in to comment.