Skip to content

Commit 260e198

Browse files
authored
Add support for the Swift package index (#297)
# Motivation We had some scripts around to generate docs for this package but all of our other packages are now providing documentation on the Swift package index. # Modification This removes the old script to generate documentation and adds an `.spi.yml` file. Furthermore, I removed the conditional dependency on the docc plugin which we are unconditionally depending on in most of our other packages like NIO.
1 parent f565569 commit 260e198

File tree

4 files changed

+12
-103
lines changed

4 files changed

+12
-103
lines changed

Diff for: .spi.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- documentation_targets: [AsyncAlgorithms]

Diff for: Package.swift

+4-16
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ let package = Package(
1313
products: [
1414
.library(name: "AsyncAlgorithms", targets: ["AsyncAlgorithms"]),
1515
],
16-
dependencies: [.package(url: "https://github.com/apple/swift-collections.git", .upToNextMajor(from: "1.0.4"))],
16+
dependencies: [
17+
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.4"),
18+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
19+
],
1720
targets: [
1821
.target(
1922
name: "AsyncAlgorithms",
@@ -46,18 +49,3 @@ let package = Package(
4649
),
4750
]
4851
)
49-
50-
#if canImport(Darwin)
51-
import Darwin
52-
let buildingDocs = getenv("BUILDING_FOR_DOCUMENTATION_GENERATION") != nil
53-
#elseif canImport(Glibc)
54-
import Glibc
55-
let buildingDocs = getenv("BUILDING_FOR_DOCUMENTATION_GENERATION") != nil
56-
#else
57-
let buildingDocs = false
58-
#endif
59-
60-
// Only require the docc plugin when building documentation
61-
package.dependencies += buildingDocs ? [
62-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
63-
] : []

Diff for: Package@swift-5.7.swift

+4-16
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ let package = Package(
1616
.library(name: "_CAsyncSequenceValidationSupport", type: .static, targets: ["AsyncSequenceValidation"]),
1717
.library(name: "AsyncAlgorithms_XCTest", targets: ["AsyncAlgorithms_XCTest"]),
1818
],
19-
dependencies: [.package(url: "https://github.com/apple/swift-collections.git", .upToNextMajor(from: "1.0.4"))],
19+
dependencies: [
20+
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.4"),
21+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
22+
],
2023
targets: [
2124
.target(
2225
name: "AsyncAlgorithms",
@@ -34,18 +37,3 @@ let package = Package(
3437
dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation", "AsyncAlgorithms_XCTest"]),
3538
]
3639
)
37-
38-
#if canImport(Darwin)
39-
import Darwin
40-
let buildingDocs = getenv("BUILDING_FOR_DOCUMENTATION_GENERATION") != nil
41-
#elseif canImport(Glibc)
42-
import Glibc
43-
let buildingDocs = getenv("BUILDING_FOR_DOCUMENTATION_GENERATION") != nil
44-
#else
45-
let buildingDocs = false
46-
#endif
47-
48-
// Only require the docc plugin when building documentation
49-
package.dependencies += buildingDocs ? [
50-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
51-
] : []

Diff for: bin/update-gh-pages-documentation-site

-71
This file was deleted.

0 commit comments

Comments
 (0)