Skip to content

Commit 938e4c7

Browse files
authored
Upgrades for Xcode 13 (SourceDocs#70)
* WIP: some fixes * Fix Xcode13 issues and dependency updates. Remove dependency on SwiftPM * Updates for 2.0.0 * Use Swift 5.5 on workflows * Checkout current working code * Update checkout directory * Unit test workflow * Update test.yml
1 parent 42c2357 commit 938e4c7

22 files changed

+963
-296
lines changed

.github/workflows/install.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ jobs:
1616
name: Install from Source on macOS
1717
runs-on: macos-latest
1818
steps:
19+
# - name: Setup Swift
20+
# uses: fwal/[email protected]
21+
# with:
22+
# swift-version: 5.5
23+
- name: Checkout
24+
uses: actions/[email protected]
1925
- name: Install SourceDocs
2026
run: |
21-
git clone --depth 1 https://github.com/eneko/SourceDocs.git
22-
cd SourceDocs
27+
swift --version
2328
make install
2429
sourcedocs version
2530
@@ -31,9 +36,14 @@ jobs:
3136
run: |
3237
sudo apt-get update
3338
sudo apt-get install -y libsqlite3-dev libedit-dev
39+
# - name: Setup Swift
40+
# uses: fwal/[email protected]
41+
# with:
42+
# swift-version: 5.5
43+
- name: Checkout
44+
uses: actions/[email protected]
3445
- name: Install SourceDocs
3546
run: |
36-
git clone --depth 1 https://github.com/eneko/SourceDocs.git
37-
cd SourceDocs
47+
swift --version
3848
sudo make install
3949
sourcedocs version

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run Unit Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
macOS:
7+
name: Unit Test on macOS
8+
runs-on: macos-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/[email protected]
12+
- name: Unit Test
13+
run: |
14+
swift --version
15+
swift test
16+
17+
ubuntu:
18+
name: Unit Test on Ubuntu
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Install Dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y libsqlite3-dev libedit-dev
25+
- name: Checkout
26+
uses: actions/[email protected]
27+
- name: Unit Test
28+
run: |
29+
swift --version
30+
swift test

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#### Bug Fixes
1010
- None
1111

12+
## 2.0.0
13+
14+
- Remove dependency on SwiftPM module for package dump decoding
15+
- Updates required for Xcode 13
16+
1217

1318
## 1.2.1
1419

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TOOL_NAME = sourcedocs
2-
VERSION = 1.2.1
2+
VERSION = 2.0.0
33

44
PREFIX = /usr/local
55
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)
@@ -23,7 +23,7 @@ lint:
2323
swiftlint lint --quiet --strict
2424

2525
docs:
26-
swift run sourcedocs generate -car -o docs/reference
26+
swift run sourcedocs generate --clean -ar -o docs/reference
2727
swift run sourcedocs package -r -o docs
2828

2929
linuxmain:

Package.resolved

