Skip to content

Commit da19f65

Browse files
authored
Add SourceDocsLib & prepare for 1.0.0 (SourceDocs#42)
#### Breaking - Add `SourceDocsLib` so it can be used by other Swift tools to generate documentation. #### Enhancements - Migrated from `Commandant` to [`Swift Argument Parser`](https://github.com/apple/swift-argument-parser) for command line parsing #### Bug Fixes - None ### Discussion This pull requests is based in the work done by @designatednerd on SourceDocs#40, to move most code to `SourceDocsLib`, a new library that can be imported y other Swift applications to generate documentation. With the migration from **Commandant** to **Swift Argument Parser**, this pull request also sets the base for version 1.0.0. Command line arguments have not changed from prior versions of the tool.
1 parent b2e6ec9 commit da19f65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+770
-379
lines changed

.swiftlint.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
included:
2-
- Sources
3-
- Tests
4-
51
excluded:
2+
- .build
63
- Tests/LinuxMain.swift
7-
- Tests/UnitTests/XCTestManifests.swift
8-
- Tests/BehavioralTests/XCTestManifests.swift
4+
- Tests/SourceDocsLibTests/XCTestManifests.swift
5+
- Tests/SourceDocsCLITests/XCTestManifests.swift
6+
97

108
opt_in_rules:
119
- attributes
@@ -17,7 +15,6 @@ opt_in_rules:
1715
- first_where
1816
- force_unwrapping
1917
- joined_default_parameter
20-
- let_var_whitespace
2118
- nimble_operator
2219
- no_extension_access_modifier
2320
- number_separator

.travis.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,42 @@ jobs:
1111
- stage: Continuous Integration
1212
name: SwiftPM macOS
1313
os: osx
14-
osx_image: xcode10.3
14+
osx_image: xcode11
1515
script:
1616
- swift test --parallel
1717
- stage: Continuous Integration
1818
name: SwiftPM Linux
19-
os: Linux
19+
os: linux
2020
dist: trusty
21-
sudo: required
2221
install:
2322
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
24-
- swiftenv install 5.0
25-
- swiftenv local 5.0
23+
- swiftenv install 5.1
24+
- swiftenv local 5.1
2625
- swift --version
2726
script:
27+
- swift build
2828
- swift test --parallel
2929
- stage: Continuous Integration
30-
name: Code Coverage (Xcode 10.3)
30+
name: Code Coverage
3131
os: osx
32-
osx_image: xcode10.3
32+
osx_image: xcode11
3333
script:
3434
- swift package generate-xcodeproj --enable-code-coverage
35-
- xcodebuild -scheme SourceDocs-Package test
35+
- xcodebuild -scheme SourceDocs-Package -quiet test
3636
after_success:
37-
- bash <(curl -s https://codecov.io/bash) -J 'SourceDocs'
37+
- bash <(curl -s https://codecov.io/bash) -J 'SourceDocsLib'
3838
- stage: Continuous Integration
3939
name: Installation with Homebrew (macOS)
4040
os: osx
41-
osx_image: xcode10.3
41+
osx_image: xcode11
4242
script:
4343
- brew update
4444
- brew install sourcedocs
4545
- sourcedocs version
4646
- stage: Continuous Integration
4747
name: Installation from Source (macOS)
4848
os: osx
49-
osx_image: xcode10.3
49+
osx_image: xcode11
5050
script:
5151
- git clone --depth 1 https://github.com/eneko/SourceDocs.git
5252
- cd SourceDocs

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
- None
1111

1212

13+
## 1.0.0
14+
15+
#### Breaking
16+
- Add `SourceDocsLib` so it can be used by other Swift tools to generate documentation.
17+
18+
#### Enhancements
19+
- Migrated from `Commandant` to [`Swift Argument Parser`](https://github.com/apple/swift-argument-parser) for command line parsing.
20+
21+
#### Bug Fixes
22+
- None
23+
24+
1325
## 0.6.1
1426

1527
#### Breaking

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TOOL_NAME = sourcedocs
2-
VERSION = 0.6.1
2+
VERSION = 1.0.0
33

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

2525
docs:
26-
swift run sourcedocs generate --clean --spm-module SourceDocsDemo --output-folder docs/reference --module-name-path
26+
swift run sourcedocs generate --clean --spm-module SourceDocsDemo --output-folder docs/reference --module-name-path --min-acl private
27+
swift run sourcedocs generate --clean --spm-module SourceDocsLib --output-folder docs/reference --module-name-path
2728

2829
xcode:
2930
swift package generate-xcodeproj --enable-code-coverage

Package.resolved

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@
1010
"version": "0.17.0"
1111
}
1212
},
13-
{
14-
"package": "Curry",
15-
"repositoryURL": "https://github.com/thoughtbot/Curry.git",
16-
"state": {
17-
"branch": null,
18-
"revision": "4331dd50bc1db007db664a23f32e6f3df93d4e1a",
19-
"version": "4.0.2"
20-
}
21-
},
2213
{
2314
"package": "CwlCatchException",
2415
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git",
@@ -78,8 +69,17 @@
7869
"repositoryURL": "https://github.com/jpsim/SourceKitten.git",
7970
"state": {
8071
"branch": null,
81-
"revision": "356551fc513eb12ed779bb369f79cf86a3a01599",
82-
"version": "0.27.0"
72+
"revision": "77a4dbbb477a8110eb8765e3c44c70fb4929098f",
73+
"version": "0.29.0"
74+
}
75+
},
76+
{
77+
"package": "swift-argument-parser",
78+
"repositoryURL": "https://github.com/apple/swift-argument-parser",
79+
"state": {
80+
"branch": null,
81+
"revision": "9f04d1ff1afbccd02279338a2c91e5f27c45e93a",
82+
"version": "0.0.5"
8383
}
8484
},
8585
{

Package.swift

+8-13
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,21 @@ import PackageDescription
44
let package = Package(
55
name: "SourceDocs",
66
products: [
7-
.executable(name: "sourcedocs", targets: ["SourceDocs"]),
7+
.executable(name: "sourcedocs", targets: ["SourceDocsCLI"]),
8+
.library(name: "SourceDocsLib", targets: ["SourceDocsLib"])
89
],
910
dependencies: [
10-
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.26.0"),
11-
.package(url: "https://github.com/Carthage/Commandant.git", from: "0.15.0"),
11+
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.0.1"),
12+
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.29.0"),
1213
.package(url: "https://github.com/eneko/MarkdownGenerator.git", from: "0.4.0"),
1314
.package(url: "https://github.com/onevcat/Rainbow", from: "3.0.0"),
14-
.package(url: "https://github.com/thoughtbot/Curry.git", from: "4.0.1"),
1515
.package(url: "https://github.com/eneko/System.git", from: "0.2.0")
1616
],
1717
targets: [
18-
.target(name: "SourceDocs", dependencies: [
19-
"SourceKittenFramework",
20-
"MarkdownGenerator",
21-
"Rainbow",
22-
"Commandant",
23-
"Curry"
24-
]),
25-
.testTarget(name: "BehavioralTests", dependencies: ["System"]),
26-
.testTarget(name: "UnitTests", dependencies: ["SourceDocs"]),
18+
.target(name: "SourceDocsCLI", dependencies: ["SourceDocsLib", "ArgumentParser", "Rainbow"]),
19+
.target(name: "SourceDocsLib", dependencies: ["SourceKittenFramework", "MarkdownGenerator", "Rainbow"]),
2720
.target(name: "SourceDocsDemo", dependencies: []),
21+
.testTarget(name: "SourceDocsCLITests", dependencies: ["System"]),
22+
.testTarget(name: "SourceDocsLibTests", dependencies: ["SourceDocsLib"])
2823
]
2924
)

Sources/SourceDocs/Classes/SourceDocs.swift

-29
This file was deleted.

Sources/SourceDocs/Commands/Clean.swift

-54
This file was deleted.

0 commit comments

Comments
 (0)