-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Infra] Bump swift-tools-version in Package.swift #15026
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
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
438c98e
[Infra] Bump swift-tools-version in Package.swift
ncooke3 8766783
Use Context.environment
ncooke3 27e5e2d
improvement
ncooke3 d099378
more improvements
ncooke3 3611240
more more improvement
ncooke3 3e12933
Merge branch 'main' into nc/14638
ncooke3 b4f2958
changelog entry
ncooke3 39424b9
Merge branch 'main' into nc/14638
ncooke3 a27c4b5
fixes?
ncooke3 fadd15c
Merge branch 'main' into nc/14638
ncooke3 8c5f757
more fixes
ncooke3 41f8329
fixes
ncooke3 31eb9b9
Style
ncooke3 651719d
fixes
ncooke3 2b3665e
Make protocol conform to Sendable
ncooke3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// swift-tools-version:5.9 | ||
// swift-tools-version:6.0 | ||
// The swift-tools-version declares the minimum version of Swift required to | ||
// build this package. | ||
|
||
|
@@ -16,7 +16,6 @@ | |
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import class Foundation.ProcessInfo | ||
import PackageDescription | ||
|
||
let firebaseVersion = "12.0.0" | ||
|
@@ -501,6 +500,9 @@ let package = Package( | |
path: "FirebaseAppDistribution/Tests/Unit/Swift", | ||
cSettings: [ | ||
.headerSearchPath("../../../.."), | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
|
||
|
@@ -521,7 +523,9 @@ let package = Package( | |
"ObjC", "Public", | ||
], | ||
resources: [.process("Resources/PrivacyInfo.xcprivacy")], | ||
swiftSettings: Context.environment["FIREBASE_CI"] != nil ? [.define("FIREBASE_CI")] : [], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
], | ||
linkerSettings: [ | ||
.linkedFramework("Security"), | ||
.linkedFramework("SafariServices", .when(platforms: [.iOS])), | ||
|
@@ -567,12 +571,18 @@ let package = Package( | |
"ObjCAPITests.m", | ||
"ObjCGlobalTests.m", | ||
"FIROAuthProviderTests.m", | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.target( | ||
name: "FirebaseAuthCombineSwift", | ||
dependencies: ["FirebaseAuth"], | ||
path: "FirebaseCombineSwift/Sources/Auth" | ||
path: "FirebaseCombineSwift/Sources/Auth", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.target( | ||
name: "FirebaseFirestoreCombineSwift", | ||
|
@@ -654,7 +664,10 @@ let package = Package( | |
.testTarget( | ||
name: "FirebaseCrashlyticsSwiftUnit", | ||
dependencies: ["FirebaseCrashlyticsSwift"], | ||
path: "Crashlytics/UnitTestsSwift/" | ||
path: "Crashlytics/UnitTestsSwift/", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
name: "FirebaseCrashlyticsUnit", | ||
|
@@ -719,6 +732,9 @@ let package = Package( | |
resources: [.process("Resources")], | ||
cSettings: [ | ||
.headerSearchPath("../.."), | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
|
@@ -727,6 +743,9 @@ let package = Package( | |
path: "FirebaseDatabase/Tests/Unit/Swift", | ||
cSettings: [ | ||
.headerSearchPath("../.."), | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.target( | ||
|
@@ -740,6 +759,10 @@ let package = Package( | |
exclude: [ | ||
"third_party/FirebaseDataEncoder/LICENSE", | ||
"third_party/FirebaseDataEncoder/METADATA", | ||
], | ||
// TODO(ncooke3): Can this be upgraded to Swift 6? | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
|
@@ -775,6 +798,9 @@ let package = Package( | |
path: "FirebaseFunctions/Tests/Unit", | ||
cSettings: [ | ||
.headerSearchPath("../../../"), | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
|
@@ -799,7 +825,10 @@ let package = Package( | |
.target( | ||
name: "FirebaseFunctionsCombineSwift", | ||
dependencies: ["FirebaseFunctions"], | ||
path: "FirebaseCombineSwift/Sources/Functions" | ||
path: "FirebaseCombineSwift/Sources/Functions", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
name: "FunctionsCombineUnit", | ||
|
@@ -852,7 +881,10 @@ let package = Package( | |
.target( | ||
name: "FirebaseInAppMessaging", | ||
dependencies: ["FirebaseInAppMessagingInternal"], | ||
path: "FirebaseInAppMessaging/Swift/Source" | ||
path: "FirebaseInAppMessaging/Swift/Source", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
|
||
.target( | ||
|
@@ -890,6 +922,9 @@ let package = Package( | |
], | ||
cSettings: [ | ||
.define("FIRMLModelDownloader_VERSION", to: firebaseVersion), | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
|
@@ -1074,7 +1109,10 @@ let package = Package( | |
"FirebaseSharedSwift", | ||
], | ||
path: "FirebaseRemoteConfig/Swift", | ||
resources: [.process("Resources/PrivacyInfo.xcprivacy")] | ||
resources: [.process("Resources/PrivacyInfo.xcprivacy")], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
name: "RemoteConfigFakeConsole", | ||
|
@@ -1091,6 +1129,9 @@ let package = Package( | |
], | ||
cSettings: [ | ||
.headerSearchPath("../../../"), | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.target( | ||
|
@@ -1198,7 +1239,10 @@ let package = Package( | |
.product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"), | ||
.product(name: "GULEnvironment", package: "GoogleUtilities"), | ||
], | ||
path: "FirebaseStorage/Sources" | ||
path: "FirebaseStorage/Sources", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
name: "FirebaseStorageUnit", | ||
|
@@ -1207,6 +1251,9 @@ let package = Package( | |
path: "FirebaseStorage/Tests/Unit", | ||
cSettings: [ | ||
.headerSearchPath("../../../"), | ||
], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
|
@@ -1253,15 +1300,21 @@ let package = Package( | |
"FirebaseStorage", | ||
.product(name: "nanopb", package: "nanopb"), | ||
], | ||
path: "SwiftPMTests/swift-test" | ||
path: "SwiftPMTests/swift-test", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
name: "analytics-import-test", | ||
dependencies: [ | ||
"FirebaseAnalyticsWrapper", | ||
"Firebase", | ||
], | ||
path: "SwiftPMTests/analytics-import-test" | ||
path: "SwiftPMTests/analytics-import-test", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
.testTarget( | ||
name: "objc-import-test", | ||
|
@@ -1352,7 +1405,10 @@ let package = Package( | |
.testTarget( | ||
name: "FirebaseAppCheckUnitSwift", | ||
dependencies: ["FirebaseAppCheck"], | ||
path: "FirebaseAppCheck/Tests/Unit/Swift" | ||
path: "FirebaseAppCheck/Tests/Unit/Swift", | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
|
||
// MARK: Testing support | ||
|
@@ -1386,7 +1442,7 @@ func googleAppMeasurementDependency() -> Package.Dependency { | |
|
||
// Point SPM CI to the tip of main of https://github.com/google/GoogleAppMeasurement so that the | ||
// release process can defer publishing the GoogleAppMeasurement tag until after testing. | ||
if ProcessInfo.processInfo.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil { | ||
if Context.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil { | ||
return .package(url: appMeasurementURL, branch: "main") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unrelated to the Swift tools version bump. This API was added to the |
||
} | ||
|
||
|
@@ -1398,7 +1454,7 @@ func abseilDependency() -> Package.Dependency { | |
|
||
// If building Firestore from source, abseil will need to be built as source | ||
// as the headers in the binary version of abseil are unusable. | ||
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
packageInfo = ( | ||
"https://github.com/firebase/abseil-cpp-SwiftPM.git", | ||
"0.20240722.0" ..< "0.20240723.0" | ||
|
@@ -1418,7 +1474,7 @@ func grpcDependency() -> Package.Dependency { | |
|
||
// If building Firestore from source, abseil will need to be built as source | ||
// as the headers in the binary version of abseil are unusable. | ||
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
packageInfo = ("https://github.com/grpc/grpc-ios.git", "1.69.0" ..< "1.70.0") | ||
} else { | ||
packageInfo = ("https://github.com/google/grpc-binary.git", "1.69.0" ..< "1.70.0") | ||
|
@@ -1428,7 +1484,7 @@ func grpcDependency() -> Package.Dependency { | |
} | ||
|
||
func firestoreWrapperTarget() -> Target { | ||
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
return .target( | ||
name: "FirebaseFirestoreTarget", | ||
dependencies: [.target(name: "FirebaseFirestore", | ||
|
@@ -1447,7 +1503,7 @@ func firestoreWrapperTarget() -> Target { | |
} | ||
|
||
func firestoreTargets() -> [Target] { | ||
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
return [ | ||
.target( | ||
name: "FirebaseFirestoreInternalWrapper", | ||
|
@@ -1543,13 +1599,16 @@ func firestoreTargets() -> [Target] { | |
sources: [ | ||
"Swift/Source/", | ||
], | ||
resources: [.process("Source/Resources/PrivacyInfo.xcprivacy")] | ||
resources: [.process("Source/Resources/PrivacyInfo.xcprivacy")], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
] | ||
), | ||
] | ||
} | ||
|
||
let firestoreInternalTarget: Target = { | ||
if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil { | ||
if Context.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil { | ||
// This is set when running `scripts/check_firestore_symbols.sh`. | ||
return .binaryTarget( | ||
name: "FirebaseFirestoreInternal", | ||
|
@@ -1592,6 +1651,9 @@ func firestoreTargets() -> [Target] { | |
], | ||
path: "Firestore/Swift/Source", | ||
resources: [.process("Resources/PrivacyInfo.xcprivacy")], | ||
swiftSettings: [ | ||
.swiftLanguageMode(SwiftLanguageMode.v5), | ||
], | ||
linkerSettings: [ | ||
.linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])), | ||
.linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])), | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI uses Xcode 16.2 and for whatever reason, 16.2 seemed to catch that this type needs to be Sendable while 16.3+ didn't complain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original error the conformance fixes:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on addressing in #15064