Lines changed: 6 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,6 @@
11
{
22
"object": {
33
"pins": [
4-
{
5-
"package": "Commandant",
6-
"repositoryURL": "https://github.com/Carthage/Commandant.git",
7-
"state": {
8-
"branch": null,
9-
"revision": "ab68611013dec67413628ac87c1f29e8427bc8e4",
10-
"version": "0.17.0"
11-
}
12-
},
13-
{
14-
"package": "CwlCatchException",
15-
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git",
16-
"state": {
17-
"branch": null,
18-
"revision": "7cd2f8cacc4d22f21bc0b2309c3b18acf7957b66",
19-
"version": "1.2.0"
20-
}
21-
},
22-
{
23-
"package": "CwlPreconditionTesting",
24-
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git",
25-
"state": {
26-
"branch": null,
27-
"revision": "c228db5d2ad1b01ebc84435e823e6cca4e3db98b",
28-
"version": "1.2.0"
29-
}
30-
},
314
{
325
"package": "MarkdownGenerator",
336
"repositoryURL": "https://github.com/eneko/MarkdownGenerator.git",
@@ -37,15 +10,6 @@
3710
"version": "0.5.0"
3811
}
3912
},
40-
{
41-
"package": "Nimble",
42-
"repositoryURL": "https://github.com/Quick/Nimble.git",
43-
"state": {
44-
"branch": null,
45-
"revision": "6abeb3f5c03beba2b9e4dbe20886e773b5b629b6",
46-
"version": "8.0.4"
47-
}
48-
},
4913
{
5014
"package": "ProcessRunner",
5115
"repositoryURL": "https://github.com/eneko/ProcessRunner.git",
@@ -55,15 +19,6 @@
5519
"version": "1.1.0"
5620
}
5721
},
58-
{
59-
"package": "Quick",
60-
"repositoryURL": "https://github.com/Quick/Quick.git",
61-
"state": {
62-
"branch": null,
63-
"revision": "33682c2f6230c60614861dfc61df267e11a1602f",
64-
"version": "2.2.0"
65-
}
66-
},
6722
{
6823
"package": "Rainbow",
6924
"repositoryURL": "https://github.com/onevcat/Rainbow",
@@ -78,35 +33,17 @@
7833
"repositoryURL": "https://github.com/jpsim/SourceKitten.git",
7934
"state": {
8035
"branch": null,
81-
"revision": "77a4dbbb477a8110eb8765e3c44c70fb4929098f",
82-
"version": "0.29.0"
36+
"revision": "558628392eb31d37cb251cfe626c53eafd330df6",
37+
"version": "0.31.1"
8338
}
8439
},
8540
{
8641
"package": "swift-argument-parser",
8742
"repositoryURL": "https://github.com/apple/swift-argument-parser",
8843
"state": {
8944
"branch": null,
90-
"revision": "9f04d1ff1afbccd02279338a2c91e5f27c45e93a",
91-
"version": "0.0.5"
92-
}
93-
},
94-
{
95-
"package": "llbuild",
96-
"repositoryURL": "https://github.com/apple/swift-llbuild.git",
97-
"state": {
98-
"branch": null,
99-
"revision": "f1c9ad9a253cdf1aa89a7f5c99c30b4513b06ddb",
100-
"version": "0.1.1"
101-
}
102-
},
103-
{
104-
"package": "SwiftPM",
105-
"repositoryURL": "https://github.com/apple/swift-package-manager",
106-
"state": {
107-
"branch": null,
108-
"revision": "8656a25cb906c1896339f950ac960ee1b4fe8034",
109-
"version": "0.4.0"
45+
"revision": "e1465042f195f374b94f915ba8ca49de24300a0d",
46+
"version": "1.0.2"
11047
}
11148
},
11249
{
@@ -123,8 +60,8 @@
12360
"repositoryURL": "https://github.com/jpsim/Yams.git",
12461
"state": {
12562
"branch": null,
126-
"revision": "c947a306d2e80ecb2c0859047b35c73b8e1ca27f",
127-
"version": "2.0.0"
63+
"revision": "9ff1cc9327586db4e0c8f46f064b6a82ec1566fa",
64+
"version": "4.0.6"
12865
}
12966
}
13067
]

Package.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
// swift-tools-version:5.1
1+
// swift-tools-version:5.3
22
import PackageDescription
3+
import Foundation
34

45
let package = Package(
56
name: "SourceDocs",
67
platforms: [
7-
.macOS(.v10_13)
8+
.macOS(.v10_15)
89
],
910
products: [
1011
.executable(name: "sourcedocs", targets: ["SourceDocsCLI"]),
1112
.library(name: "SourceDocsLib", targets: ["SourceDocsLib"])
1213
],
1314
dependencies: [
14-
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.0.1"),
15-
.package(url: "https://github.com/apple/swift-package-manager", .exact("0.4.0")),
15+
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
1616
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.29.0"),
1717
.package(url: "https://github.com/eneko/MarkdownGenerator.git", from: "0.4.0"),
1818
.package(url: "https://github.com/onevcat/Rainbow", from: "3.0.0"),
19-
.package(url: "https://github.com/eneko/ProcessRunner.git", .upToNextMajor(from: "1.1.0"))
19+
.package(url: "https://github.com/eneko/ProcessRunner.git", from: "1.1.0")
2020
],
2121
targets: [
2222
.target(name: "SourceDocsCLI", dependencies: [
@@ -26,7 +26,6 @@ let package = Package(
2626
]),
2727
.target(name: "SourceDocsLib", dependencies: [
2828
.product(name: "SourceKittenFramework", package: "SourceKitten"),
29-
"SwiftPM-auto",
3029
"MarkdownGenerator",
3130
"Rainbow",
3231
"ProcessRunner"

Sources/SourceDocsCLI/CleanCommand.swift

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ import Foundation
99
import ArgumentParser
1010
import SourceDocsLib
1111

12-
struct CleanCommand: ParsableCommand {
13-
static var configuration = CommandConfiguration(
14-
commandName: "clean",
15-
abstract: "Delete the output folder and quit."
16-
)
12+
extension SourceDocs {
13+
struct CleanCommand: ParsableCommand {
14+
static var configuration = CommandConfiguration(
15+
commandName: "clean",
16+
abstract: "Delete the output folder and quit."
17+
)
1718

18-
@Option(name: .shortAndLong, default: SourceDocs.defaultOutputPath, help: "Output directory to clean")
19-
var outputFolder: String
19+
@Option(name: .shortAndLong, help: "Output directory to clean")
20+
var outputFolder = SourceDocs.defaultOutputPath
2021

21-
func run() throws {
22-
try DocumentationEraser(docsPath: outputFolder).run()
22+
func run() throws {
23+
try DocumentationEraser(docsPath: outputFolder).run()
24+
}
2325
}
2426
}

0 commit comments

Comments
 (0)