Skip to content

Commit 5adc114

Browse files
sichanyooSichan Yoo
andauthored
Add DocC dependency utility function to Package.swift. (#798)
Co-authored-by: Sichan Yoo <[email protected]>
1 parent ecd0282 commit 5adc114

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Package.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// swift-tools-version:5.9
22

3+
import Foundation
34
import PackageDescription
45

56
// Define libxml2 only on Linux, since it causes warnings
@@ -274,3 +275,12 @@ let package = Package(
274275
),
275276
].compactMap { $0 }
276277
)
278+
279+
func addDoccDependency() {
280+
guard ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_ENABLE_DOCC"] != nil else { return }
281+
package.dependencies += [
282+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
283+
]
284+
}
285+
286+
addDoccDependency()

0 commit comments

Comments
 (0)