@@ -20,6 +20,11 @@ import PackageDescription
2020
2121let firebaseVersion = " 12.3.0 "
2222
23+ // For private preview, Firestore must be built from source.
24+ let shouldUseSourceFirestore = true
25+ // Remove the above and uncomment the line below before merging Firestore to main.
26+ // let shouldUseSourceFirestore = Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil
27+
2328let package = Package (
2429 name: " Firebase " ,
2530 platforms: [ . iOS( . v15) , . macCatalyst( . v15) , . macOS( . v10_15) , . tvOS( . v15) , . watchOS( . v7) ] ,
@@ -1400,7 +1405,7 @@ func abseilDependency() -> Package.Dependency {
14001405
14011406 // If building Firestore from source, abseil will need to be built as source
14021407 // as the headers in the binary version of abseil are unusable.
1403- if Context . environment [ " FIREBASE_SOURCE_FIRESTORE " ] != nil {
1408+ if shouldUseSourceFirestore {
14041409 packageInfo = (
14051410 " https://github.com/firebase/abseil-cpp-SwiftPM.git " ,
14061411 " 0.20240722.0 " ..< " 0.20240723.0 "
@@ -1420,7 +1425,7 @@ func grpcDependency() -> Package.Dependency {
14201425
14211426 // If building Firestore from source, abseil will need to be built as source
14221427 // as the headers in the binary version of abseil are unusable.
1423- if Context . environment [ " FIREBASE_SOURCE_FIRESTORE " ] != nil {
1428+ if shouldUseSourceFirestore {
14241429 packageInfo = ( " https://github.com/grpc/grpc-ios.git " , " 1.69.0 " ..< " 1.70.0 " )
14251430 } else {
14261431 packageInfo = ( " https://github.com/google/grpc-binary.git " , " 1.69.0 " ..< " 1.70.0 " )
@@ -1430,7 +1435,7 @@ func grpcDependency() -> Package.Dependency {
14301435}
14311436
14321437func firestoreWrapperTarget( ) -> Target {
1433- if Context . environment [ " FIREBASE_SOURCE_FIRESTORE " ] != nil {
1438+ if shouldUseSourceFirestore {
14341439 return . target(
14351440 name: " FirebaseFirestoreTarget " ,
14361441 dependencies: [ . target( name: " FirebaseFirestore " ,
@@ -1449,7 +1454,7 @@ func firestoreWrapperTarget() -> Target {
14491454}
14501455
14511456func firestoreTargets( ) -> [ Target ] {
1452- if Context . environment [ " FIREBASE_SOURCE_FIRESTORE " ] != nil {
1457+ if shouldUseSourceFirestore {
14531458 return [
14541459 . target(
14551460 name: " FirebaseFirestoreInternalWrapper " ,
0 commit comments