From 6ae9a051f76b81cc668305ceed5b0e0a7fd93d20 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Thu, 11 Apr 2024 06:41:45 +0900 Subject: [PATCH] Add support for `SWIFTCI_USE_LOCAL_DEPS` convention (#311) To use this package in utils/build-script pipeline --- Package.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index 04121ef..4132319 100644 --- a/Package.swift +++ b/Package.swift @@ -13,10 +13,6 @@ let package = Package( products: [ .library(name: "AsyncAlgorithms", targets: ["AsyncAlgorithms"]), ], - dependencies: [ - .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), - ], targets: [ .target( name: "AsyncAlgorithms", @@ -52,3 +48,14 @@ let package = Package( ), ] ) + +if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { + package.dependencies += [ + .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"), + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), + ] +} else { + package.dependencies += [ + .package(path: "../swift-collections"), + ] +}