Skip to content

Commit e01c300

Browse files
committed
Use SWIFTCI_USE_LOCAL_DEPS to check whether to clone swift-docc-plugin
Only SwiftSyntax’s build-script sets `SWIFT_BUILD_SCRIPT_ENVIRONMENT`. Once we migrate other projects into the unified SwiftPM build, the environment variable is not set and SwiftPM tries to download swift-docc-plugin in CI. Use `SWIFTCI_USE_LOCAL_DEPS` as an indicator whether the remote plugin should be loaded.
1 parent 2ff1171 commit e01c300

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ let package = Package(
143143
]
144144
)
145145

146-
if ProcessInfo.processInfo.environment["SWIFT_BUILD_SCRIPT_ENVIRONMENT"] == nil {
146+
// If `SWIFTCI_USE_LOCAL_DEPS` is set, we are in a CI enviornment that might disallow
147+
// internet access, so we can't load swift-docc-plugin. Simply don't load it in these
148+
// environments because we don't build docc in CI at the moment.
149+
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
147150
package.dependencies.append(.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"))
148151
}

0 commit comments

Comments
 (0)