Skip to content

Commit 2e08007

Browse files
fboemerkarulont
andauthored
Disable DocC plugin by default (#240)
Co-authored-by: Karl Tarbe <tarbe@apple.com>
1 parent 81bfc95 commit 2e08007

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

Package.resolved

Lines changed: 1 addition & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ let package = Package(
6464
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
6565
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"),
6666
.package(url: "https://github.com/apple/swift-protobuf", from: "1.31.1"), // Keep version in sync with README
67-
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
6867
],
6968
targets: [
7069
// Targets are the basic building blocks of a package, defining a module or a test suite.
@@ -300,6 +299,22 @@ if enableBenchmarking {
300299
]
301300
}
302301

302+
// MARK: - DoCC plugin
303+
304+
var enableDocCPlugin: Bool {
305+
let benchmarkFlags = "SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_DOCCPLUGIN"
306+
if let flag = ProcessInfo.processInfo.environment[benchmarkFlags], flag == "1" {
307+
return true
308+
}
309+
return false
310+
}
311+
312+
if enableDocCPlugin {
313+
package.dependencies += [
314+
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
315+
]
316+
}
317+
303318
// Set the minimum macOS version for the package
304319
#if canImport(Darwin)
305320
package.platforms = [

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ The documentation can be built from Xcode via `Product -> Build Documentation`.
246246
## Command line
247247
The documentation can be built from command line by running
248248
```sh
249-
swift package generate-documentation
249+
SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_DOCCPLUGIN=1 swift package generate-documentation
250250
```
251251
and previewed by running
252252
```sh
253-
swift package --disable-sandbox preview-documentation --target HomomorphicEncryption
253+
SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_DOCCPLUGIN=1 swift package --disable-sandbox preview-documentation --target HomomorphicEncryption
254254
```

0 commit comments

Comments
 (0)