Skip to content

Commit

Permalink
Add DocC dependency utility function to Package.swift. (#798)
Browse files Browse the repository at this point in the history
Co-authored-by: Sichan Yoo <[email protected]>
  • Loading branch information
sichanyoo and Sichan Yoo authored Aug 12, 2024
1 parent ecd0282 commit 5adc114
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// swift-tools-version:5.9

import Foundation
import PackageDescription

// Define libxml2 only on Linux, since it causes warnings
Expand Down Expand Up @@ -274,3 +275,12 @@ let package = Package(
),
].compactMap { $0 }
)

func addDoccDependency() {
guard ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_ENABLE_DOCC"] != nil else { return }
package.dependencies += [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
]
}

addDoccDependency()

0 comments on commit 5adc114

Please sign in to comment.