Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ let package = Package(
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-protobuf", from: "1.31.1"), // Keep version in sync with README
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down Expand Up @@ -300,6 +299,22 @@ if enableBenchmarking {
]
}

// MARK: - DoCC plugin

var enableDocCPlugin: Bool {
let benchmarkFlags = "SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_DOCCPLUGIN"
if let flag = ProcessInfo.processInfo.environment[benchmarkFlags], flag == "1" {
return true
}
return false
}

if enableDocCPlugin {
package.dependencies += [
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
]
}

// Set the minimum macOS version for the package
#if canImport(Darwin)
package.platforms = [
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ The documentation can be built from Xcode via `Product -> Build Documentation`.
## Command line
The documentation can be built from command line by running
```sh
swift package generate-documentation
SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_DOCCPLUGIN=1 swift package generate-documentation
```
and previewed by running
```sh
swift package --disable-sandbox preview-documentation --target HomomorphicEncryption
SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_DOCCPLUGIN=1 swift package --disable-sandbox preview-documentation --target HomomorphicEncryption
```