diff --git a/.github/workflows/firestore.yml b/.github/workflows/firestore.yml index 14ca76163ba..346d3b99f8e 100644 --- a/.github/workflows/firestore.yml +++ b/.github/workflows/firestore.yml @@ -48,7 +48,9 @@ jobs: - 'FirebaseCore/Sources/Public' # Podspec + - 'FirebaseFirestoreInternal.podspec' - 'FirebaseFirestore.podspec' + - 'FirebaseFirestoreSwift.podspec' # CMake - '**CMakeLists.txt' @@ -261,6 +263,7 @@ jobs: strategy: matrix: podspec: [ + 'FirebaseFirestoreInternal.podspec', 'FirebaseFirestore.podspec', 'FirebaseFirestoreSwift.podspec', ] @@ -288,6 +291,7 @@ jobs: strategy: matrix: podspec: [ + 'FirebaseFirestoreInternal.podspec', 'FirebaseFirestore.podspec', 'FirebaseFirestoreSwift.podspec', ] diff --git a/.github/workflows/zip.yml b/.github/workflows/zip.yml index abc585c387c..902f3248966 100644 --- a/.github/workflows/zip.yml +++ b/.github/workflows/zip.yml @@ -465,7 +465,7 @@ jobs: run: | scripts/check_firestore_symbols.sh \ $(pwd) \ - "${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/FirebaseFirestore.xcframework + "${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/FirebaseFirestoreInternal.xcframework quickstart_framework_inappmessaging: # Don't run on private repo. diff --git a/FirebaseFirestore.podspec b/FirebaseFirestore.podspec index d846ca519bb..a1c79acacf0 100644 --- a/FirebaseFirestore.podspec +++ b/FirebaseFirestore.podspec @@ -2,15 +2,12 @@ Pod::Spec.new do |s| s.name = 'FirebaseFirestore' s.version = '10.17.0' s.summary = 'Google Cloud Firestore' - s.description = <<-DESC Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. DESC - s.homepage = 'https://developers.google.com/' s.license = { :type => 'Apache-2.0', :file => 'Firestore/LICENSE' } s.authors = 'Google, Inc.' - s.source = { :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => 'CocoaPods-' + s.version.to_s @@ -25,105 +22,17 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling, s.cocoapods_version = '>= 1.4.0' s.prefix_header_file = false - # Header files that constitute the interface to this module. Only Objective-C - # headers belong here, since FirebaseFirestore is primarily an Objective-C - # framework. - s.public_header_files = 'Firestore/Source/Public/FirebaseFirestore/*.h' + s.public_header_files = 'FirebaseFirestoreInternal/**/*.h' - # source_files contains most of the header and source files for the project. - # This includes files named in `public_header_files`. - # - # Each header in this list must be globally unique, even within customer - # projects. This generally means that only Objective-C Headers with a `FIR` - # or `FST` prefix can be in `source_files`. Non-public C++ headers that have - # no filename prefix must be in `preserve_paths`. See - # https://github.com/firebase/firebase-ios-sdk/issues/4035 for more details. - # - # Note: headers from FirebaseCore can be in this list because while they're - # not globally unique, each copy will be the same. It doesn't matter which - # version wins in the global header map. The benefit of keeping them here is - # that "quick open" by filename in Xcode will continue to work. + s.requires_arc = true s.source_files = [ - 'FirebaseCore/Extension/*.h', - 'Firestore/Source/Public/FirebaseFirestore/*.h', - 'Firestore/Source/**/*.{m,mm}', - 'Firestore/Protos/nanopb/**/*.cc', - 'Firestore/core/include/**/*.{cc,mm}', - 'Firestore/core/src/**/*.{cc,mm}', - 'FirebaseAuth/Interop/*.h', + 'FirebaseFirestoreInternal/**/*.[mh]', + 'Firestore/Swift/Source/**/*.swift', ] - # Internal headers that aren't necessarily globally unique. Most C++ internal - # headers should be here to avoid polluting the global header map with - # unprefixed filenames. - # - # These filenames won't be available in Xcode's "quick open" but the types - # inside these files will be available. - s.preserve_paths = [ - 'Firestore/Source/API/*.h', - 'Firestore/Source/Core/*.h', - 'Firestore/Source/Local/*.h', - 'Firestore/Source/Remote/*.h', - 'Firestore/Source/Util/*.h', - 'Firestore/Protos/nanopb/**/*.h', - 'Firestore/core/include/**/*.h', - 'Firestore/core/src/**/*.h', - 'Firestore/third_party/nlohmann_json/json.hpp', - ] - s.requires_arc = [ - 'Firestore/Source/**/*', - 'Firestore/core/src/**/*.mm', - ] - - # Exclude alternate implementations for other platforms. These types depend - # upon link-time substitution, and there's no provision within CocoaPods for - # selecting files dynamically. - s.exclude_files = [ - 'Firestore/core/src/api/input_validation_std.cc', - 'Firestore/core/src/remote/connectivity_monitor_noop.cc', - 'Firestore/core/src/util/filesystem_win.cc', - 'Firestore/core/src/util/hard_assert_stdio.cc', - 'Firestore/core/src/util/log_stdio.cc', - 'Firestore/core/src/util/secure_random_openssl.cc' - ] - - s.dependency 'FirebaseAppCheckInterop', '~> 10.17' s.dependency 'FirebaseCore', '~> 10.0' + s.dependency 'FirebaseCoreExtension', '~> 10.0' + s.dependency 'FirebaseFirestoreInternal', '~> 10.17' + s.dependency 'FirebaseSharedSwift', '~> 10.0' - abseil_version = '~> 1.20220623.0' - s.dependency 'abseil/algorithm', abseil_version - s.dependency 'abseil/base', abseil_version - s.dependency 'abseil/container/flat_hash_map', abseil_version - s.dependency 'abseil/memory', abseil_version - s.dependency 'abseil/meta', abseil_version - s.dependency 'abseil/strings/strings', abseil_version - s.dependency 'abseil/time', abseil_version - s.dependency 'abseil/types', abseil_version - - s.dependency 'gRPC-C++', '~> 1.49.1' - s.dependency 'leveldb-library', '~> 1.22' - s.dependency 'nanopb', '>= 2.30908.0', '< 2.30910.0' - - s.ios.frameworks = 'SystemConfiguration', 'UIKit' - s.osx.frameworks = 'SystemConfiguration' - s.tvos.frameworks = 'SystemConfiguration', 'UIKit' - - s.library = 'c++' - s.pod_target_xcconfig = { - 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14', - 'GCC_C_LANGUAGE_STANDARD' => 'c99', - 'GCC_PREPROCESSOR_DEFINITIONS' => - "FIRFirestore_VERSION=#{s.version} " + - # The nanopb pod sets these defs, so we must too. (We *do* require 16bit - # (or larger) fields, so we'd have to set at least PB_FIELD_16BIT - # anyways.) - 'PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1', - 'HEADER_SEARCH_PATHS' => - '"${PODS_TARGET_SRCROOT}" ' + - '"${PODS_TARGET_SRCROOT}/Firestore/Source/Public/FirebaseFirestore" ' + - '"${PODS_ROOT}/nanopb" ' + - '"${PODS_TARGET_SRCROOT}/Firestore/Protos/nanopb"' - } - - s.compiler_flags = '$(inherited) -Wreorder -Werror=reorder -Wno-comma' end diff --git a/FirebaseFirestoreInternal.podspec b/FirebaseFirestoreInternal.podspec new file mode 100644 index 00000000000..dce0e3db265 --- /dev/null +++ b/FirebaseFirestoreInternal.podspec @@ -0,0 +1,130 @@ +Pod::Spec.new do |s| + s.name = 'FirebaseFirestoreInternal' + s.version = '10.17.0' + s.summary = 'Google Cloud Firestore' + + s.description = <<-DESC +Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. + DESC + + s.homepage = 'https://developers.google.com/' + s.license = { :type => 'Apache-2.0', :file => 'Firestore/LICENSE' } + s.authors = 'Google, Inc.' + + s.source = { + :git => 'https://github.com/firebase/firebase-ios-sdk.git', + :tag => 'CocoaPods-' + s.version.to_s + } + + s.ios.deployment_target = '11.0' + s.osx.deployment_target = '10.13' + s.tvos.deployment_target = '12.0' + + s.swift_version = '5.3' + + s.cocoapods_version = '>= 1.4.0' + s.prefix_header_file = false + + # Header files that constitute the interface to this module. Only Objective-C + # headers belong here, since FirebaseFirestore is primarily an Objective-C + # framework. + s.public_header_files = 'Firestore/Source/Public/FirebaseFirestore/*.h' + + # source_files contains most of the header and source files for the project. + # This includes files named in `public_header_files`. + # + # Each header in this list must be globally unique, even within customer + # projects. This generally means that only Objective-C Headers with a `FIR` + # or `FST` prefix can be in `source_files`. Non-public C++ headers that have + # no filename prefix must be in `preserve_paths`. See + # https://github.com/firebase/firebase-ios-sdk/issues/4035 for more details. + # + # Note: headers from FirebaseCore can be in this list because while they're + # not globally unique, each copy will be the same. It doesn't matter which + # version wins in the global header map. The benefit of keeping them here is + # that "quick open" by filename in Xcode will continue to work. + s.source_files = [ + 'FirebaseCore/Extension/*.h', + 'Firestore/Source/Public/FirebaseFirestore/*.h', + 'Firestore/Source/**/*.{m,mm}', + 'Firestore/Protos/nanopb/**/*.cc', + 'Firestore/core/include/**/*.{cc,mm}', + 'Firestore/core/src/**/*.{cc,mm}', + 'FirebaseAuth/Interop/*.h', + ] + + # Internal headers that aren't necessarily globally unique. Most C++ internal + # headers should be here to avoid polluting the global header map with + # unprefixed filenames. + # + # These filenames won't be available in Xcode's "quick open" but the types + # inside these files will be available. + s.preserve_paths = [ + 'Firestore/Source/API/*.h', + 'Firestore/Source/Core/*.h', + 'Firestore/Source/Local/*.h', + 'Firestore/Source/Remote/*.h', + 'Firestore/Source/Util/*.h', + 'Firestore/Protos/nanopb/**/*.h', + 'Firestore/core/include/**/*.h', + 'Firestore/core/src/**/*.h', + 'Firestore/third_party/nlohmann_json/json.hpp', + ] + s.requires_arc = [ + 'Firestore/Source/**/*', + 'Firestore/core/src/**/*.mm', + ] + + # Exclude alternate implementations for other platforms. These types depend + # upon link-time substitution, and there's no provision within CocoaPods for + # selecting files dynamically. + s.exclude_files = [ + 'Firestore/core/src/api/input_validation_std.cc', + 'Firestore/core/src/remote/connectivity_monitor_noop.cc', + 'Firestore/core/src/util/filesystem_win.cc', + 'Firestore/core/src/util/hard_assert_stdio.cc', + 'Firestore/core/src/util/log_stdio.cc', + 'Firestore/core/src/util/secure_random_openssl.cc' + ] + + s.dependency 'FirebaseAppCheckInterop', '~> 10.17' + s.dependency 'FirebaseCore', '~> 10.0' + + abseil_version = '~> 1.20220623.0' + s.dependency 'abseil/algorithm', abseil_version + s.dependency 'abseil/base', abseil_version + s.dependency 'abseil/container/flat_hash_map', abseil_version + s.dependency 'abseil/memory', abseil_version + s.dependency 'abseil/meta', abseil_version + s.dependency 'abseil/strings/strings', abseil_version + s.dependency 'abseil/time', abseil_version + s.dependency 'abseil/types', abseil_version + + s.dependency 'gRPC-C++', '~> 1.49.1' + s.dependency 'leveldb-library', '~> 1.22' + s.dependency 'nanopb', '>= 2.30908.0', '< 2.30910.0' + + s.ios.frameworks = 'SystemConfiguration', 'UIKit' + s.osx.frameworks = 'SystemConfiguration' + s.tvos.frameworks = 'SystemConfiguration', 'UIKit' + + s.library = 'c++' + s.pod_target_xcconfig = { + 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14', + 'CLANG_CXX_LIBRARY' => 'libc++', + 'GCC_C_LANGUAGE_STANDARD' => 'c99', + 'GCC_PREPROCESSOR_DEFINITIONS' => + "FIRFirestore_VERSION=#{s.version} " + + # The nanopb pod sets these defs, so we must too. (We *do* require 16bit + # (or larger) fields, so we'd have to set at least PB_FIELD_16BIT + # anyways.) + 'PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1', + 'HEADER_SEARCH_PATHS' => + '"${PODS_TARGET_SRCROOT}" ' + + '"${PODS_TARGET_SRCROOT}/Firestore/Source/Public" ' + + '"${PODS_ROOT}/nanopb" ' + + '"${PODS_TARGET_SRCROOT}/Firestore/Protos/nanopb"' + } + + s.compiler_flags = '$(inherited) -Wreorder -Werror=reorder -Wno-comma' +end diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateField.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateField.h new file mode 100644 index 00000000000..9c2cdbddc47 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateField.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateQuery.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateQuery.h new file mode 100644 index 00000000000..6f83beab451 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateQuery.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateQuerySnapshot.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateQuerySnapshot.h new file mode 100644 index 00000000000..8853da1c9a3 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateQuerySnapshot.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateSource.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateSource.h new file mode 100644 index 00000000000..a118cdf20f8 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRAggregateSource.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRCollectionReference.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRCollectionReference.h new file mode 100644 index 00000000000..148c06a9d7b --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRCollectionReference.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentChange.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentChange.h new file mode 100644 index 00000000000..4255089e60f --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentChange.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentReference.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentReference.h new file mode 100644 index 00000000000..ab8a338c4b1 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentReference.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentSnapshot.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentSnapshot.h new file mode 100644 index 00000000000..1b4b234d598 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRDocumentSnapshot.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRFieldPath.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFieldPath.h new file mode 100644 index 00000000000..d4aa61db708 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFieldPath.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRFieldValue.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFieldValue.h new file mode 100644 index 00000000000..a70f19e70e0 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFieldValue.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRFilter.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFilter.h new file mode 100644 index 00000000000..c12b38a9f0d --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFilter.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestore.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestore.h new file mode 100644 index 00000000000..7062e7a7f28 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestore.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreErrors.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreErrors.h new file mode 100644 index 00000000000..36bd7a5a3da --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreErrors.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreSettings.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreSettings.h new file mode 100644 index 00000000000..cc84b0e0525 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreSettings.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreSource.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreSource.h new file mode 100644 index 00000000000..a611230c46e --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRFirestoreSource.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRGeoPoint.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRGeoPoint.h new file mode 100644 index 00000000000..9b2d3dd57de --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRGeoPoint.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRListenerRegistration.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRListenerRegistration.h new file mode 100644 index 00000000000..cae6dcfac7d --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRListenerRegistration.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRLoadBundleTask.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRLoadBundleTask.h new file mode 100644 index 00000000000..7182e49dc20 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRLoadBundleTask.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRLocalCacheSettings.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRLocalCacheSettings.h new file mode 100644 index 00000000000..75e959eb9e1 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRLocalCacheSettings.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRPersistentCacheIndexManager.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRPersistentCacheIndexManager.h new file mode 100644 index 00000000000..2186b569e56 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRPersistentCacheIndexManager.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRQuery.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRQuery.h new file mode 100644 index 00000000000..043f39ec631 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRQuery.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRQuerySnapshot.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRQuerySnapshot.h new file mode 100644 index 00000000000..b0394807eef --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRQuerySnapshot.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRSnapshotMetadata.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRSnapshotMetadata.h new file mode 100644 index 00000000000..5e4444fc0b3 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRSnapshotMetadata.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRTimestamp.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRTimestamp.h new file mode 100644 index 00000000000..289d7bf3306 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRTimestamp.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRTransaction.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRTransaction.h new file mode 100644 index 00000000000..576f7e15830 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRTransaction.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRTransactionOptions.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRTransactionOptions.h new file mode 100644 index 00000000000..50709323037 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRTransactionOptions.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FIRWriteBatch.h b/FirebaseFirestoreInternal/FirebaseFirestore/FIRWriteBatch.h new file mode 100644 index 00000000000..2e636fb88b8 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FIRWriteBatch.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/FirebaseFirestore/FirebaseFirestore.h b/FirebaseFirestoreInternal/FirebaseFirestore/FirebaseFirestore.h new file mode 100644 index 00000000000..65a6ba282a4 --- /dev/null +++ b/FirebaseFirestoreInternal/FirebaseFirestore/FirebaseFirestore.h @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import diff --git a/FirebaseFirestoreInternal/dummy.m b/FirebaseFirestoreInternal/dummy.m new file mode 100644 index 00000000000..93d21461eb7 --- /dev/null +++ b/FirebaseFirestoreInternal/dummy.m @@ -0,0 +1,15 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Swift Package Manager needs at least one source file. diff --git a/FirebaseFirestoreSwift.podspec b/FirebaseFirestoreSwift.podspec index d1c43768369..7920a59fbd3 100644 --- a/FirebaseFirestoreSwift.podspec +++ b/FirebaseFirestoreSwift.podspec @@ -31,12 +31,9 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling, s.requires_arc = true s.source_files = [ - 'Firestore/Swift/Source/**/*.swift', + 'FirebaseFirestoreSwift/Sources/FirebaseFirestoreSwift.swift' ] - s.dependency 'FirebaseCore', '~> 10.0' - s.dependency 'FirebaseCoreExtension', '~> 10.0' - s.dependency 'FirebaseFirestore', '~> 10.0' - s.dependency 'FirebaseSharedSwift', '~> 10.0' + s.dependency 'FirebaseFirestore', '~> 10.17' end diff --git a/FirebaseFirestoreSwift/Sources/FirebaseFirestoreSwift.swift b/FirebaseFirestoreSwift/Sources/FirebaseFirestoreSwift.swift new file mode 100644 index 00000000000..9918633f67b --- /dev/null +++ b/FirebaseFirestoreSwift/Sources/FirebaseFirestoreSwift.swift @@ -0,0 +1,30 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#warning( + "All of the public API from `FirebaseFirestoreSwift` can now be accessed through the `FirebaseFirestore` module. Therefore, the `FirebaseFirestoreSwift` module is deprecated and will be removed in the future. See https://firebase.google.com/docs/ios/swift-migration for migration instructions." +) + +// The `@_exported` is needed to prevent breaking clients that are using +// types prefixed with the `FirebaseFirestoreSwift` namespace. +@_exported import enum FirebaseFirestore.DecodingFailureStrategy +@_exported import struct FirebaseFirestore.DocumentID +@_exported import protocol FirebaseFirestore.DocumentIDWrappable +@_exported import struct FirebaseFirestore.ExplicitNull +@_exported import enum FirebaseFirestore.FirestoreDecodingError +@_exported import enum FirebaseFirestore.FirestoreEncodingError +@_exported import struct FirebaseFirestore.FirestoreQuery +@_exported import enum FirebaseFirestore.QueryPredicate +@_exported import struct FirebaseFirestore.ServerTimestamp +@_exported import protocol FirebaseFirestore.ServerTimestampWrappable diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index 1832eabef6f..44894994b94 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,5 +1,9 @@ # 10.17.0 - [feature] Add support for sum and average aggregate queries. +- [feature] The `FirebaseFirestore` module now contains Firebase Firestore's + Swift-only APIs that were previously only available via the + `FirebaseFirestoreSwift` extension SDK. See the + `FirebaseFirestoreSwift` release note from this release for more details. # 10.16.0 - [fixed] Fixed an issue where Firestore's binary SwiftPM distribution would diff --git a/Firestore/Example/Podfile b/Firestore/Example/Podfile index b21e5c0befe..6ac7eead24b 100644 --- a/Firestore/Example/Podfile +++ b/Firestore/Example/Podfile @@ -56,15 +56,17 @@ end # required. def configure_local_pods() # Firestore is always local; that's what's under development here. - pod 'FirebaseFirestore', :path => '../..' + pod 'FirebaseFirestore', :path => '../../' # FirebaseCore must always be a local pod so that CI builds that make changes # to its podspec can still function. See Firestore-*-xcodebuild in # scripts/install_prereqs.sh for more details. + pod 'FirebaseFirestoreInternal', :path => '../..' pod 'FirebaseAppCheckInterop', :path => '../..' pod 'FirebaseCore', :path => '../..' pod 'FirebaseCoreInternal', :path => '../..' pod 'FirebaseCoreExtension',:path => '../..' + pod 'FirebaseSharedSwift', :path => '../../' # Pull in local sources conditionally. maybe_local_pod 'FirebaseAuth' @@ -116,7 +118,6 @@ if is_platform(:ios) target 'Firestore_IntegrationTests_iOS' do inherit! :search_paths - pod 'FirebaseSharedSwift', :path => '../../' pod 'FirebaseFirestoreSwift', :path => '../../' pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec' pod 'GoogleTest', :podspec => 'GoogleTest.podspec' @@ -153,7 +154,6 @@ if is_platform(:osx) target 'Firestore_IntegrationTests_macOS' do inherit! :search_paths - pod 'FirebaseSharedSwift', :path => '../../' pod 'FirebaseFirestoreSwift', :path => '../../' pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec' pod 'GoogleTest', :podspec => 'GoogleTest.podspec' @@ -183,7 +183,6 @@ if is_platform(:tvos) target 'Firestore_IntegrationTests_tvOS' do inherit! :search_paths - pod 'FirebaseSharedSwift', :path => '../../' pod 'FirebaseFirestoreSwift', :path => '../../' pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec' pod 'GoogleTest', :podspec => 'GoogleTest.podspec' diff --git a/Firestore/Swift/CHANGELOG.md b/Firestore/Swift/CHANGELOG.md index a176d7c4e11..742402f80eb 100644 --- a/Firestore/Swift/CHANGELOG.md +++ b/Firestore/Swift/CHANGELOG.md @@ -1,3 +1,10 @@ +# 10.17.0 +- [deprecated] All of the public API from `FirebaseFirestoreSwift` can now + be accessed through the `FirebaseFirestore` module. Therefore, + `FirebaseFirestoreSwift` has been deprecated, and will be removed in a + future release. See https://firebase.google.com/docs/ios/swift-migration for + migration instructions. + # 10.12.0 - [added] Added support animations on the `@FirestoreQuery` property wrapper. diff --git a/Firestore/Swift/FirebaseFirestore.h b/Firestore/Swift/FirebaseFirestore.h new file mode 100644 index 00000000000..ff82010a654 --- /dev/null +++ b/Firestore/Swift/FirebaseFirestore.h @@ -0,0 +1 @@ +@import FirestoreInternal; diff --git a/Firestore/Swift/Source/AsyncAwait/CollectionReference+AsyncAwait.swift b/Firestore/Swift/Source/AsyncAwait/CollectionReference+AsyncAwait.swift index 3fcb340da63..aa4a679af65 100644 --- a/Firestore/Swift/Source/AsyncAwait/CollectionReference+AsyncAwait.swift +++ b/Firestore/Swift/Source/AsyncAwait/CollectionReference+AsyncAwait.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE import Foundation #if compiler(>=5.5.2) && canImport(_Concurrency) diff --git a/Firestore/Swift/Source/AsyncAwait/Firestore+AsyncAwait.swift b/Firestore/Swift/Source/AsyncAwait/Firestore+AsyncAwait.swift index 2a09c08efab..18dd6f1b7ef 100644 --- a/Firestore/Swift/Source/AsyncAwait/Firestore+AsyncAwait.swift +++ b/Firestore/Swift/Source/AsyncAwait/Firestore+AsyncAwait.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE import Foundation #if compiler(>=5.5.2) && canImport(_Concurrency) diff --git a/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift b/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift index 0b6371745ac..cf425833bf6 100644 --- a/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift +++ b/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift @@ -16,7 +16,12 @@ import Foundation import FirebaseSharedSwift -import FirebaseFirestore + +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE internal struct FirestorePassthroughTypes: StructureCodingPassthroughTypeResolver { static func isPassthroughType(_ t: T) -> Bool { diff --git a/Firestore/Swift/Source/Codable/CollectionReference+WriteEncodable.swift b/Firestore/Swift/Source/Codable/CollectionReference+WriteEncodable.swift index fe3ee5167b9..c85a1fe261f 100644 --- a/Firestore/Swift/Source/Codable/CollectionReference+WriteEncodable.swift +++ b/Firestore/Swift/Source/Codable/CollectionReference+WriteEncodable.swift @@ -15,7 +15,12 @@ */ import Foundation -import FirebaseFirestore + +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE public extension CollectionReference { /// Encodes an instance of `Encodable` and adds a new document to this collection diff --git a/Firestore/Swift/Source/Codable/DocumentID.swift b/Firestore/Swift/Source/Codable/DocumentID.swift index fca5f8de0d8..a55cb317590 100644 --- a/Firestore/Swift/Source/Codable/DocumentID.swift +++ b/Firestore/Swift/Source/Codable/DocumentID.swift @@ -14,7 +14,12 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE + import FirebaseSharedSwift @_implementationOnly import FirebaseCoreExtension diff --git a/Firestore/Swift/Source/Codable/DocumentReference+Codable.swift b/Firestore/Swift/Source/Codable/DocumentReference+Codable.swift index ca52fac5e63..59563cf11a9 100644 --- a/Firestore/Swift/Source/Codable/DocumentReference+Codable.swift +++ b/Firestore/Swift/Source/Codable/DocumentReference+Codable.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /** Mark DocumentReference to conform to Codable. */ diff --git a/Firestore/Swift/Source/Codable/DocumentReference+ReadDecodable.swift b/Firestore/Swift/Source/Codable/DocumentReference+ReadDecodable.swift index 28e76010055..f52e45e1f62 100644 --- a/Firestore/Swift/Source/Codable/DocumentReference+ReadDecodable.swift +++ b/Firestore/Swift/Source/Codable/DocumentReference+ReadDecodable.swift @@ -15,7 +15,11 @@ */ import Foundation -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE public extension DocumentReference { /// Fetches and decodes the document referenced by this `DocumentReference`. diff --git a/Firestore/Swift/Source/Codable/DocumentReference+WriteEncodable.swift b/Firestore/Swift/Source/Codable/DocumentReference+WriteEncodable.swift index 11fbfa18330..5fb791a2ee4 100644 --- a/Firestore/Swift/Source/Codable/DocumentReference+WriteEncodable.swift +++ b/Firestore/Swift/Source/Codable/DocumentReference+WriteEncodable.swift @@ -15,7 +15,11 @@ */ import Foundation -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE public extension DocumentReference { /// Encodes an instance of `Encodable` and overwrites the encoded data diff --git a/Firestore/Swift/Source/Codable/DocumentSnapshot+ReadDecodable.swift b/Firestore/Swift/Source/Codable/DocumentSnapshot+ReadDecodable.swift index ad9a10bd92a..21c8e1ff36f 100644 --- a/Firestore/Swift/Source/Codable/DocumentSnapshot+ReadDecodable.swift +++ b/Firestore/Swift/Source/Codable/DocumentSnapshot+ReadDecodable.swift @@ -15,7 +15,11 @@ */ import Foundation -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE public extension DocumentSnapshot { /// Retrieves all fields in a document and converts them to an instance of diff --git a/Firestore/Swift/Source/Codable/EncoderDecoder.swift b/Firestore/Swift/Source/Codable/EncoderDecoder.swift index 3c35117222c..43c3b71f378 100644 --- a/Firestore/Swift/Source/Codable/EncoderDecoder.swift +++ b/Firestore/Swift/Source/Codable/EncoderDecoder.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE import FirebaseSharedSwift import Foundation diff --git a/Firestore/Swift/Source/Codable/ExplicitNull.swift b/Firestore/Swift/Source/Codable/ExplicitNull.swift index 980093dbf0c..a8590d34f05 100644 --- a/Firestore/Swift/Source/Codable/ExplicitNull.swift +++ b/Firestore/Swift/Source/Codable/ExplicitNull.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /// Wraps an `Optional` field in a `Codable` object such that when the field /// has a `nil` value it will encode to a null value in Firestore. Normally, diff --git a/Firestore/Swift/Source/Codable/FieldValue+Encodable.swift b/Firestore/Swift/Source/Codable/FieldValue+Encodable.swift index ef52b09f30f..974b09c4cf1 100644 --- a/Firestore/Swift/Source/Codable/FieldValue+Encodable.swift +++ b/Firestore/Swift/Source/Codable/FieldValue+Encodable.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /** Extends FieldValue to conform to Encodable. */ extension FieldValue: Encodable { diff --git a/Firestore/Swift/Source/Codable/GeoPoint+Codable.swift b/Firestore/Swift/Source/Codable/GeoPoint+Codable.swift index 60acc2db661..fb312d118ce 100644 --- a/Firestore/Swift/Source/Codable/GeoPoint+Codable.swift +++ b/Firestore/Swift/Source/Codable/GeoPoint+Codable.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /** * A protocol describing the encodable properties of a GeoPoint. diff --git a/Firestore/Swift/Source/Codable/ServerTimestamp.swift b/Firestore/Swift/Source/Codable/ServerTimestamp.swift index bd211a9c442..94857811a00 100644 --- a/Firestore/Swift/Source/Codable/ServerTimestamp.swift +++ b/Firestore/Swift/Source/Codable/ServerTimestamp.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /// A type that can initialize itself from a Firestore Timestamp, which makes /// it suitable for use with the `@ServerTimestamp` property wrapper. diff --git a/Firestore/Swift/Source/Codable/Timestamp+Codable.swift b/Firestore/Swift/Source/Codable/Timestamp+Codable.swift index 9bed88200ad..8c0c020bed6 100644 --- a/Firestore/Swift/Source/Codable/Timestamp+Codable.swift +++ b/Firestore/Swift/Source/Codable/Timestamp+Codable.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /** * A protocol describing the encodable properties of a Timestamp. diff --git a/Firestore/Swift/Source/Codable/TimestampDecodingStrategy.swift b/Firestore/Swift/Source/Codable/TimestampDecodingStrategy.swift index d72c941ac77..e87447dde51 100644 --- a/Firestore/Swift/Source/Codable/TimestampDecodingStrategy.swift +++ b/Firestore/Swift/Source/Codable/TimestampDecodingStrategy.swift @@ -15,7 +15,11 @@ */ import Foundation -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE import FirebaseSharedSwift public extension FirebaseDataDecoder.DateDecodingStrategy { diff --git a/Firestore/Swift/Source/Codable/TimestampEncodingStrategy.swift b/Firestore/Swift/Source/Codable/TimestampEncodingStrategy.swift index 7d1f47dc9fb..a73ed096c85 100644 --- a/Firestore/Swift/Source/Codable/TimestampEncodingStrategy.swift +++ b/Firestore/Swift/Source/Codable/TimestampEncodingStrategy.swift @@ -14,7 +14,12 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE + import FirebaseSharedSwift import Foundation diff --git a/Firestore/Swift/Source/Codable/Transaction+WriteEncodable.swift b/Firestore/Swift/Source/Codable/Transaction+WriteEncodable.swift index 196cee6c94b..86fec68229f 100644 --- a/Firestore/Swift/Source/Codable/Transaction+WriteEncodable.swift +++ b/Firestore/Swift/Source/Codable/Transaction+WriteEncodable.swift @@ -15,7 +15,11 @@ */ import Foundation -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE public extension Transaction { /// Encodes an instance of `Encodable` and overwrites the encoded data diff --git a/Firestore/Swift/Source/Codable/WriteBatch+WriteEncodable.swift b/Firestore/Swift/Source/Codable/WriteBatch+WriteEncodable.swift index 8232325d1fd..9434a55509e 100644 --- a/Firestore/Swift/Source/Codable/WriteBatch+WriteEncodable.swift +++ b/Firestore/Swift/Source/Codable/WriteBatch+WriteEncodable.swift @@ -15,7 +15,11 @@ */ import Foundation -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE public extension WriteBatch { /// Encodes an instance of `Encodable` and overwrites the encoded data diff --git a/Firestore/Swift/Source/PropertyWrapper/FirestoreQuery.swift b/Firestore/Swift/Source/PropertyWrapper/FirestoreQuery.swift index 16ca88baa27..da0f0a842d7 100644 --- a/Firestore/Swift/Source/PropertyWrapper/FirestoreQuery.swift +++ b/Firestore/Swift/Source/PropertyWrapper/FirestoreQuery.swift @@ -15,7 +15,12 @@ */ import SwiftUI -import FirebaseFirestore + +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /// The strategy to use when an error occurs during mapping Firestore documents /// to the target type of `FirestoreQuery`. diff --git a/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift b/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift index ba1db479c9c..b33d27e56e9 100644 --- a/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift +++ b/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift @@ -15,7 +15,12 @@ */ import SwiftUI -import FirebaseFirestore + +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE @available(iOS 14.0, macOS 11.0, macCatalyst 14.0, tvOS 14.0, watchOS 7.0, *) internal class FirestoreQueryObservable: ObservableObject { diff --git a/Firestore/Swift/Source/PropertyWrapper/QueryPredicate.swift b/Firestore/Swift/Source/PropertyWrapper/QueryPredicate.swift index 54779049d10..d1bd1f7b6e8 100644 --- a/Firestore/Swift/Source/PropertyWrapper/QueryPredicate.swift +++ b/Firestore/Swift/Source/PropertyWrapper/QueryPredicate.swift @@ -14,7 +14,11 @@ * limitations under the License. */ -import FirebaseFirestore +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE /// Query predicates that can be used to filter results fetched by `FirestoreQuery`. /// diff --git a/Firestore/Swift/Source/SwiftHeaderWorkaround.swift b/Firestore/Swift/Source/SwiftHeaderWorkaround.swift new file mode 100644 index 00000000000..3ef3235272f --- /dev/null +++ b/Firestore/Swift/Source/SwiftHeaderWorkaround.swift @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreInternalWrapper +#else + @_exported import FirebaseFirestoreInternal +#endif // SWIFT_PACKAGE + +// This is a trick to force generate a `FirebaseFirestore-Swift.h` +// header that re-exports `FirebaseFirestoreInternal` for Objective-C +// clients. It is important for the below code to reference a Remote +// Config symbol defined in Objective-C as that will import the symbol's +// module (`FirebaseFirestoreInternal`) in the generated header. This +// allows Objective-C clients to import Firestore's Objective-C API +// using `@import FirebaseFirestore;`. This API is not needed for Swift +// clients and is therefore unavailable in a Swift context. +@available(*, unavailable) +@objc public extension Firestore { + static var __no_op: () -> Void { {} } +} diff --git a/Package.swift b/Package.swift index b78693ee56d..1a08f4c1b57 100644 --- a/Package.swift +++ b/Package.swift @@ -656,7 +656,6 @@ let package = Package( ] ), firestoreWrapperTarget(), - firestoreTarget(), .target( name: "FirebaseFirestoreSwiftTarget", dependencies: [.target(name: "FirebaseFirestoreSwift", @@ -668,30 +667,9 @@ let package = Package( .target( name: "FirebaseFirestoreSwift", dependencies: [ - "FirebaseCore", - "FirebaseCoreExtension", "FirebaseFirestoreTarget", - "FirebaseSharedSwift", - ], - path: "Firestore", - exclude: [ - "CHANGELOG.md", - "CMakeLists.txt", - "Example/", - "LICENSE", - "Protos/", - "README.md", - "Source/", - "core/", - "fuzzing/", - "test.sh", - "Swift/CHANGELOG.md", - "Swift/Tests/", - "third_party/nlohmann_json", ], - sources: [ - "Swift/Source/", - ] + path: "FirebaseFirestoreSwift/Sources" ), // MARK: - Firebase Functions @@ -1320,8 +1298,7 @@ let package = Package( .headerSearchPath("../../.."), ] ), - - ], + ] + firestoreTargets(), cLanguageStandard: .c99, cxxLanguageStandard: CXXLanguageStandard.gnucxx14 ) @@ -1387,109 +1364,162 @@ func firestoreWrapperTarget() -> Target { return .target( name: "FirebaseFirestoreTarget", - dependencies: [ + dependencies: [.target(name: "FirebaseFirestore", + condition: .when(platforms: [.iOS, .tvOS, .macOS, .macCatalyst]))], + path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap" + ) +} + +func firestoreTargets() -> [Target] { + if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { + return [ + .target( + name: "FirebaseFirestoreInternalWrapper", + dependencies: [ + "FirebaseAppCheckInterop", + "FirebaseCore", + "leveldb", + .product(name: "nanopb", package: "nanopb"), + .product(name: "abseil", package: "abseil-cpp-SwiftPM"), + .product(name: "gRPC-cpp", package: "grpc-ios"), + ], + path: "Firestore", + exclude: [ + "CHANGELOG.md", + "CMakeLists.txt", + "Example/", + "LICENSE", + "Protos/CMakeLists.txt", + "Protos/Podfile", + "Protos/README.md", + "Protos/build_protos.py", + "Protos/cpp/", + "Protos/lib/", + "Protos/nanopb_cpp_generator.py", + "Protos/protos/", + "README.md", + "Source/CMakeLists.txt", + "Swift/", + "core/CMakeLists.txt", + "core/src/util/config_detected.h.in", + "core/test/", + "fuzzing/", + "test.sh", + // Swift PM doesn't recognize hpp files, so we're relying on search paths + // to find third_party/nlohmann_json/json.hpp. + "third_party/", + + // Exclude alternate implementations for other platforms + "core/src/remote/connectivity_monitor_noop.cc", + "core/src/util/filesystem_win.cc", + "core/src/util/log_stdio.cc", + "core/src/util/secure_random_openssl.cc", + ], + sources: [ + "Source/", + "Protos/nanopb/", + "core/include/", + "core/src", + ], + publicHeadersPath: "Source/Public", + cSettings: [ + .headerSearchPath("../"), + .headerSearchPath("Source/Public/FirebaseFirestore"), + .headerSearchPath("Protos/nanopb"), + .define("PB_FIELD_32BIT", to: "1"), + .define("PB_NO_PACKED_STRUCTS", to: "1"), + .define("PB_ENABLE_MALLOC", to: "1"), + .define("FIRFirestore_VERSION", to: firebaseVersion), + ], + linkerSettings: [ + .linkedFramework( + "SystemConfiguration", + .when(platforms: [.iOS, .macOS, .tvOS, .firebaseVisionOS]) + ), + .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS, .firebaseVisionOS])), + .linkedLibrary("c++"), + ] + ), .target( name: "FirebaseFirestore", - condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS]) + dependencies: [ + "FirebaseCore", + "FirebaseCoreExtension", + "FirebaseFirestoreInternalWrapper", + "FirebaseSharedSwift", + ], + path: "Firestore", + exclude: [ + "CHANGELOG.md", + "CMakeLists.txt", + "Example/", + "LICENSE", + "Protos/", + "README.md", + "Source/", + "core/", + "fuzzing/", + "test.sh", + "Swift/CHANGELOG.md", + "Swift/Tests/", + "third_party/nlohmann_json", + ], + sources: [ + "Swift/Source/", + ] ), - .product(name: "abseil", package: "abseil-cpp-binary"), - .product(name: "gRPC-C++", package: "grpc-binary"), - .product(name: "nanopb", package: "nanopb"), - "FirebaseCore", - "leveldb", - ], - path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap", - linkerSettings: [ - .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])), - .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])), - .linkedLibrary("c++"), ] - ) -} + } -func firestoreTarget() -> Target { - if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { - return .target( + let firestoreInternalTarget: Target = { + if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil { + // This is set when running `scripts/check_firestore_symbols.sh`. + return .binaryTarget( + name: "FirebaseFirestoreInternal", + // The `xcframework` should be moved to the root of the repo. + path: "FirebaseFirestoreInternal.xcframework" + ) + } else { + return .binaryTarget( + name: "FirebaseFirestoreInternal", + url: "https://github.com/ncooke3/binary-staging/releases/download/10.17.0/FirebaseFirestoreInternal.zip", + checksum: "d0c11c933b5b62d68f47c94acfb6cf7d7adf05dc3e81dea48a11ce320bef41e2" + ) + } + }() + + return [ + .target( name: "FirebaseFirestore", dependencies: [ + .target( + name: "FirebaseFirestoreInternalWrapper", + condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS]) + ), + .product(name: "abseil", package: "abseil-cpp-binary"), + .product(name: "gRPC-C++", package: "grpc-binary"), + .product(name: "nanopb", package: "nanopb"), "FirebaseAppCheckInterop", "FirebaseCore", + "FirebaseCoreExtension", "leveldb", - .product(name: "nanopb", package: "nanopb"), - .product(name: "abseil", package: "abseil-cpp-SwiftPM"), - .product(name: "gRPC-cpp", package: "grpc-ios"), - ], - path: "Firestore", - exclude: [ - "CHANGELOG.md", - "CMakeLists.txt", - "Example/", - "LICENSE", - "Protos/CMakeLists.txt", - "Protos/Podfile", - "Protos/README.md", - "Protos/build_protos.py", - "Protos/cpp/", - "Protos/lib/", - "Protos/nanopb_cpp_generator.py", - "Protos/protos/", - "README.md", - "Source/CMakeLists.txt", - "Swift/", - "core/CMakeLists.txt", - "core/src/util/config_detected.h.in", - "core/test/", - "fuzzing/", - "test.sh", - // Swift PM doesn't recognize hpp files, so we're relying on search paths - // to find third_party/nlohmann_json/json.hpp. - "third_party/", - - // Exclude alternate implementations for other platforms - "core/src/remote/connectivity_monitor_noop.cc", - "core/src/util/filesystem_win.cc", - "core/src/util/log_stdio.cc", - "core/src/util/secure_random_openssl.cc", - ], - sources: [ - "Source/", - "Protos/nanopb/", - "core/include/", - "core/src", - ], - publicHeadersPath: "Source/Public", - cSettings: [ - .headerSearchPath("../"), - .headerSearchPath("Source/Public/FirebaseFirestore"), - .headerSearchPath("Protos/nanopb"), - .define("PB_FIELD_32BIT", to: "1"), - .define("PB_NO_PACKED_STRUCTS", to: "1"), - .define("PB_ENABLE_MALLOC", to: "1"), - .define("FIRFirestore_VERSION", to: firebaseVersion), + "FirebaseSharedSwift", ], + path: "Firestore/Swift/Source", linkerSettings: [ - .linkedFramework( - "SystemConfiguration", - .when(platforms: [.iOS, .macOS, .tvOS, .firebaseVisionOS]) - ), - .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS, .firebaseVisionOS])), + .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])), + .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])), .linkedLibrary("c++"), ] - ) - } else if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil { - // This is set when running `scripts/check_firestore_symbols.sh`. - return .binaryTarget( - name: "FirebaseFirestore", - // The `xcframework` should be moved to the root of the repo. - path: "FirebaseFirestore.xcframework" - ) - } - - return .binaryTarget( - name: "FirebaseFirestore", - url: "https://dl.google.com/firebase/ios/bin/firestore/10.16.0/FirebaseFirestore.zip", - checksum: "0a6616a4bbf1adb2f0a502e9ad8e5ab144a8c4993a15bb4b795bae86b66ecab8" - ) + ), + .target( + name: "FirebaseFirestoreInternalWrapper", + dependencies: ["FirebaseFirestoreInternal"], + path: "FirebaseFirestoreInternal", + publicHeadersPath: "." + ), + firestoreInternalTarget, + ] } extension Platform { diff --git a/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift b/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift index af1befcdbe1..ad7f301d9b5 100755 --- a/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift +++ b/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift @@ -47,8 +47,9 @@ public let shared = Manifest( Pod("FirebaseDatabase"), Pod("FirebaseDatabaseSwift", allowWarnings: true, zip: true), Pod("FirebaseDynamicLinks", platforms: ["ios"], zip: true), + Pod("FirebaseFirestoreInternal", allowWarnings: true), Pod("FirebaseFirestore", allowWarnings: true), - Pod("FirebaseFirestoreSwift", zip: true), + Pod("FirebaseFirestoreSwift", allowWarnings: true, zip: true), Pod("FirebaseFunctions", zip: true), Pod("FirebaseInAppMessaging", isBeta: true, platforms: ["ios"]), Pod( diff --git a/scripts/check_firestore_symbols.sh b/scripts/check_firestore_symbols.sh index 420e89c18e8..fe2d41b9b50 100755 --- a/scripts/check_firestore_symbols.sh +++ b/scripts/check_firestore_symbols.sh @@ -15,10 +15,11 @@ # limitations under the License. # DESCRIPTION: This script identifies Objective-C symbols within the -# `FirebaseFirestore.xcframework` that are not automatically linked when used -# in a client target. Because the `FirebaseFirestore.xcframework` should -# function without clients needing to pass the `-ObjC` flag, this script -# catches potential regressions that break that requirement. +# `FirebaseFirestoreInternal.xcframework` that are not automatically linked +# when used in a client target. Because the +# `FirebaseFirestoreInternal.xcframework` should function without clients +# needing to pass the `-ObjC` flag, this script catches potential regressions +# that break that requirement. # # DEPENDENCIES: This script depends on the given Firebase repo's `Package.swift` # using the `FIREBASECI_USE_LOCAL_FIRESTORE_ZIP` env var to swap the Firestore @@ -57,8 +58,8 @@ fi # Check if the given xcframework path is valid. FIRESTORE_XCFRAMEWORK_PATH=$2 -if [ "$(basename $FIRESTORE_XCFRAMEWORK_PATH)" != 'FirebaseFirestore.xcframework' ]; then - echo "The given xcframework is not a FirebaseFirestore.xcframework." +if [ "$(basename $FIRESTORE_XCFRAMEWORK_PATH)" != 'FirebaseFirestoreInternal.xcframework' ]; then + echo "The given xcframework is not a FirebaseFirestoreInternal.xcframework." exit 1 fi diff --git a/scripts/sync_project.rb b/scripts/sync_project.rb index 6bc4af25f26..fdf03f8d33f 100755 --- a/scripts/sync_project.rb +++ b/scripts/sync_project.rb @@ -62,8 +62,8 @@ def +(other) def sync_firestore(test_only) project = Xcodeproj::Project.open('Firestore/Example/Firestore.xcodeproj') - spec = Pod::Spec.from_file('FirebaseFirestore.podspec') - swift_spec = Pod::Spec.from_file('FirebaseFirestoreSwift.podspec') + spec = Pod::Spec.from_file('FirebaseFirestoreInternal.podspec') + swift_spec = Pod::Spec.from_file('FirebaseFirestore.podspec') # Enable warnings after opening the project to avoid the warnings in # xcodeproj itself