Skip to content

Allow for more flexibility in what path SWIFTCI_USE_LOCAL_DEPS means #5048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,33 @@ let interfaceBuildSettings: [CSetting] = [
let swiftBuildSettings: [SwiftSetting] = [
.define("DEPLOYMENT_RUNTIME_SWIFT"),
.define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS"),
.swiftLanguageVersion(.v6),
.swiftLanguageMode(.v6),
.unsafeFlags([
"-Xfrontend",
"-require-explicit-sendable",
])
]

var dependencies: [Package.Dependency] {
if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] != nil {
var dependencies: [Package.Dependency] = []

if let useLocalDepsEnv = Context.environment["SWIFTCI_USE_LOCAL_DEPS"] {
let root: String
if useLocalDepsEnv == "1" {
root = ".."
} else {
root = useLocalDepsEnv
}
dependencies +=
[
.package(
name: "swift-foundation-icu",
path: "../swift-foundation-icu"),
path: "\(root)/swift-foundation-icu"),
.package(
name: "swift-foundation",
path: "../swift-foundation")
path: "\(root)/swift-foundation")
]
} else {
} else {
dependencies +=
[
.package(
url: "https://github.com/apple/swift-foundation-icu",
Expand All @@ -110,7 +119,6 @@ var dependencies: [Package.Dependency] {
url: "https://github.com/apple/swift-foundation",
revision: "acae3d26b69113cec2db7772b4144ab9558241db")
]
}
}

let package = Package(
Expand Down Expand Up @@ -227,7 +235,7 @@ let package = Package(
"CMakeLists.txt"
],
swiftSettings: [
.swiftLanguageVersion(.v6)
.swiftLanguageMode(.v6)
]
),
.executableTarget(
Expand All @@ -238,7 +246,7 @@ let package = Package(
"FoundationNetworking"
],
swiftSettings: [
.swiftLanguageVersion(.v6)
.swiftLanguageMode(.v6)
]
),
.target(
Expand Down Expand Up @@ -266,7 +274,7 @@ let package = Package(
],
swiftSettings: [
.define("NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT"),
.swiftLanguageVersion(.v6)
.swiftLanguageMode(.v6)
]
),
]
Expand Down