Skip to content

Commit 67eb5cb

Browse files
authored
Add SWIFTCI_USE_LOCAL_DEPS build mode (#4986)
1 parent f4f5d7c commit 67eb5cb

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

Package.swift

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ let swiftBuildSettings: [SwiftSetting] = [
6666
.define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS"),
6767
]
6868

69+
var dependencies: [Package.Dependency] {
70+
if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] != nil {
71+
[
72+
.package(
73+
name: "swift-foundation-icu",
74+
path: "../swift-foundation-icu"),
75+
.package(
76+
name: "swift-foundation",
77+
path: "../swift-foundation")
78+
]
79+
} else {
80+
[
81+
.package(
82+
url: "https://github.com/apple/swift-foundation-icu",
83+
from: "0.0.8"),
84+
.package(
85+
url: "https://github.com/apple/swift-foundation",
86+
revision: "ef8a7787c355edae3c142e4dff8767d05a32c51f")
87+
]
88+
}
89+
}
90+
6991
let package = Package(
7092
name: "swift-corelibs-foundation",
7193
// Deployment target note: This package only builds for non-Darwin targets.
@@ -76,16 +98,7 @@ let package = Package(
7698
.library(name: "FoundationNetworking", targets: ["FoundationNetworking"]),
7799
.executable(name: "plutil", targets: ["plutil"]),
78100
],
79-
dependencies: [
80-
.package(
81-
url: "https://github.com/apple/swift-foundation-icu",
82-
from: "0.0.8"
83-
),
84-
.package(
85-
url: "https://github.com/apple/swift-foundation",
86-
revision: "ef8a7787c355edae3c142e4dff8767d05a32c51f"
87-
),
88-
],
101+
dependencies: dependencies,
89102
targets: [
90103
.target(
91104
name: "Foundation",

0 commit comments

Comments
 (0)