Skip to content

Commit 4c8f0f2

Browse files
authored
Add SWIFTCI_USE_LOCAL_DEPS build mode (#694)
1 parent b22ff2b commit 4c8f0f2

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

Package.swift

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,34 @@ let concurrencyChecking: [SwiftSetting] = [
4141
.enableUpcomingFeature("InferSendableFromCaptures")
4242
]
4343

44+
var dependencies: [Package.Dependency] {
45+
if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] != nil {
46+
[
47+
.package(
48+
name: "swift-collections",
49+
path: "../swift-collections"),
50+
.package(
51+
name: "swift-foundation-icu",
52+
path: "../swift-foundation-icu"),
53+
.package(
54+
name: "swift-syntax",
55+
path: "../swift-syntax")
56+
]
57+
} else {
58+
[
59+
.package(
60+
url: "https://github.com/apple/swift-collections",
61+
from: "1.1.0"),
62+
.package(
63+
url: "https://github.com/apple/swift-foundation-icu",
64+
exact: "0.0.8"),
65+
.package(
66+
url: "https://github.com/apple/swift-syntax",
67+
from: "600.0.0-latest")
68+
]
69+
}
70+
}
71+
4472
let package = Package(
4573
name: "FoundationPreview",
4674
platforms: [.macOS("13.3"), .iOS("16.4"), .tvOS("16.4"), .watchOS("9.4")],
@@ -50,17 +78,7 @@ let package = Package(
5078
.library(name: "FoundationEssentials", targets: ["FoundationEssentials"]),
5179
.library(name: "FoundationInternationalization", targets: ["FoundationInternationalization"]),
5280
],
53-
dependencies: [
54-
.package(
55-
url: "https://github.com/apple/swift-collections",
56-
from: "1.1.0"),
57-
.package(
58-
url: "https://github.com/apple/swift-foundation-icu",
59-
exact: "0.0.8"),
60-
.package(
61-
url: "https://github.com/apple/swift-syntax.git",
62-
from: "600.0.0-latest")
63-
],
81+
dependencies: dependencies,
6482
targets: [
6583
// Foundation (umbrella)
6684
.target(

0 commit comments

Comments
 (0)