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

Lines changed: 963 additions & 296 deletions

.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/setup-swift@v1.9.0
21+
# with:
22+
# swift-version: 5.5
23+
- name: Checkout
24+
uses: actions/checkout@v2.4.0
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/setup-swift@v1.9.0
41+
# with:
42+
# swift-version: 5.5
43+
- name: Checkout
44+
uses: actions/checkout@v2.4.0
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/checkout@v2.4.0
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/checkout@v2.4.0
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
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)