forked from swiftlang/swift-docc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
148 lines (135 loc) · 5.1 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// swift-tools-version:5.5
/*
This source file is part of the Swift.org open source project
Copyright (c) 2021 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
import PackageDescription
import class Foundation.ProcessInfo
let package = Package(
name: "SwiftDocC",
platforms: [
.macOS(.v10_15),
.iOS(.v13)
],
products: [
.library(
name: "SwiftDocC",
targets: ["SwiftDocC"]
),
.library(
name: "SwiftDocCUtilities",
targets: ["SwiftDocCUtilities"]
),
.executable(
name: "docc",
targets: ["docc"]
)
],
targets: [
// SwiftDocC library
.target(
name: "SwiftDocC",
dependencies: [
.product(name: "Markdown", package: "swift-markdown"),
"SymbolKit",
"CLMDB",
.product(name: "Crypto", package: "swift-crypto"),
]),
.testTarget(
name: "SwiftDocCTests",
dependencies: [
"SwiftDocC",
"SwiftDocCTestUtilities",
],
resources: [
.copy("Test Resources"),
.copy("Test Bundles"),
.copy("Converter/Converter Fixtures"),
.copy("Rendering/Rendering Fixtures"),
]),
// Command-line tool library
.target(
name: "SwiftDocCUtilities",
dependencies: [
"SwiftDocC",
.product(name: "NIOSSL", package: "swift-nio-ssl"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "ArgumentParser", package: "swift-argument-parser")
]),
.testTarget(
name: "SwiftDocCUtilitiesTests",
dependencies: [
"SwiftDocCUtilities",
"SwiftDocC",
"SwiftDocCTestUtilities",
],
resources: [
.copy("Test Resources"),
.copy("Test Bundles"),
]),
// Test utility library
.target(
name: "SwiftDocCTestUtilities",
dependencies: []),
// Command-line tool
.executableTarget(
name: "docc",
dependencies: [
"SwiftDocCUtilities",
]),
// Empty target that builds the documentation catalog at /DocCDocumentation/DocCDocumentation.docc.
// The DocCDocumentation catalog includes high-level, user-facing documentation about using
// DocC as a documentation tool.
.target(
name: "DocC",
path: "Sources/DocCDocumentation"),
// Test app for SwiftDocCUtilities
.executableTarget(
name: "signal-test-app",
dependencies: [
"SwiftDocCUtilities",
],
path: "Tests/signal-test-app"),
.executableTarget(
name: "generate-symbol-graph",
dependencies: [
"SymbolKit",
]
),
]
)
// If the `SWIFTCI_USE_LOCAL_DEPS` environment variable is set,
// we're building in the Swift.org CI system alongside other projects in the Swift toolchain and
// we can depend on local versions of our dependencies instead of fetching them remotely.
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
// Building standalone, so fetch all dependencies remotely.
package.dependencies += [
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMinor(from: "2.31.2")),
.package(url: "https://github.com/apple/swift-nio-ssl.git", .upToNextMinor(from: "2.15.0")),
.package(name: "swift-markdown", url: "https://github.com/apple/swift-markdown.git", .branch("main")),
.package(name: "CLMDB", url: "https://github.com/apple/swift-lmdb.git", .branch("main")),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.0.1")),
.package(name: "SymbolKit", url: "https://github.com/apple/swift-docc-symbolkit", .branch("main")),
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMinor(from: "1.1.2")),
]
// SwiftPM command plugins are only supported by Swift version 5.6 and later.
#if swift(>=5.6)
package.dependencies += [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
]
#endif
} else {
// Building in the Swift.org CI system, so rely on local versions of dependencies.
package.dependencies += [
.package(path: "../swift-nio"),
.package(path: "../swift-nio-ssl"),
.package(path: "../swift-markdown"),
.package(name: "CLMDB", path: "../swift-lmdb"),
.package(path: "../swift-argument-parser"),
.package(name: "SymbolKit", path: "../swift-docc-symbolkit"),
.package(path: "../swift-crypto"),
]
}