diff options
author | Sebastian Schmidt <mrschmidt@google.com> | 2017-11-29 17:23:47 -0800 |
---|---|---|
committer | Sebastian Schmidt <mrschmidt@google.com> | 2017-11-29 17:23:47 -0800 |
commit | e0dbc1240be641da0a9e12a57c211096cb51cb01 (patch) | |
tree | 6ca80eef4155d82b5546a7aa737c44930d293c22 /Firestore | |
parent | 5db88f16617e2ef4c313dba4d5a7f91d31e66c8d (diff) | |
parent | 2f5ab0f6f88b30bea2f5f5d0c05b910a89c8d4a4 (diff) |
Merge branch 'master' into mrschmidt-crash
Diffstat (limited to 'Firestore')
263 files changed, 1674 insertions, 1501 deletions
diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index 2f88741..0aba04e 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +# v0.9.3 +- [changed] Improved performance loading documents matching a query. +- [changed] Cleanly shut down idle write streams. + # v0.9.2 - [changed] Firestore now retries requests more often before considering a client offline. - [changed] You can now use FieldValue.delete() with SetOptions.merge(). diff --git a/Firestore/CMakeLists.txt b/Firestore/CMakeLists.txt new file mode 100644 index 0000000..119af5e --- /dev/null +++ b/Firestore/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright 2017 Google +# +# 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. + +include(${PROJECT_SOURCE_DIR}/cmake/external/googletest.cmake) + +add_subdirectory(src/support) +add_subdirectory(test/support) + +add_subdirectory(src/core/util) +add_subdirectory(test/core/util) diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index eac3251..f56af4c 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -24,6 +24,8 @@ /* Begin PBXBuildFile section */ 3B843E4C1F3A182900548890 /* remote_store_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 3B843E4A1F3930A400548890 /* remote_store_spec_test.json */; }; + 5463926E1FBEDE28005031AA /* secure_random_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5463926D1FBEDE28005031AA /* secure_random_test.cc */; }; + 5471DCF91FBF99AC00656CD3 /* autoid_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5471DCF71FBF99A300656CD3 /* autoid_test.cc */; }; 54764FAB1FAA0C320085E60A /* string_util_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54764FAA1FAA0C320085E60A /* string_util_test.cc */; }; 54764FAF1FAA21B90085E60A /* FSTGoogleTestTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 54764FAE1FAA21B90085E60A /* FSTGoogleTestTests.mm */; }; 5491BC721FB44593008B3588 /* FSTIntegrationTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5491BC711FB44593008B3588 /* FSTIntegrationTestCase.mm */; }; @@ -134,7 +136,6 @@ DE51B1FF1F0D493A0013853F /* FSTAssertTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DE51B1861F0D48AC0013853F /* FSTAssertTests.m */; }; DE51B2001F0D493A0013853F /* FSTComparisonTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DE51B1871F0D48AC0013853F /* FSTComparisonTests.m */; }; DE51B2011F0D493E0013853F /* FSTHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = DE51B1891F0D48AC0013853F /* FSTHelpers.m */; }; - DE51B2021F0D493E0013853F /* FSTUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DE51B18A1F0D48AC0013853F /* FSTUtilTests.m */; }; F104BBD69BC3F0796E3A77C1 /* Pods_Firestore_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69F6A10DBD6187489481CD76 /* Pods_Firestore_Tests.framework */; }; /* End PBXBuildFile section */ @@ -183,6 +184,8 @@ 3B843E4A1F3930A400548890 /* remote_store_spec_test.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = remote_store_spec_test.json; sourceTree = "<group>"; }; 42491D7DC8C8CD245CC22B93 /* Pods-SwiftBuildTest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftBuildTest.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftBuildTest/Pods-SwiftBuildTest.debug.xcconfig"; sourceTree = "<group>"; }; 4EBC5F5ABE1FD097EFE5E224 /* Pods-Firestore_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example/Pods-Firestore_Example.release.xcconfig"; sourceTree = "<group>"; }; + 5463926D1FBEDE28005031AA /* secure_random_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = secure_random_test.cc; path = ../../test/support/secure_random_test.cc; sourceTree = "<group>"; }; + 5471DCF71FBF99A300656CD3 /* autoid_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = autoid_test.cc; path = ../../test/core/util/autoid_test.cc; sourceTree = "<group>"; }; 54764FAA1FAA0C320085E60A /* string_util_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_util_test.cc; path = ../../Port/string_util_test.cc; sourceTree = "<group>"; }; 54764FAE1FAA21B90085E60A /* FSTGoogleTestTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = FSTGoogleTestTests.mm; path = GoogleTest/FSTGoogleTestTests.mm; sourceTree = "<group>"; }; 5491BC711FB44593008B3588 /* FSTIntegrationTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTIntegrationTestCase.mm; sourceTree = "<group>"; }; @@ -279,7 +282,6 @@ DE51B1871F0D48AC0013853F /* FSTComparisonTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FSTComparisonTests.m; sourceTree = "<group>"; }; DE51B1881F0D48AC0013853F /* FSTHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FSTHelpers.h; sourceTree = "<group>"; }; DE51B1891F0D48AC0013853F /* FSTHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FSTHelpers.m; sourceTree = "<group>"; }; - DE51B18A1F0D48AC0013853F /* FSTUtilTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FSTUtilTests.m; sourceTree = "<group>"; }; DE51B1941F0D48AC0013853F /* FSTLevelDBSpecTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FSTLevelDBSpecTests.m; sourceTree = "<group>"; }; DE51B1951F0D48AC0013853F /* FSTMemorySpecTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FSTMemorySpecTests.m; sourceTree = "<group>"; }; DE51B1961F0D48AC0013853F /* FSTMockDatastore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FSTMockDatastore.h; sourceTree = "<group>"; }; @@ -364,11 +366,37 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 5463926F1FBEDE2F005031AA /* support */ = { + isa = PBXGroup; + children = ( + 5463926D1FBEDE28005031AA /* secure_random_test.cc */, + ); + name = support; + sourceTree = "<group>"; + }; + 5471DCFA1FBF99B100656CD3 /* core */ = { + isa = PBXGroup; + children = ( + 5471DCFB1FBF99B800656CD3 /* util */, + ); + name = core; + sourceTree = "<group>"; + }; + 5471DCFB1FBF99B800656CD3 /* util */ = { + isa = PBXGroup; + children = ( + 5471DCF71FBF99A300656CD3 /* autoid_test.cc */, + ); + name = util; + sourceTree = "<group>"; + }; 54764FAC1FAA0C390085E60A /* GoogleTests */ = { isa = PBXGroup; children = ( - 54764FAE1FAA21B90085E60A /* FSTGoogleTestTests.mm */, + 5471DCFA1FBF99B100656CD3 /* core */, 54764FAD1FAA0C650085E60A /* Port */, + 5463926F1FBEDE2F005031AA /* support */, + 54764FAE1FAA21B90085E60A /* FSTGoogleTestTests.mm */, ); name = GoogleTests; sourceTree = "<group>"; @@ -584,7 +612,6 @@ DE51B1871F0D48AC0013853F /* FSTComparisonTests.m */, DE51B1881F0D48AC0013853F /* FSTHelpers.h */, DE51B1891F0D48AC0013853F /* FSTHelpers.m */, - DE51B18A1F0D48AC0013853F /* FSTUtilTests.m */, 54E9282A1F339CAD00C1953E /* XCTestCase+Await.h */, 54E9282B1F339CAD00C1953E /* XCTestCase+Await.m */, D5B259DAA9149B80D6245B57 /* FSTTestDispatchQueue.h */, @@ -903,8 +930,6 @@ inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-SwiftBuildTest/Pods-SwiftBuildTest-frameworks.sh", "${BUILT_PRODUCTS_DIR}/BoringSSL/openssl.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCommunity-Auth-Core-Root/FirebaseCommunity.framework", - "${BUILT_PRODUCTS_DIR}/Firestore/Firestore.framework", "${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework", "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac-f0850809/GoogleToolboxForMac.framework", "${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework", @@ -918,8 +943,6 @@ name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCommunity.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Firestore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", @@ -943,8 +966,6 @@ inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-Firestore_Example/Pods-Firestore_Example-frameworks.sh", "${BUILT_PRODUCTS_DIR}/BoringSSL/openssl.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCommunity-Auth-Core-Root/FirebaseCommunity.framework", - "${BUILT_PRODUCTS_DIR}/Firestore/Firestore.framework", "${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework", "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac-f0850809/GoogleToolboxForMac.framework", "${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework", @@ -958,8 +979,6 @@ name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCommunity.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Firestore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", @@ -1033,7 +1052,6 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-Firestore_Tests/Pods-Firestore_Tests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/FirebaseCommunity-Core-Root/FirebaseCommunity.framework", "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac-Defines-NSData+zlib/GoogleToolboxForMac.framework", "${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework", "${BUILT_PRODUCTS_DIR}/GoogleTest/GoogleTest.framework", @@ -1041,7 +1059,6 @@ ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCommunity.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/leveldb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleTest.framework", @@ -1077,13 +1094,11 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-Firestore_IntegrationTests/Pods-Firestore_IntegrationTests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/FirebaseCommunity-Core-Root/FirebaseCommunity.framework", "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac-Defines-NSData+zlib/GoogleToolboxForMac.framework", "${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCommunity.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OCMock.framework", ); @@ -1164,11 +1179,11 @@ DE51B1E11F0D490D0013853F /* FSTMemoryRemoteDocumentCacheTests.m in Sources */, DE51B1FF1F0D493A0013853F /* FSTAssertTests.m in Sources */, DE51B1D31F0D48CD0013853F /* FSTViewSnapshotTest.m in Sources */, - DE51B2021F0D493E0013853F /* FSTUtilTests.m in Sources */, DE51B1F91F0D491F0013853F /* FSTWatchChangeTests.m in Sources */, DE51B1F81F0D491F0013853F /* FSTWatchChange+Testing.m in Sources */, DE51B1EB1F0D490D0013853F /* FSTWriteGroupTests.mm in Sources */, DE51B2011F0D493E0013853F /* FSTHelpers.m in Sources */, + 5471DCF91FBF99AC00656CD3 /* autoid_test.cc in Sources */, DE51B1F61F0D491B0013853F /* FSTSerializerBetaTests.m in Sources */, DE51B1F01F0D49140013853F /* FSTFieldValueTests.m in Sources */, 5491BC721FB44593008B3588 /* FSTIntegrationTestCase.mm in Sources */, @@ -1204,6 +1219,7 @@ DE51B1D91F0D490D0013853F /* FSTEagerGarbageCollectorTests.m in Sources */, DE51B1E21F0D490D0013853F /* FSTMutationQueueTests.m in Sources */, DE51B1E81F0D490D0013853F /* FSTLevelDBKeyTests.mm in Sources */, + 5463926E1FBEDE28005031AA /* secure_random_test.cc in Sources */, DE51B1E31F0D490D0013853F /* FSTPersistenceTestHelpers.m in Sources */, DE51B1CF1F0D48CD0013853F /* FSTQueryListenerTests.m in Sources */, DE51B1DA1F0D490D0013853F /* FSTLevelDBLocalStoreTests.m in Sources */, @@ -1343,6 +1359,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1376,6 +1393,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 8.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1443,19 +1461,8 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "\"${PODS_ROOT}/../../Source\"", - "\"${PODS_ROOT}/../../Source/API\"", - "\"${PODS_ROOT}/../../Source/Core\"", - "\"${PODS_ROOT}/../../Source/Remote\"", - "\"${PODS_ROOT}/../../Source/Model\"", - "\"${PODS_ROOT}/../../third_party\"", - "\"${PODS_ROOT}/../../third_party/Immutable\"", - "\"${PODS_ROOT}/../../\"", - "\"${PODS_ROOT}/../../Protos/objc/firestore/local\"", - "\"${PODS_ROOT}/../../Protos/objc/google/firestore/v1beta1\"", - "\"${PODS_ROOT}/../../Protos/objc/google/api\"", - "\"${PODS_ROOT}/../../Protos/objc/google/rpc\"", - "\"${PODS_ROOT}/../../Protos/objc/google/type\"", + "\"${PODS_ROOT}/../../..\"", + "\"${PODS_ROOT}/leveldb-library/include\"", ); INFOPLIST_FILE = "Tests/Tests-Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; @@ -1485,19 +1492,8 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "\"${PODS_ROOT}/../../Source\"", - "\"${PODS_ROOT}/../../Source/API\"", - "\"${PODS_ROOT}/../../Source/Core\"", - "\"${PODS_ROOT}/../../Source/Remote\"", - "\"${PODS_ROOT}/../../Source/Model\"", - "\"${PODS_ROOT}/../../third_party\"", - "\"${PODS_ROOT}/../../third_party/Immutable\"", - "\"${PODS_ROOT}/../../Protos/objc/firebase/datastore/clients/proto\"", - "\"${PODS_ROOT}/../../Protos/objc/google/firestore/v1beta1\"", - "\"${PODS_ROOT}/../../Protos/objc/google/api\"", - "\"${PODS_ROOT}/../../Protos/objc/google/rpc\"", - "\"${PODS_ROOT}/../../Protos/objc/google/type\"", - "\"${PODS_ROOT}/../../\"", + "\"${PODS_ROOT}/../../..\"", + "\"${PODS_ROOT}/leveldb-library/include\"", ); INFOPLIST_FILE = "Tests/Tests-Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; @@ -1527,19 +1523,7 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "\"${PODS_ROOT}/../../Source\"", - "\"${PODS_ROOT}/../../Source/API\"", - "\"${PODS_ROOT}/../../Source/Core\"", - "\"${PODS_ROOT}/../../Source/Remote\"", - "\"${PODS_ROOT}/../../Source/Model\"", - "\"${PODS_ROOT}/../../third_party\"", - "\"${PODS_ROOT}/../../third_party/Immutable\"", - "\"${PODS_ROOT}/../../Protos/objc/firestore/local\"", - "\"${PODS_ROOT}/../../Protos/objc/google/firestore/v1beta1\"", - "\"${PODS_ROOT}/../../Protos/objc/google/api\"", - "\"${PODS_ROOT}/../../Protos/objc/google/rpc\"", - "\"${PODS_ROOT}/../../Protos/objc/google/type\"", - "\"${PODS_ROOT}/../../\"", + "\"${PODS_ROOT}/../../..\"", ); INFOPLIST_FILE = "Tests/Tests-Info.plist"; OTHER_LDFLAGS = ( @@ -1577,19 +1561,7 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "\"${PODS_ROOT}/../../Source\"", - "\"${PODS_ROOT}/../../Source/API\"", - "\"${PODS_ROOT}/../../Source/Core\"", - "\"${PODS_ROOT}/../../Source/Remote\"", - "\"${PODS_ROOT}/../../Source/Model\"", - "\"${PODS_ROOT}/../../third_party\"", - "\"${PODS_ROOT}/../../third_party/Immutable\"", - "\"${PODS_ROOT}/../../Protos/objc/firestore/local\"", - "\"${PODS_ROOT}/../../Protos/objc/google/firestore/v1beta1\"", - "\"${PODS_ROOT}/../../Protos/objc/google/api\"", - "\"${PODS_ROOT}/../../Protos/objc/google/rpc\"", - "\"${PODS_ROOT}/../../Protos/objc/google/type\"", - "\"${PODS_ROOT}/../../\"", + "\"${PODS_ROOT}/../../..\"", ); INFOPLIST_FILE = "Tests/Tests-Info.plist"; OTHER_LDFLAGS = ( diff --git a/Firestore/Example/Podfile b/Firestore/Example/Podfile index c5cf06a..923ab22 100644 --- a/Firestore/Example/Podfile +++ b/Firestore/Example/Podfile @@ -1,14 +1,20 @@ +# The next line is the forcing function for the Firebase pod. The Firebase +# version's subspecs should depend on the component versions in their +# corresponding podspec's. +pod 'Firebase/Core', '4.6.0' + use_frameworks! platform :ios, '8.0' target 'Firestore_Example' do - pod 'FirebaseCommunity/Core', :path => '../../' - pod 'Firestore', :path => '../' + pod 'FirebaseAuth', :path => '../../' + pod 'FirebaseCore', :path => '../../' + pod 'FirebaseFirestore', :path => '../../' target 'Firestore_Tests' do inherit! :search_paths - pod 'FirebaseCommunity/Core', :path => '../../' + pod 'FirebaseCore', :path => '../../' pod 'leveldb-library' pod 'OCMock' @@ -18,12 +24,12 @@ target 'Firestore_Example' do target 'Firestore_IntegrationTests' do inherit! :search_paths - pod 'FirebaseCommunity/Core', :path => '../../' + pod 'FirebaseCore', :path => '../../' pod 'OCMock' end end target 'SwiftBuildTest' do - pod 'Firestore', :path => '../' + pod 'FirebaseFirestore', :path => '../../' end diff --git a/Firestore/Example/SwiftBuildTest/main.swift b/Firestore/Example/SwiftBuildTest/main.swift index 8cc0302..bea8b56 100644 --- a/Firestore/Example/SwiftBuildTest/main.swift +++ b/Firestore/Example/SwiftBuildTest/main.swift @@ -16,7 +16,7 @@ import Foundation -import Firestore +import FirebaseFirestore func main() { let db = initializeDb(); diff --git a/Firestore/Example/Tests/API/FIRGeoPointTests.m b/Firestore/Example/Tests/API/FIRGeoPointTests.m index ca7d24c..b505de0 100644 --- a/Firestore/Example/Tests/API/FIRGeoPointTests.m +++ b/Firestore/Example/Tests/API/FIRGeoPointTests.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "Firestore/FIRGeoPoint.h" +#import "FirebaseFirestore/FIRGeoPoint.h" #import <XCTest/XCTest.h> -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Core/FSTDatabaseInfoTests.m b/Firestore/Example/Tests/Core/FSTDatabaseInfoTests.m index 931a59f..c7cf22a 100644 --- a/Firestore/Example/Tests/Core/FSTDatabaseInfoTests.m +++ b/Firestore/Example/Tests/Core/FSTDatabaseInfoTests.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" #import <XCTest/XCTest.h> -#import "Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Core/FSTEventManagerTests.m b/Firestore/Example/Tests/Core/FSTEventManagerTests.m index 85afe58..99021ce 100644 --- a/Firestore/Example/Tests/Core/FSTEventManagerTests.m +++ b/Firestore/Example/Tests/Core/FSTEventManagerTests.m @@ -14,17 +14,17 @@ * limitations under the License. */ -#import "Core/FSTEventManager.h" +#import "Firestore/Source/Core/FSTEventManager.h" #import <OCMock/OCMock.h> #import <XCTest/XCTest.h> -#import "Core/FSTQuery.h" -#import "Core/FSTSyncEngine.h" -#import "Model/FSTDocumentSet.h" -#import "Util/FSTDispatchQueue.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSyncEngine.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Core/FSTQueryListenerTests.m b/Firestore/Example/Tests/Core/FSTQueryListenerTests.m index 155eb00..1bb7a47 100644 --- a/Firestore/Example/Tests/Core/FSTQueryListenerTests.m +++ b/Firestore/Example/Tests/Core/FSTQueryListenerTests.m @@ -14,19 +14,19 @@ * limitations under the License. */ -#import "Core/FSTEventManager.h" +#import "Firestore/Source/Core/FSTEventManager.h" #import <XCTest/XCTest.h> -#import "Core/FSTQuery.h" -#import "Core/FSTView.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentSet.h" -#import "Remote/FSTRemoteEvent.h" -#import "Util/FSTAsyncQueryListener.h" -#import "Util/FSTDispatchQueue.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTView.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Util/FSTAsyncQueryListener.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Core/FSTQueryTests.m b/Firestore/Example/Tests/Core/FSTQueryTests.m index 051f10d..1fd0e8b 100644 --- a/Firestore/Example/Tests/Core/FSTQueryTests.m +++ b/Firestore/Example/Tests/Core/FSTQueryTests.m @@ -14,17 +14,17 @@ * limitations under the License. */ -#import "Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTQuery.h" #import <XCTest/XCTest.h> -#import "API/FIRFirestore+Internal.h" -#import "Model/FSTDatabaseID.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTPath.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTPath.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Core/FSTSyncEngine+Testing.h b/Firestore/Example/Tests/Core/FSTSyncEngine+Testing.h index ff98e74..ab0697b 100644 --- a/Firestore/Example/Tests/Core/FSTSyncEngine+Testing.h +++ b/Firestore/Example/Tests/Core/FSTSyncEngine+Testing.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "Core/FSTSyncEngine.h" +#import "Firestore/Source/Core/FSTSyncEngine.h" @class FSTDocumentKey; diff --git a/Firestore/Example/Tests/Core/FSTTargetIDGeneratorTests.m b/Firestore/Example/Tests/Core/FSTTargetIDGeneratorTests.m index 11a7f46..6f54fd1 100644 --- a/Firestore/Example/Tests/Core/FSTTargetIDGeneratorTests.m +++ b/Firestore/Example/Tests/Core/FSTTargetIDGeneratorTests.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Core/FSTTargetIDGenerator.h" +#import "Firestore/Source/Core/FSTTargetIDGenerator.h" #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Core/FSTTimestampTests.m b/Firestore/Example/Tests/Core/FSTTimestampTests.m index 8538078..a3765fe 100644 --- a/Firestore/Example/Tests/Core/FSTTimestampTests.m +++ b/Firestore/Example/Tests/Core/FSTTimestampTests.m @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "Core/FSTTimestamp.h" +#import "Firestore/Source/Core/FSTTimestamp.h" #import <XCTest/XCTest.h> -#import "Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTAssert.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Core/FSTViewSnapshotTest.m b/Firestore/Example/Tests/Core/FSTViewSnapshotTest.m index 202fae8..5d3787a 100644 --- a/Firestore/Example/Tests/Core/FSTViewSnapshotTest.m +++ b/Firestore/Example/Tests/Core/FSTViewSnapshotTest.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "Core/FSTViewSnapshot.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" #import <XCTest/XCTest.h> -#import "Core/FSTQuery.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentSet.h" -#import "Model/FSTPath.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTPath.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Core/FSTViewTests.m b/Firestore/Example/Tests/Core/FSTViewTests.m index d939d62..e6c4510 100644 --- a/Firestore/Example/Tests/Core/FSTViewTests.m +++ b/Firestore/Example/Tests/Core/FSTViewTests.m @@ -14,21 +14,21 @@ * limitations under the License. */ -#import "Core/FSTView.h" +#import "Firestore/Source/Core/FSTView.h" #import <XCTest/XCTest.h> -#import "API/FIRFirestore+Internal.h" -#import "Core/FSTQuery.h" -#import "Core/FSTViewSnapshot.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTDocumentSet.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTPath.h" -#import "Remote/FSTRemoteEvent.h" - -#import "FSTHelpers.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" + +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/GoogleTest/FSTGoogleTestTests.mm b/Firestore/Example/Tests/GoogleTest/FSTGoogleTestTests.mm index 731e698..4fc77ed 100644 --- a/Firestore/Example/Tests/GoogleTest/FSTGoogleTestTests.mm +++ b/Firestore/Example/Tests/GoogleTest/FSTGoogleTestTests.mm @@ -17,7 +17,7 @@ #import <XCTest/XCTest.h> #import <objc/runtime.h> -#include "Util/FSTAssert.h" +#include "Firestore/Source/Util/FSTAssert.h" #include "gtest/gtest.h" /** @@ -262,32 +262,10 @@ XCTestSuite *CreateAllTestsTestSuite() { } /** - * A pseudo-constructor that dynamically generates all the XCTestCase subclasses. - * - * For background, the Objective-C runtime and XCTest initialize things in the following order: - * - * 1. Objective-C calls +load on every class in the bundle. - * 2. C++ constructors are called. - * 3. Any NSPrincipalClass in the test bundle's Info.plist is instantiated. - * 4. Objective-C calls +initialize on every class that's referenced, lazily. - * 5. XCTest calls +defaultTestSuite on every class that's a subclass of XCTestCase that matches - * its notion of which tests to run. - * - * All stages only run on all XCTestCase classes if the user runs all tests. Otherwise: - * * When a user is focusing on a test case XCTest only calls +defaultTestSuite (and triggers - * +initialize) on that specific test. - * * When a user is focusing on a test method XCTest does not call +defaultTestSuite at all - * (+initialize still runs). - * - * This means that +initialize or +defaultTestSuite on some fixed class like GoogleTests can't be - * used to bootstrap the generated classes because these steps can be skipped if the user focuses - * on the wrong thing. NSPrincipalClass would work, but requires frobbing the Info.plist, which is - * a manual step in project configuration which is error prone. - * - * Meanwhile even though __attribute__((constructor)) is a GCC and Clang extension those are the - * only compilers we care about for Objective-C so it's not that bad. + * Finds and runs googletest-based tests based on the XCTestConfiguration of the current test + * invocation. */ -__attribute__((constructor)) void RegisterGoogleTestTests() { +void RunGoogleTestTests() { NSString *masterTestCaseName = NSStringFromClass([GoogleTests class]); // Initialize GoogleTest but don't run the tests yet. @@ -303,9 +281,11 @@ __attribute__((constructor)) void RegisterGoogleTestTests() { NSSet<NSString *> *testsToRun = LoadXCTestConfigurationTestsToRun(); if (testsToRun) { if ([allTests isEqual:testsToRun]) { + NSLog(@"Forcing all tests to run"); forceAllTests = YES; } else { NSString *filters = CreateTestFiltersFromTestsToRun(testsToRun); + NSLog(@"Using --gtest_filter=%@", filters); if (filters) { testing::GTEST_FLAG(filter) = [filters UTF8String]; } @@ -356,3 +336,23 @@ __attribute__((constructor)) void RegisterGoogleTestTests() { } @end + +/** + * This class is registered as the NSPrincipalClass in the Firestore_Tests bundle's Info.plist. + * XCTest instantiates this class to perform one-time setup for the test bundle, as documented + * here: + * + * https://developer.apple.com/documentation/xctest/xctestobservationcenter + */ +@interface FSTGoogleTestsPrincipal : NSObject +@end + +@implementation FSTGoogleTestsPrincipal + +- (instancetype)init { + self = [super init]; + RunGoogleTestTests(); + return self; +} + +@end diff --git a/Firestore/Example/Tests/Integration/API/FIRCursorTests.m b/Firestore/Example/Tests/Integration/API/FIRCursorTests.m index 2f8babd..dc9da83 100644 --- a/Firestore/Example/Tests/Integration/API/FIRCursorTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRCursorTests.m @@ -14,11 +14,11 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FIRCursorTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m b/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m index 6a6e49a..087eb01 100644 --- a/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m @@ -14,13 +14,13 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "Core/FSTFirestoreClient.h" -#import "FIRFirestore+Internal.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" @interface FIRDatabaseTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/API/FIRFieldsTests.m b/Firestore/Example/Tests/Integration/API/FIRFieldsTests.m index d851556..b647f52 100644 --- a/Firestore/Example/Tests/Integration/API/FIRFieldsTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRFieldsTests.m @@ -14,13 +14,13 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "Core/FSTFirestoreClient.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FIRFieldsTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/API/FIRListenerRegistrationTests.m b/Firestore/Example/Tests/Integration/API/FIRListenerRegistrationTests.m index 5824314..9751844 100644 --- a/Firestore/Example/Tests/Integration/API/FIRListenerRegistrationTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRListenerRegistrationTests.m @@ -14,13 +14,13 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "Core/FSTFirestoreClient.h" -#import "FIRFirestore+Internal.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" @interface FIRListenerRegistrationTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/API/FIRQueryTests.m b/Firestore/Example/Tests/Integration/API/FIRQueryTests.m index f08df33..180b423 100644 --- a/Firestore/Example/Tests/Integration/API/FIRQueryTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRQueryTests.m @@ -14,13 +14,13 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "Core/FSTFirestoreClient.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FIRQueryTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m index 1d77e16..2ee3966 100644 --- a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m @@ -14,14 +14,14 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "Core/FSTFirestoreClient.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" -#import "FSTEventAccumulator.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTEventAccumulator.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FIRServerTimestampTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/API/FIRTypeTests.m b/Firestore/Example/Tests/Integration/API/FIRTypeTests.m index 4e2c76e..638835f 100644 --- a/Firestore/Example/Tests/Integration/API/FIRTypeTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRTypeTests.m @@ -14,11 +14,11 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FIRTypeTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/API/FIRValidationTests.m b/Firestore/Example/Tests/Integration/API/FIRValidationTests.m index 7fa4c3e..a318c47 100644 --- a/Firestore/Example/Tests/Integration/API/FIRValidationTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRValidationTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "FSTHelpers.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" // We have tests for passing nil when nil is not supposed to be allowed. So suppress the warnings. #pragma clang diagnostic ignored "-Wnonnull" diff --git a/Firestore/Example/Tests/Integration/API/FIRWriteBatchTests.m b/Firestore/Example/Tests/Integration/API/FIRWriteBatchTests.m index 159cbd7..562c29f 100644 --- a/Firestore/Example/Tests/Integration/API/FIRWriteBatchTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRWriteBatchTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "FSTEventAccumulator.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTEventAccumulator.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FIRWriteBatchTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/FSTDatastoreTests.m b/Firestore/Example/Tests/Integration/FSTDatastoreTests.m index 54ab66b..047f059 100644 --- a/Firestore/Example/Tests/Integration/FSTDatastoreTests.m +++ b/Firestore/Example/Tests/Integration/FSTDatastoreTests.m @@ -14,35 +14,34 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <GRPCClient/GRPCCall+ChannelCredentials.h> #import <GRPCClient/GRPCCall+Tests.h> #import <XCTest/XCTest.h> -#import "API/FIRDocumentReference+Internal.h" -#import "API/FSTUserDataConverter.h" -#import "Auth/FSTEmptyCredentialsProvider.h" -#import "Core/FSTDatabaseInfo.h" -#import "Core/FSTFirestoreClient.h" -#import "Core/FSTQuery.h" -#import "Core/FSTSnapshotVersion.h" -#import "Core/FSTTimestamp.h" -#import "Local/FSTQueryData.h" -#import "Model/FSTDatabaseID.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTMutation.h" -#import "Model/FSTMutationBatch.h" -#import "Model/FSTPath.h" -#import "Remote/FSTDatastore.h" -#import "Remote/FSTRemoteEvent.h" -#import "Remote/FSTRemoteStore.h" -#import "Util/FSTAssert.h" -#import "Util/FSTDispatchQueue.h" -#import "Util/FSTUtil.h" - -#import "FSTIntegrationTestCase.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Auth/FSTEmptyCredentialsProvider.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTDatastore.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Remote/FSTRemoteStore.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" + +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Integration/FSTSmokeTests.m b/Firestore/Example/Tests/Integration/FSTSmokeTests.m index e0ad06c..847474a 100644 --- a/Firestore/Example/Tests/Integration/FSTSmokeTests.m +++ b/Firestore/Example/Tests/Integration/FSTSmokeTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> -#import "FSTEventAccumulator.h" -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTEventAccumulator.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FSTSmokeTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Integration/FSTStreamTests.m b/Firestore/Example/Tests/Integration/FSTStreamTests.m index a9ee4d1..bbdf372 100644 --- a/Firestore/Example/Tests/Integration/FSTStreamTests.m +++ b/Firestore/Example/Tests/Integration/FSTStreamTests.m @@ -16,17 +16,17 @@ #import <XCTest/XCTest.h> -#import <Firestore/FIRFirestoreSettings.h> - -#import "Auth/FSTEmptyCredentialsProvider.h" -#import "Core/FSTDatabaseInfo.h" -#import "FSTHelpers.h" -#import "FSTIntegrationTestCase.h" -#import "FSTTestDispatchQueue.h" -#import "Model/FSTDatabaseID.h" -#import "Remote/FSTDatastore.h" -#import "Remote/FSTStream.h" -#import "Util/FSTAssert.h" +#import <FirebaseFirestore/FIRFirestoreSettings.h> + +#import "Firestore/Example/Tests/Util/FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTTestDispatchQueue.h" +#import "Firestore/Source/Auth/FSTEmptyCredentialsProvider.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Remote/FSTDatastore.h" +#import "Firestore/Source/Remote/FSTStream.h" +#import "Firestore/Source/Util/FSTAssert.h" /** Exposes otherwise private methods for testing. */ @interface FSTStream (Testing) diff --git a/Firestore/Example/Tests/Integration/FSTTransactionTests.m b/Firestore/Example/Tests/Integration/FSTTransactionTests.m index a0b5bbe..2e828c9 100644 --- a/Firestore/Example/Tests/Integration/FSTTransactionTests.m +++ b/Firestore/Example/Tests/Integration/FSTTransactionTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -@import Firestore; +@import FirebaseFirestore; #import <XCTest/XCTest.h> #include <libkern/OSAtomic.h> -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @interface FSTTransactionTests : FSTIntegrationTestCase @end diff --git a/Firestore/Example/Tests/Local/FSTEagerGarbageCollectorTests.m b/Firestore/Example/Tests/Local/FSTEagerGarbageCollectorTests.m index 34c0685..1dd6d62 100644 --- a/Firestore/Example/Tests/Local/FSTEagerGarbageCollectorTests.m +++ b/Firestore/Example/Tests/Local/FSTEagerGarbageCollectorTests.m @@ -14,14 +14,14 @@ * limitations under the License. */ -#import "Local/FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" #import <XCTest/XCTest.h> -#import "Local/FSTReferenceSet.h" -#import "Model/FSTDocumentKey.h" +#import "Firestore/Source/Local/FSTReferenceSet.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTLevelDBKeyTests.mm b/Firestore/Example/Tests/Local/FSTLevelDBKeyTests.mm index 3374fcf..998d23d 100644 --- a/Firestore/Example/Tests/Local/FSTLevelDBKeyTests.mm +++ b/Firestore/Example/Tests/Local/FSTLevelDBKeyTests.mm @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "Local/FSTLevelDBKey.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" #import <XCTest/XCTest.h> -#import "Model/FSTPath.h" +#import "Firestore/Source/Model/FSTPath.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTLevelDBLocalStoreTests.m b/Firestore/Example/Tests/Local/FSTLevelDBLocalStoreTests.m index d426149..f71f5c9 100644 --- a/Firestore/Example/Tests/Local/FSTLevelDBLocalStoreTests.m +++ b/Firestore/Example/Tests/Local/FSTLevelDBLocalStoreTests.m @@ -14,15 +14,15 @@ * limitations under the License. */ -#import "Local/FSTLocalStore.h" +#import "Firestore/Source/Local/FSTLocalStore.h" #import <XCTest/XCTest.h> -#import "Auth/FSTUser.h" -#import "Local/FSTLevelDB.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Local/FSTLevelDB.h" -#import "FSTLocalStoreTests.h" -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTLocalStoreTests.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTLevelDBMutationQueueTests.mm b/Firestore/Example/Tests/Local/FSTLevelDBMutationQueueTests.mm index ea6a895..6c26fd9 100644 --- a/Firestore/Example/Tests/Local/FSTLevelDBMutationQueueTests.mm +++ b/Firestore/Example/Tests/Local/FSTLevelDBMutationQueueTests.mm @@ -14,20 +14,20 @@ * limitations under the License. */ -#import "Local/FSTLevelDBMutationQueue.h" +#import "Firestore/Source/Local/FSTLevelDBMutationQueue.h" #import <XCTest/XCTest.h> #include <leveldb/db.h> -#import "Auth/FSTUser.h" -#import "Local/FSTLevelDB.h" -#import "Local/FSTLevelDBKey.h" -#import "Local/FSTWriteGroup.h" -#include "Port/ordered_code.h" -#import "Protos/objc/firestore/local/Mutation.pbobjc.h" +#include "Firestore/Port/ordered_code.h" +#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" -#import "FSTMutationQueueTests.h" -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTMutationQueueTests.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTLevelDBQueryCacheTests.m b/Firestore/Example/Tests/Local/FSTLevelDBQueryCacheTests.m index 8149397..929ab9e 100644 --- a/Firestore/Example/Tests/Local/FSTLevelDBQueryCacheTests.m +++ b/Firestore/Example/Tests/Local/FSTLevelDBQueryCacheTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "Local/FSTLevelDBQueryCache.h" +#import "Firestore/Source/Local/FSTLevelDBQueryCache.h" -#import "Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLevelDB.h" -#import "FSTPersistenceTestHelpers.h" -#import "FSTQueryCacheTests.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTQueryCacheTests.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTLevelDBRemoteDocumentCacheTests.mm b/Firestore/Example/Tests/Local/FSTLevelDBRemoteDocumentCacheTests.mm index a6af103..1f84aa6 100644 --- a/Firestore/Example/Tests/Local/FSTLevelDBRemoteDocumentCacheTests.mm +++ b/Firestore/Example/Tests/Local/FSTLevelDBRemoteDocumentCacheTests.mm @@ -14,15 +14,15 @@ * limitations under the License. */ -#import "FSTRemoteDocumentCacheTests.h" +#import "Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.h" #include <leveldb/db.h> -#import "Local/FSTLevelDB.h" -#import "Local/FSTLevelDBKey.h" -#include "Port/ordered_code.h" +#include "Firestore/Port/ordered_code.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTLocalSerializerTests.m b/Firestore/Example/Tests/Local/FSTLocalSerializerTests.m index 0080f89..90f9ca3 100644 --- a/Firestore/Example/Tests/Local/FSTLocalSerializerTests.m +++ b/Firestore/Example/Tests/Local/FSTLocalSerializerTests.m @@ -14,33 +14,33 @@ * limitations under the License. */ -#import "Local/FSTLocalSerializer.h" +#import "Firestore/Source/Local/FSTLocalSerializer.h" #import <XCTest/XCTest.h> -#import "Core/FSTQuery.h" -#import "Core/FSTSnapshotVersion.h" -#import "Core/FSTTimestamp.h" -#import "Local/FSTQueryData.h" -#import "Model/FSTDatabaseID.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTMutation.h" -#import "Model/FSTMutationBatch.h" -#import "Model/FSTPath.h" -#import "Protos/objc/firestore/local/MaybeDocument.pbobjc.h" -#import "Protos/objc/firestore/local/Mutation.pbobjc.h" -#import "Protos/objc/firestore/local/Target.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Common.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Document.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Query.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Write.pbobjc.h" -#import "Protos/objc/google/type/Latlng.pbobjc.h" -#import "Remote/FSTSerializerBeta.h" - -#import "FSTHelpers.h" +#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h" +#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" +#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h" +#import "Firestore/Protos/objc/google/type/Latlng.pbobjc.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" + +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTLocalStoreTests.m b/Firestore/Example/Tests/Local/FSTLocalStoreTests.m index ab492a7..245e1c4 100644 --- a/Firestore/Example/Tests/Local/FSTLocalStoreTests.m +++ b/Firestore/Example/Tests/Local/FSTLocalStoreTests.m @@ -14,33 +14,33 @@ * limitations under the License. */ -#import "Local/FSTLocalStore.h" +#import "Firestore/Source/Local/FSTLocalStore.h" #import <XCTest/XCTest.h> -#import "Auth/FSTUser.h" -#import "Core/FSTQuery.h" -#import "Core/FSTTimestamp.h" -#import "Local/FSTEagerGarbageCollector.h" -#import "Local/FSTLocalWriteResult.h" -#import "Local/FSTNoOpGarbageCollector.h" -#import "Local/FSTPersistence.h" -#import "Local/FSTQueryData.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTDocumentSet.h" -#import "Model/FSTMutation.h" -#import "Model/FSTMutationBatch.h" -#import "Model/FSTPath.h" -#import "Remote/FSTRemoteEvent.h" -#import "Remote/FSTWatchChange.h" -#import "Util/FSTClasses.h" - -#import "FSTHelpers.h" -#import "FSTImmutableSortedDictionary+Testing.h" -#import "FSTImmutableSortedSet+Testing.h" -#import "FSTLocalStoreTests.h" -#import "FSTWatchChange+Testing.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTLocalWriteResult.h" +#import "Firestore/Source/Local/FSTNoOpGarbageCollector.h" +#import "Firestore/Source/Local/FSTPersistence.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" +#import "Firestore/Source/Util/FSTClasses.h" + +#import "Firestore/Example/Tests/Local/FSTLocalStoreTests.h" +#import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" +#import "Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.h" +#import "Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTMemoryLocalStoreTests.m b/Firestore/Example/Tests/Local/FSTMemoryLocalStoreTests.m index e7486d0..b78239e 100644 --- a/Firestore/Example/Tests/Local/FSTMemoryLocalStoreTests.m +++ b/Firestore/Example/Tests/Local/FSTMemoryLocalStoreTests.m @@ -14,14 +14,14 @@ * limitations under the License. */ -#import "Local/FSTLocalStore.h" +#import "Firestore/Source/Local/FSTLocalStore.h" #import <XCTest/XCTest.h> -#import "Local/FSTMemoryPersistence.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" -#import "FSTLocalStoreTests.h" -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTLocalStoreTests.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTMemoryMutationQueueTests.m b/Firestore/Example/Tests/Local/FSTMemoryMutationQueueTests.m index 4d76393..ab7afee 100644 --- a/Firestore/Example/Tests/Local/FSTMemoryMutationQueueTests.m +++ b/Firestore/Example/Tests/Local/FSTMemoryMutationQueueTests.m @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "Local/FSTMemoryMutationQueue.h" +#import "Firestore/Source/Local/FSTMemoryMutationQueue.h" -#import "Auth/FSTUser.h" -#import "Local/FSTMemoryPersistence.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" -#import "FSTMutationQueueTests.h" -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTMutationQueueTests.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" @interface FSTMemoryMutationQueueTests : FSTMutationQueueTests @end diff --git a/Firestore/Example/Tests/Local/FSTMemoryQueryCacheTests.m b/Firestore/Example/Tests/Local/FSTMemoryQueryCacheTests.m index 6574647..fb7df6b 100644 --- a/Firestore/Example/Tests/Local/FSTMemoryQueryCacheTests.m +++ b/Firestore/Example/Tests/Local/FSTMemoryQueryCacheTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "Local/FSTMemoryQueryCache.h" +#import "Firestore/Source/Local/FSTMemoryQueryCache.h" -#import "Local/FSTMemoryPersistence.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" -#import "FSTPersistenceTestHelpers.h" -#import "FSTQueryCacheTests.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTQueryCacheTests.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTMemoryRemoteDocumentCacheTests.m b/Firestore/Example/Tests/Local/FSTMemoryRemoteDocumentCacheTests.m index 7602134..162eef0 100644 --- a/Firestore/Example/Tests/Local/FSTMemoryRemoteDocumentCacheTests.m +++ b/Firestore/Example/Tests/Local/FSTMemoryRemoteDocumentCacheTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "Local/FSTMemoryRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTMemoryRemoteDocumentCache.h" -#import "Local/FSTMemoryPersistence.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" -#import "FSTPersistenceTestHelpers.h" -#import "FSTRemoteDocumentCacheTests.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.h" @interface FSTMemoryRemoteDocumentCacheTests : FSTRemoteDocumentCacheTests @end diff --git a/Firestore/Example/Tests/Local/FSTMutationQueueTests.m b/Firestore/Example/Tests/Local/FSTMutationQueueTests.m index 42ba0b3..f168ac9 100644 --- a/Firestore/Example/Tests/Local/FSTMutationQueueTests.m +++ b/Firestore/Example/Tests/Local/FSTMutationQueueTests.m @@ -14,19 +14,19 @@ * limitations under the License. */ -#import "FSTMutationQueueTests.h" - -#import "Auth/FSTUser.h" -#import "Core/FSTQuery.h" -#import "Core/FSTTimestamp.h" -#import "Local/FSTEagerGarbageCollector.h" -#import "Local/FSTMutationQueue.h" -#import "Local/FSTPersistence.h" -#import "Local/FSTWriteGroup.h" -#import "Model/FSTMutation.h" -#import "Model/FSTMutationBatch.h" - -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Local/FSTMutationQueueTests.h" + +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTMutationQueue.h" +#import "Firestore/Source/Local/FSTPersistence.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" + +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.m b/Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.m index f3d7914..c773b12 100644 --- a/Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.m +++ b/Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.m @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" -#import "Local/FSTLevelDB.h" -#import "Local/FSTLocalSerializer.h" -#import "Local/FSTMemoryPersistence.h" -#import "Model/FSTDatabaseID.h" -#import "Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLocalSerializer.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTQueryCacheTests.h b/Firestore/Example/Tests/Local/FSTQueryCacheTests.h index a615372..e2089af 100644 --- a/Firestore/Example/Tests/Local/FSTQueryCacheTests.h +++ b/Firestore/Example/Tests/Local/FSTQueryCacheTests.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Local/FSTQueryCache.h" +#import "Firestore/Source/Local/FSTQueryCache.h" #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Local/FSTQueryCacheTests.m b/Firestore/Example/Tests/Local/FSTQueryCacheTests.m index ed409b4..1fed440 100644 --- a/Firestore/Example/Tests/Local/FSTQueryCacheTests.m +++ b/Firestore/Example/Tests/Local/FSTQueryCacheTests.m @@ -14,18 +14,18 @@ * limitations under the License. */ -#import "FSTQueryCacheTests.h" - -#import "Core/FSTQuery.h" -#import "Core/FSTSnapshotVersion.h" -#import "Local/FSTEagerGarbageCollector.h" -#import "Local/FSTPersistence.h" -#import "Local/FSTQueryData.h" -#import "Local/FSTWriteGroup.h" -#import "Model/FSTDocumentKey.h" - -#import "FSTHelpers.h" -#import "FSTImmutableSortedSet+Testing.h" +#import "Firestore/Example/Tests/Local/FSTQueryCacheTests.h" + +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTPersistence.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" + +#import "Firestore/Example/Tests/Util/FSTHelpers.h" +#import "Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTReferenceSetTests.m b/Firestore/Example/Tests/Local/FSTReferenceSetTests.m index a8c783a..0b852a2 100644 --- a/Firestore/Example/Tests/Local/FSTReferenceSetTests.m +++ b/Firestore/Example/Tests/Local/FSTReferenceSetTests.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "Local/FSTReferenceSet.h" +#import "Firestore/Source/Local/FSTReferenceSet.h" #import <XCTest/XCTest.h> -#import "Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.h b/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.h index fa2a857..29e7b86 100644 --- a/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.h +++ b/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Local/FSTRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTRemoteDocumentCache.h" #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.m b/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.m index a875934..16fe3bf 100644 --- a/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.m +++ b/Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "FSTRemoteDocumentCacheTests.h" +#import "Firestore/Example/Tests/Local/FSTRemoteDocumentCacheTests.h" -#import "Core/FSTQuery.h" -#import "Local/FSTPersistence.h" -#import "Local/FSTWriteGroup.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTDocumentSet.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Local/FSTPersistence.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN @@ -105,6 +105,8 @@ static const int kVersion = 42; - (void)testDocumentsMatchingQuery { if (!self.remoteDocumentCache) return; + // TODO(rsgowman): This just verifies that we do a prefix scan against the + // query path. We'll need more tests once we add index support. [self setTestDocumentAtPath:@"a/1"]; [self setTestDocumentAtPath:@"b/1"]; [self setTestDocumentAtPath:@"b/2"]; @@ -114,12 +116,10 @@ static const int kVersion = 42; FSTDocumentDictionary *results = [self.remoteDocumentCache documentsMatchingQuery:query]; NSArray *expected = @[ FSTTestDoc(@"b/1", kVersion, _kDocData, NO), FSTTestDoc(@"b/2", kVersion, _kDocData, NO) ]; + XCTAssertEqual([results count], [expected count]); for (FSTDocument *doc in expected) { XCTAssertEqualObjects([results objectForKey:doc.key], doc); } - - // TODO(mikelehen): Perhaps guard against extra documents in the result set once our - // implementations are smarter. } #pragma mark - Helpers diff --git a/Firestore/Example/Tests/Local/FSTRemoteDocumentChangeBufferTests.m b/Firestore/Example/Tests/Local/FSTRemoteDocumentChangeBufferTests.m index ebf7713..1970779 100644 --- a/Firestore/Example/Tests/Local/FSTRemoteDocumentChangeBufferTests.m +++ b/Firestore/Example/Tests/Local/FSTRemoteDocumentChangeBufferTests.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "Local/FSTRemoteDocumentChangeBuffer.h" +#import "Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.h" #import <XCTest/XCTest.h> -#import "Local/FSTLevelDB.h" -#import "Local/FSTRemoteDocumentCache.h" -#import "Model/FSTDocument.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTRemoteDocumentCache.h" +#import "Firestore/Source/Model/FSTDocument.h" -#import "FSTHelpers.h" -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Local/FSTWriteGroupTests.mm b/Firestore/Example/Tests/Local/FSTWriteGroupTests.mm index b829ccf..edd05a3 100644 --- a/Firestore/Example/Tests/Local/FSTWriteGroupTests.mm +++ b/Firestore/Example/Tests/Local/FSTWriteGroupTests.mm @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "Local/FSTWriteGroup.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" #import <XCTest/XCTest.h> #include <leveldb/db.h> -#import "Local/FSTLevelDB.h" -#import "Local/FSTLevelDBKey.h" -#import "Protos/objc/firestore/local/Mutation.pbobjc.h" +#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" -#import "FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" using leveldb::ReadOptions; using leveldb::Status; diff --git a/Firestore/Example/Tests/Model/FSTDatabaseIDTests.m b/Firestore/Example/Tests/Model/FSTDatabaseIDTests.m index 9e7299f..cb1b19d 100644 --- a/Firestore/Example/Tests/Model/FSTDatabaseIDTests.m +++ b/Firestore/Example/Tests/Model/FSTDatabaseIDTests.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Model/FSTDocumentKeyTests.m b/Firestore/Example/Tests/Model/FSTDocumentKeyTests.m index ba68009..d66ee73 100644 --- a/Firestore/Example/Tests/Model/FSTDocumentKeyTests.m +++ b/Firestore/Example/Tests/Model/FSTDocumentKeyTests.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" #import <XCTest/XCTest.h> -#import "Model/FSTPath.h" +#import "Firestore/Source/Model/FSTPath.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Model/FSTDocumentSetTests.m b/Firestore/Example/Tests/Model/FSTDocumentSetTests.m index e473088..bf6cd21 100644 --- a/Firestore/Example/Tests/Model/FSTDocumentSetTests.m +++ b/Firestore/Example/Tests/Model/FSTDocumentSetTests.m @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" #import <XCTest/XCTest.h> -#import "Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocument.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Model/FSTDocumentTests.m b/Firestore/Example/Tests/Model/FSTDocumentTests.m index 9ceb0cd..e56ab34 100644 --- a/Firestore/Example/Tests/Model/FSTDocumentTests.m +++ b/Firestore/Example/Tests/Model/FSTDocumentTests.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocument.h" #import <XCTest/XCTest.h> -#import "Core/FSTSnapshotVersion.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTPath.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Model/FSTFieldValueTests.m b/Firestore/Example/Tests/Model/FSTFieldValueTests.m index a357e60..acf95f0 100644 --- a/Firestore/Example/Tests/Model/FSTFieldValueTests.m +++ b/Firestore/Example/Tests/Model/FSTFieldValueTests.m @@ -14,19 +14,19 @@ * limitations under the License. */ -#import "Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTFieldValue.h" #import <XCTest/XCTest.h> -#import "API/FIRFirestore+Internal.h" -#import "API/FSTUserDataConverter.h" -#import "Core/FSTTimestamp.h" -#import "Firestore/FIRGeoPoint.h" -#import "Model/FSTDatabaseID.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTPath.h" +#import "FirebaseFirestore/FIRGeoPoint.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" /** Helper to wrap the values in a set of equality groups using FSTTestFieldValue(). */ NSArray *FSTWrapGroups(NSArray *groups) { diff --git a/Firestore/Example/Tests/Model/FSTMutationTests.m b/Firestore/Example/Tests/Model/FSTMutationTests.m index 5ad9f94..678755e 100644 --- a/Firestore/Example/Tests/Model/FSTMutationTests.m +++ b/Firestore/Example/Tests/Model/FSTMutationTests.m @@ -14,17 +14,17 @@ * limitations under the License. */ -#import "Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutation.h" #import <XCTest/XCTest.h> -#import "Core/FSTTimestamp.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTPath.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" -#import "FSTHelpers.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" @interface FSTMutationTests : XCTestCase @end diff --git a/Firestore/Example/Tests/Model/FSTPathTests.m b/Firestore/Example/Tests/Model/FSTPathTests.m index a5d3d80..b8529e5 100644 --- a/Firestore/Example/Tests/Model/FSTPathTests.m +++ b/Firestore/Example/Tests/Model/FSTPathTests.m @@ -14,8 +14,8 @@ * limitations under the License. */ -#import "FSTHelpers.h" -#import "Model/FSTPath.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" +#import "Firestore/Source/Model/FSTPath.h" #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Remote/FSTDatastoreTests.m b/Firestore/Example/Tests/Remote/FSTDatastoreTests.m index 511de72..f3cc56f 100644 --- a/Firestore/Example/Tests/Remote/FSTDatastoreTests.m +++ b/Firestore/Example/Tests/Remote/FSTDatastoreTests.m @@ -14,8 +14,8 @@ * limitations under the License. */ -#import "Firestore/FIRFirestoreErrors.h" -#import "Remote/FSTDatastore.h" +#import "FirebaseFirestore/FIRFirestoreErrors.h" +#import "Firestore/Source/Remote/FSTDatastore.h" #import <GRPCClient/GRPCCall.h> #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Remote/FSTRemoteEventTests.m b/Firestore/Example/Tests/Remote/FSTRemoteEventTests.m index a172af7..a947eb4 100644 --- a/Firestore/Example/Tests/Remote/FSTRemoteEventTests.m +++ b/Firestore/Example/Tests/Remote/FSTRemoteEventTests.m @@ -14,18 +14,18 @@ * limitations under the License. */ -#import "Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" #import <XCTest/XCTest.h> -#import "Local/FSTQueryData.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Remote/FSTExistenceFilter.h" -#import "Remote/FSTWatchChange.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Remote/FSTExistenceFilter.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" -#import "FSTHelpers.h" -#import "FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m b/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m index c4cf9df..528076f 100644 --- a/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m +++ b/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m @@ -14,37 +14,37 @@ * limitations under the License. */ -#import "Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" #import <GRPCClient/GRPCCall.h> #import <XCTest/XCTest.h> -#import "Core/FSTQuery.h" -#import "Core/FSTSnapshotVersion.h" -#import "Core/FSTTimestamp.h" -#import "Firestore/FIRFieldPath.h" -#import "Firestore/FIRFirestoreErrors.h" -#import "Firestore/FIRGeoPoint.h" -#import "Local/FSTQueryData.h" -#import "Model/FSTDatabaseID.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTMutation.h" -#import "Model/FSTMutationBatch.h" -#import "Model/FSTPath.h" -#import "Protos/objc/firestore/local/MaybeDocument.pbobjc.h" -#import "Protos/objc/firestore/local/Mutation.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Common.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Document.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Query.pbobjc.h" -#import "Protos/objc/google/firestore/v1beta1/Write.pbobjc.h" -#import "Protos/objc/google/rpc/Status.pbobjc.h" -#import "Protos/objc/google/type/Latlng.pbobjc.h" -#import "Remote/FSTWatchChange.h" - -#import "FSTHelpers.h" +#import "FirebaseFirestore/FIRFieldPath.h" +#import "FirebaseFirestore/FIRFirestoreErrors.h" +#import "FirebaseFirestore/FIRGeoPoint.h" +#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h" +#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h" +#import "Firestore/Protos/objc/google/rpc/Status.pbobjc.h" +#import "Firestore/Protos/objc/google/type/Latlng.pbobjc.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" + +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h b/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h index f94fe05..73d8e34 100644 --- a/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h +++ b/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "Core/FSTTypes.h" -#import "Remote/FSTWatchChange.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.m b/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.m index cb5e479..6bb314d 100644 --- a/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.m +++ b/Firestore/Example/Tests/Remote/FSTWatchChange+Testing.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" -#import "Model/FSTDocument.h" -#import "Remote/FSTWatchChange.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Remote/FSTWatchChangeTests.m b/Firestore/Example/Tests/Remote/FSTWatchChangeTests.m index ccbd644..df2496b 100644 --- a/Firestore/Example/Tests/Remote/FSTWatchChangeTests.m +++ b/Firestore/Example/Tests/Remote/FSTWatchChangeTests.m @@ -14,15 +14,15 @@ * limitations under the License. */ -#import "Remote/FSTWatchChange.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" #import <XCTest/XCTest.h> -#import "Model/FSTDocument.h" -#import "Remote/FSTExistenceFilter.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Remote/FSTExistenceFilter.h" -#import "FSTHelpers.h" -#import "FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/SpecTests/FSTLevelDBSpecTests.m b/Firestore/Example/Tests/SpecTests/FSTLevelDBSpecTests.m index 88b3f12..a67f667 100644 --- a/Firestore/Example/Tests/SpecTests/FSTLevelDBSpecTests.m +++ b/Firestore/Example/Tests/SpecTests/FSTLevelDBSpecTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "FSTSpecTests.h" +#import "Firestore/Example/Tests/SpecTests/FSTSpecTests.h" -#import "Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLevelDB.h" -#import "FSTPersistenceTestHelpers.h" -#import "FSTSyncEngineTestDriver.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/SpecTests/FSTMemorySpecTests.m b/Firestore/Example/Tests/SpecTests/FSTMemorySpecTests.m index 9cf1f39..3030ab5 100644 --- a/Firestore/Example/Tests/SpecTests/FSTMemorySpecTests.m +++ b/Firestore/Example/Tests/SpecTests/FSTMemorySpecTests.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "FSTSpecTests.h" +#import "Firestore/Example/Tests/SpecTests/FSTSpecTests.h" -#import "Local/FSTMemoryPersistence.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" -#import "FSTPersistenceTestHelpers.h" -#import "FSTSyncEngineTestDriver.h" +#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h" +#import "Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.h b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.h index f091a53..5420c2e 100644 --- a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.h +++ b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.h @@ -16,18 +16,22 @@ #import <Foundation/Foundation.h> -#import "Remote/FSTDatastore.h" +#import "Firestore/Source/Remote/FSTDatastore.h" NS_ASSUME_NONNULL_BEGIN @interface FSTMockDatastore : FSTDatastore -/** A count of the total number of requests sent to the watch stream since the beginning of the test - * case. */ +/** + * A count of the total number of requests sent to the watch stream since the beginning of the test + * case. + */ @property(nonatomic) int watchStreamRequestCount; -/** A count of the total number of requests sent to the write stream since the beginning of the test - * case. */ +/** + * A count of the total number of requests sent to the write stream since the beginning of the test + * case. + */ @property(nonatomic) int writeStreamRequestCount; + (instancetype)mockDatastoreWithWorkerDispatchQueue:(FSTDispatchQueue *)workerDispatchQueue; diff --git a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.m b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.m index d3b196b..9a1d719 100644 --- a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.m +++ b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.m @@ -14,20 +14,20 @@ * limitations under the License. */ -#import "FSTMockDatastore.h" - -#import "Auth/FSTEmptyCredentialsProvider.h" -#import "Core/FSTDatabaseInfo.h" -#import "Core/FSTSnapshotVersion.h" -#import "Local/FSTQueryData.h" -#import "Model/FSTDatabaseID.h" -#import "Model/FSTMutation.h" -#import "Remote/FSTSerializerBeta.h" -#import "Remote/FSTStream.h" -#import "Util/FSTAssert.h" -#import "Util/FSTLogger.h" - -#import "FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/SpecTests/FSTMockDatastore.h" + +#import "Firestore/Source/Auth/FSTEmptyCredentialsProvider.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Remote/FSTStream.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTLogger.h" + +#import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" @class GRPCProtoCall; diff --git a/Firestore/Example/Tests/SpecTests/FSTSpecTests.m b/Firestore/Example/Tests/SpecTests/FSTSpecTests.m index 08ff6c7..2c1b8db 100644 --- a/Firestore/Example/Tests/SpecTests/FSTSpecTests.m +++ b/Firestore/Example/Tests/SpecTests/FSTSpecTests.m @@ -14,34 +14,34 @@ * limitations under the License. */ -#import "FSTSpecTests.h" +#import "Firestore/Example/Tests/SpecTests/FSTSpecTests.h" #import <GRPCClient/GRPCCall.h> -#import "Auth/FSTUser.h" -#import "Core/FSTEventManager.h" -#import "Core/FSTQuery.h" -#import "Core/FSTSnapshotVersion.h" -#import "Core/FSTViewSnapshot.h" -#import "Firestore/FIRFirestoreErrors.h" -#import "Local/FSTEagerGarbageCollector.h" -#import "Local/FSTNoOpGarbageCollector.h" -#import "Local/FSTPersistence.h" -#import "Local/FSTQueryData.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTMutation.h" -#import "Model/FSTPath.h" -#import "Remote/FSTExistenceFilter.h" -#import "Remote/FSTWatchChange.h" -#import "Util/FSTAssert.h" -#import "Util/FSTClasses.h" -#import "Util/FSTLogger.h" - -#import "FSTHelpers.h" -#import "FSTSyncEngineTestDriver.h" -#import "FSTWatchChange+Testing.h" +#import "FirebaseFirestore/FIRFirestoreErrors.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Core/FSTEventManager.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTNoOpGarbageCollector.h" +#import "Firestore/Source/Local/FSTPersistence.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTExistenceFilter.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/Source/Util/FSTLogger.h" + +#import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" +#import "Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h index e78ef92..3d031bd 100644 --- a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h +++ b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "Core/FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" @class FSTDocumentKey; @class FSTMutation; diff --git a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.m b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.m index a4678e3..896a292 100644 --- a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.m +++ b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.m @@ -14,27 +14,27 @@ * limitations under the License. */ -#import "FSTSyncEngineTestDriver.h" +#import "Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h" #import <GRPCClient/GRPCCall.h> -#import "Auth/FSTUser.h" -#import "Core/FSTEventManager.h" -#import "Core/FSTQuery.h" -#import "Core/FSTSnapshotVersion.h" -#import "Core/FSTSyncEngine.h" -#import "Firestore/FIRFirestoreErrors.h" -#import "Local/FSTLocalStore.h" -#import "Local/FSTPersistence.h" -#import "Model/FSTMutation.h" -#import "Remote/FSTDatastore.h" -#import "Remote/FSTWatchChange.h" -#import "Util/FSTAssert.h" -#import "Util/FSTDispatchQueue.h" -#import "Util/FSTLogger.h" - -#import "FSTMockDatastore.h" -#import "FSTSyncEngine+Testing.h" +#import "FirebaseFirestore/FIRFirestoreErrors.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Core/FSTEventManager.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTSyncEngine.h" +#import "Firestore/Source/Local/FSTLocalStore.h" +#import "Firestore/Source/Local/FSTPersistence.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Remote/FSTDatastore.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTLogger.h" + +#import "Firestore/Example/Tests/Core/FSTSyncEngine+Testing.h" +#import "Firestore/Example/Tests/SpecTests/FSTMockDatastore.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Tests-Info.plist b/Firestore/Example/Tests/Tests-Info.plist index 169b6f7..5b27204 100644 --- a/Firestore/Example/Tests/Tests-Info.plist +++ b/Firestore/Example/Tests/Tests-Info.plist @@ -16,6 +16,8 @@ <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> + <key>NSPrincipalClass</key> + <string>FSTGoogleTestsPrincipal</string> <key>CFBundleVersion</key> <string>1</string> </dict> diff --git a/Firestore/Example/Tests/Util/FSTAssertTests.m b/Firestore/Example/Tests/Util/FSTAssertTests.m index f0734df..0cba03f 100644 --- a/Firestore/Example/Tests/Util/FSTAssertTests.m +++ b/Firestore/Example/Tests/Util/FSTAssertTests.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTAssert.h" #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Util/FSTComparisonTests.m b/Firestore/Example/Tests/Util/FSTComparisonTests.m index 9728f20..5632e64 100644 --- a/Firestore/Example/Tests/Util/FSTComparisonTests.m +++ b/Firestore/Example/Tests/Util/FSTComparisonTests.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Util/FSTComparison.h" +#import "Firestore/Source/Util/FSTComparison.h" #import <XCTest/XCTest.h> diff --git a/Firestore/Example/Tests/Util/FSTEventAccumulator.m b/Firestore/Example/Tests/Util/FSTEventAccumulator.m index c7e5b41..b44ec67 100644 --- a/Firestore/Example/Tests/Util/FSTEventAccumulator.m +++ b/Firestore/Example/Tests/Util/FSTEventAccumulator.m @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "FSTEventAccumulator.h" +#import "Firestore/Example/Tests/Util/FSTEventAccumulator.h" #import <XCTest/XCTest.h> -#import "Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTAssert.h" -#import "XCTestCase+Await.h" +#import "Firestore/Example/Tests/Util/XCTestCase+Await.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Util/FSTHelpers.h b/Firestore/Example/Tests/Util/FSTHelpers.h index 3facc9c..91ccbcf 100644 --- a/Firestore/Example/Tests/Util/FSTHelpers.h +++ b/Firestore/Example/Tests/Util/FSTHelpers.h @@ -16,10 +16,10 @@ #import <Foundation/Foundation.h> -#import "API/FIRDocumentReference+Internal.h" -#import "Core/FSTTypes.h" -#import "Model/FSTDocumentDictionary.h" -#import "Model/FSTDocumentKeySet.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" @class FIRGeoPoint; @class FSTDeleteMutation; diff --git a/Firestore/Example/Tests/Util/FSTHelpers.m b/Firestore/Example/Tests/Util/FSTHelpers.m index 3b7f47f..f01bddb 100644 --- a/Firestore/Example/Tests/Util/FSTHelpers.m +++ b/Firestore/Example/Tests/Util/FSTHelpers.m @@ -14,28 +14,28 @@ * limitations under the License. */ -#import "FSTHelpers.h" - -#import "API/FIRFieldPath+Internal.h" -#import "API/FSTUserDataConverter.h" -#import "Core/FSTQuery.h" -#import "Core/FSTSnapshotVersion.h" -#import "Core/FSTTimestamp.h" -#import "Core/FSTView.h" -#import "Firestore/FIRFieldPath.h" -#import "Firestore/FIRGeoPoint.h" -#import "Local/FSTLocalViewChanges.h" -#import "Local/FSTQueryData.h" -#import "Model/FSTDatabaseID.h" -#import "Model/FSTDocument.h" -#import "Model/FSTDocumentKey.h" -#import "Model/FSTDocumentSet.h" -#import "Model/FSTFieldValue.h" -#import "Model/FSTMutation.h" -#import "Model/FSTPath.h" -#import "Remote/FSTRemoteEvent.h" -#import "Remote/FSTWatchChange.h" -#import "Util/FSTAssert.h" +#import "Firestore/Example/Tests/Util/FSTHelpers.h" + +#import "FirebaseFirestore/FIRFieldPath.h" +#import "FirebaseFirestore/FIRGeoPoint.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Core/FSTView.h" +#import "Firestore/Source/Local/FSTLocalViewChanges.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Example/Tests/Util/FSTIntegrationTestCase.h b/Firestore/Example/Tests/Util/FSTIntegrationTestCase.h index 1170080..88f9346 100644 --- a/Firestore/Example/Tests/Util/FSTIntegrationTestCase.h +++ b/Firestore/Example/Tests/Util/FSTIntegrationTestCase.h @@ -17,7 +17,7 @@ #import <Foundation/Foundation.h> #import <XCTest/XCTest.h> -#import "XCTestCase+Await.h" +#import "Firestore/Example/Tests/Util/XCTestCase+Await.h" @class FIRCollectionReference; @class FIRDocumentSnapshot; diff --git a/Firestore/Example/Tests/Util/FSTIntegrationTestCase.mm b/Firestore/Example/Tests/Util/FSTIntegrationTestCase.mm index 4bfdb41..2c29bf0 100644 --- a/Firestore/Example/Tests/Util/FSTIntegrationTestCase.mm +++ b/Firestore/Example/Tests/Util/FSTIntegrationTestCase.mm @@ -14,22 +14,23 @@ * limitations under the License. */ -#import "FSTIntegrationTestCase.h" +#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" -#import <FirebaseCommunity/FIRLogger.h> -#import <Firestore/Firestore-umbrella.h> +#import <FirebaseCore/FIRLogger.h> +#import <FirebaseFirestore/FirebaseFirestore-umbrella.h> #import <GRPCClient/GRPCCall+ChannelArg.h> #import <GRPCClient/GRPCCall+Tests.h> -#import "API/FIRFirestore+Internal.h" -#import "Auth/FSTEmptyCredentialsProvider.h" -#import "Local/FSTLevelDB.h" -#import "Model/FSTDatabaseID.h" -#import "Util/FSTDispatchQueue.h" -#import "Util/FSTUtil.h" +#include "Firestore/src/core/util/autoid.h" -#import "FSTEventAccumulator.h" -#import "FSTTestDispatchQueue.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/Auth/FSTEmptyCredentialsProvider.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" + +#import "Firestore/Example/Tests/Util/FSTEventAccumulator.h" +#import "Firestore/Example/Tests/Util/FSTTestDispatchQueue.h" NS_ASSUME_NONNULL_BEGIN @@ -164,7 +165,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)documentPath { - return [@"test-collection/" stringByAppendingString:[FSTUtil autoID]]; + std::string autoId = firestore::CreateAutoId(); + return [NSString stringWithFormat:@"test-collection/%s", autoId.c_str()]; } - (FIRDocumentReference *)documentRef { @@ -172,7 +174,8 @@ NS_ASSUME_NONNULL_BEGIN } - (FIRCollectionReference *)collectionRef { - NSString *collectionName = [@"test-collection-" stringByAppendingString:[FSTUtil autoID]]; + std::string autoId = firestore::CreateAutoId(); + NSString *collectionName = [NSString stringWithFormat:@"test-collection-%s", autoId.c_str()]; return [self.db collectionWithPath:collectionName]; } diff --git a/Firestore/Example/Tests/Util/FSTTestDispatchQueue.h b/Firestore/Example/Tests/Util/FSTTestDispatchQueue.h index 4f4e13e..7ecbbaf 100644 --- a/Firestore/Example/Tests/Util/FSTTestDispatchQueue.h +++ b/Firestore/Example/Tests/Util/FSTTestDispatchQueue.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" @class XCTestExpectation; diff --git a/Firestore/Example/Tests/Util/FSTTestDispatchQueue.m b/Firestore/Example/Tests/Util/FSTTestDispatchQueue.m index 27b62bc..8124cf2 100644 --- a/Firestore/Example/Tests/Util/FSTTestDispatchQueue.m +++ b/Firestore/Example/Tests/Util/FSTTestDispatchQueue.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "FSTTestDispatchQueue.h" +#import "Firestore/Example/Tests/Util/FSTTestDispatchQueue.h" #import <XCTest/XCTestExpectation.h> -#import "Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTAssert.h" @interface FSTTestDispatchQueue () diff --git a/Firestore/Example/Tests/Util/XCTestCase+Await.m b/Firestore/Example/Tests/Util/XCTestCase+Await.m index e200c8c..15c67ca 100644 --- a/Firestore/Example/Tests/Util/XCTestCase+Await.m +++ b/Firestore/Example/Tests/Util/XCTestCase+Await.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "XCTestCase+Await.h" +#import "Firestore/Example/Tests/Util/XCTestCase+Await.h" #import <Foundation/Foundation.h> diff --git a/Firestore/Firestore.podspec b/Firestore/Firestore.podspec deleted file mode 100644 index c589fbf..0000000 --- a/Firestore/Firestore.podspec +++ /dev/null @@ -1,43 +0,0 @@ -# -# Be sure to run `pod lib lint Firestore.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -Pod::Spec.new do |s| - s.name = 'Firestore' - s.version = '0.1.0' - s.summary = 'Google Cloud Firestore for iOS' - - 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', :file => '../LICENSE' } - s.authors = 'Google, Inc.' - - s.source = { :git => 'https://github.com/TBD/Firestore.git', :tag => s.version.to_s } - # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' - - s.ios.deployment_target = '8.0' - - s.source_files = 'Source/**/*', 'Port/**/*', 'Protos/objc/**/*.[hm]', 'third_party/**/*.[mh]' - s.requires_arc = 'Source/**/*', 'third_party/**/*.[mh]' - s.exclude_files = 'Port/*test.cc', 'third_party/**/Tests/**' - s.public_header_files = 'Source/Public/*.h' - s.frameworks = 'MobileCoreServices' - s.dependency 'gRPC-ProtoRPC' - s.dependency 'leveldb-library' - s.dependency 'Protobuf' - s.dependency 'FirebaseCommunity/Core' - s.dependency 'FirebaseCommunity/Auth' - s.library = 'c++' - - s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => - 'GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 ', - 'OTHER_CFLAGS' => '-DFIRFirestore_VERSION=' + s.version.to_s - } -end diff --git a/Firestore/Port/absl/absl_endian.h b/Firestore/Port/absl/absl_endian.h index 3b3cf3c..2c51a27 100644 --- a/Firestore/Port/absl/absl_endian.h +++ b/Firestore/Port/absl/absl_endian.h @@ -28,7 +28,7 @@ #endif #include <cstdint> -#include "absl_port.h" +#include "Firestore/Port/absl/absl_port.h" namespace absl { diff --git a/Firestore/Port/absl/absl_port.h b/Firestore/Port/absl/absl_port.h index 3a123a2..eee21fc 100644 --- a/Firestore/Port/absl/absl_port.h +++ b/Firestore/Port/absl/absl_port.h @@ -41,9 +41,9 @@ #include <stdlib.h> // for free() #include <string.h> // for memcpy() -#include "absl_attributes.h" -#include "absl_config.h" -#include "absl_integral_types.h" +#include "Firestore/Port/absl/absl_attributes.h" +#include "Firestore/Port/absl/absl_config.h" +#include "Firestore/Port/absl/absl_integral_types.h" #ifdef SWIG %include "attributes.h" diff --git a/Firestore/Port/bits.cc b/Firestore/Port/bits.cc index 40af964..3e61223 100644 --- a/Firestore/Port/bits.cc +++ b/Firestore/Port/bits.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "bits.h" +#include "Firestore/Port/bits.h" #include <assert.h> diff --git a/Firestore/Port/bits_test.cc b/Firestore/Port/bits_test.cc index 18c3b1d..8c3c246 100644 --- a/Firestore/Port/bits_test.cc +++ b/Firestore/Port/bits_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "bits.h" +#include "Firestore/Port/bits.h" #include <iostream> diff --git a/Firestore/Port/ordered_code.cc b/Firestore/Port/ordered_code.cc index ec5733c..038d445 100644 --- a/Firestore/Port/ordered_code.cc +++ b/Firestore/Port/ordered_code.cc @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "ordered_code.h" +#include "Firestore/Port/ordered_code.h" #include <assert.h> -#include "bits.h" +#include "Firestore/Port/bits.h" -#include "absl_endian.h" -#include "absl_port.h" +#include "Firestore/Port/absl/absl_endian.h" +#include "Firestore/Port/absl/absl_port.h" #include <leveldb/db.h> // For Slice // We encode a string in different ways depending on whether the item diff --git a/Firestore/Port/ordered_code_test.cc b/Firestore/Port/ordered_code_test.cc index 21b0bd1..0a339fc 100644 --- a/Firestore/Port/ordered_code_test.cc +++ b/Firestore/Port/ordered_code_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "ordered_code.h" +#include "Firestore/Port/ordered_code.h" // #include <float.h> // #include <stddef.h> diff --git a/Firestore/Port/string_util.cc b/Firestore/Port/string_util.cc index 5e87fff..2587860 100644 --- a/Firestore/Port/string_util.cc +++ b/Firestore/Port/string_util.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "string_util.h" +#include "Firestore/Port/string_util.h" #include <leveldb/db.h> diff --git a/Firestore/Port/string_util_test.cc b/Firestore/Port/string_util_test.cc index bac1de3..ac8ce56 100644 --- a/Firestore/Port/string_util_test.cc +++ b/Firestore/Port/string_util_test.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "string_util.h" +#include "Firestore/Port/string_util.h" #include "leveldb/db.h" diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h index 5704c2b..d7f127b 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h @@ -14,18 +14,18 @@ * limitations under the License. */ -#import "Firestore.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h" #import <ProtoRPC/ProtoService.h> #import <ProtoRPC/ProtoRPC.h> #import <RxLibrary/GRXWriteable.h> #import <RxLibrary/GRXWriter.h> -#import "Annotations.pbobjc.h" -#import "Common.pbobjc.h" -#import "Document.pbobjc.h" -#import "Query.pbobjc.h" -#import "Write.pbobjc.h" +#import "Firestore/Protos/objc/google/api/Annotations.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h" #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import <Protobuf/Empty.pbobjc.h> #else @@ -36,7 +36,7 @@ #else #import "Timestamp.pbobjc.h" #endif -#import "Status.pbobjc.h" +#import "Firestore/Protos/objc/google/rpc/Status.pbobjc.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m index a3e338d..eec4c9a 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Firestore.pbrpc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h" #import <ProtoRPC/ProtoRPC.h> #import <RxLibrary/GRXWriter+Immediate.h> diff --git a/Firestore/README.md b/Firestore/README.md index fbff1b1..10c4221 100644 --- a/Firestore/README.md +++ b/Firestore/README.md @@ -3,7 +3,7 @@ ``` $ cd Firestore/Example $ pod update -$ open Firebase.xcworkspace +$ open Firestore.xcworkspace Select the FirestoreTests scheme ⌘-u to build and run the unit tests ``` diff --git a/Firestore/Source/API/FIRCollectionReference.m b/Firestore/Source/API/FIRCollectionReference.mm index 1ded4d2..7b487c6 100644 --- a/Firestore/Source/API/FIRCollectionReference.m +++ b/Firestore/Source/API/FIRCollectionReference.mm @@ -16,15 +16,16 @@ #import "FIRCollectionReference.h" -#import "FIRDocumentReference+Internal.h" -#import "FIRQuery+Internal.h" -#import "FIRQuery_Init.h" -#import "FSTAssert.h" -#import "FSTDocumentKey.h" -#import "FSTPath.h" -#import "FSTQuery.h" -#import "FSTUsageValidation.h" -#import "FSTUtil.h" +#include "Firestore/src/core/util/autoid.h" + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRQuery+Internal.h" +#import "Firestore/Source/API/FIRQuery_Init.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN @@ -102,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN } - (FIRDocumentReference *)documentWithAutoID { - NSString *autoID = [FSTUtil autoID]; + NSString *autoID = [NSString stringWithUTF8String:firestore::CreateAutoId().c_str()]; FSTDocumentKey *key = [FSTDocumentKey keyWithPath:[self.query.path pathByAppendingSegment:autoID]]; return [FIRDocumentReference referenceWithKey:key firestore:self.firestore]; diff --git a/Firestore/Source/API/FIRDocumentChange.m b/Firestore/Source/API/FIRDocumentChange.m index f284bfe..970dc90 100644 --- a/Firestore/Source/API/FIRDocumentChange.m +++ b/Firestore/Source/API/FIRDocumentChange.m @@ -16,12 +16,12 @@ #import "FIRDocumentChange.h" -#import "FIRDocumentSnapshot+Internal.h" -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentSet.h" -#import "FSTQuery.h" -#import "FSTViewSnapshot.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRDocumentReference.m b/Firestore/Source/API/FIRDocumentReference.m index 5fa6cf7..1c80ea9 100644 --- a/Firestore/Source/API/FIRDocumentReference.m +++ b/Firestore/Source/API/FIRDocumentReference.m @@ -16,28 +16,28 @@ #import "FIRDocumentReference.h" -#import "FIRCollectionReference+Internal.h" -#import "FIRDocumentReference+Internal.h" -#import "FIRDocumentSnapshot+Internal.h" -#import "FIRFirestore+Internal.h" +#import <GRPCClient/GRPCCall.h> + #import "FIRFirestoreErrors.h" -#import "FIRListenerRegistration+Internal.h" -#import "FIRSetOptions+Internal.h" #import "FIRSnapshotMetadata.h" -#import "FSTAssert.h" -#import "FSTAsyncQueryListener.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentSet.h" -#import "FSTEventManager.h" -#import "FSTFieldValue.h" -#import "FSTFirestoreClient.h" -#import "FSTMutation.h" -#import "FSTPath.h" -#import "FSTQuery.h" -#import "FSTUsageValidation.h" -#import "FSTUserDataConverter.h" - -#import <GRPCClient/GRPCCall.h> +#import "Firestore/Source/API/FIRCollectionReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRListenerRegistration+Internal.h" +#import "Firestore/Source/API/FIRSetOptions+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Core/FSTEventManager.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTAsyncQueryListener.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRDocumentSnapshot.m b/Firestore/Source/API/FIRDocumentSnapshot.m index b5f61ba..b78472e 100644 --- a/Firestore/Source/API/FIRDocumentSnapshot.m +++ b/Firestore/Source/API/FIRDocumentSnapshot.m @@ -16,16 +16,16 @@ #import "FIRDocumentSnapshot.h" -#import "FIRDocumentReference+Internal.h" -#import "FIRFieldPath+Internal.h" -#import "FIRFirestore+Internal.h" -#import "FIRSnapshotMetadata+Internal.h" -#import "FSTDatabaseID.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTFieldValue.h" -#import "FSTPath.h" -#import "FSTUsageValidation.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRFieldPath.m b/Firestore/Source/API/FIRFieldPath.m index b3c919c..d0a70c0 100644 --- a/Firestore/Source/API/FIRFieldPath.m +++ b/Firestore/Source/API/FIRFieldPath.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" -#import "FSTPath.h" -#import "FSTUsageValidation.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRFieldValue.m b/Firestore/Source/API/FIRFieldValue.m index a44d8fa..7ae4fb0 100644 --- a/Firestore/Source/API/FIRFieldValue.m +++ b/Firestore/Source/API/FIRFieldValue.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FIRFieldValue+Internal.h" +#import "Firestore/Source/API/FIRFieldValue+Internal.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRFirestore+Internal.h b/Firestore/Source/API/FIRFirestore+Internal.h index 08f5266..c2e995a 100644 --- a/Firestore/Source/API/FIRFirestore+Internal.h +++ b/Firestore/Source/API/FIRFirestore+Internal.h @@ -15,7 +15,6 @@ */ #import "FIRFirestore.h" -#import "FIRFirestoreSwiftNameSupport.h" NS_ASSUME_NONNULL_BEGIN @@ -53,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN * @param completion A block to execute once everything has shut down. */ - (void)shutdownWithCompletion:(nullable void (^)(NSError *_Nullable error))completion - FIR_SWIFT_NAME(shutdown(completion:)); + NS_SWIFT_NAME(shutdown(completion:)); @property(nonatomic, strong, readonly) FSTDatabaseID *databaseID; @property(nonatomic, strong, readonly) FSTFirestoreClient *client; diff --git a/Firestore/Source/API/FIRFirestore.m b/Firestore/Source/API/FIRFirestore.m index 1b53e83..7814ce1 100644 --- a/Firestore/Source/API/FIRFirestore.m +++ b/Firestore/Source/API/FIRFirestore.m @@ -16,28 +16,28 @@ #import "FIRFirestore.h" -#import <FirebaseCommunity/FIRApp.h> -#import <FirebaseCommunity/FIRLogger.h> -#import <FirebaseCommunity/FIROptions.h> +#import <FirebaseCore/FIRApp.h> +#import <FirebaseCore/FIRLogger.h> +#import <FirebaseCore/FIROptions.h> -#import "FIRCollectionReference+Internal.h" -#import "FIRDocumentReference+Internal.h" -#import "FIRFirestore+Internal.h" #import "FIRFirestoreSettings.h" -#import "FIRTransaction+Internal.h" -#import "FIRWriteBatch+Internal.h" -#import "FSTUserDataConverter.h" - -#import "FSTAssert.h" -#import "FSTCredentialsProvider.h" -#import "FSTDatabaseID.h" -#import "FSTDatabaseInfo.h" -#import "FSTDispatchQueue.h" -#import "FSTDocumentKey.h" -#import "FSTFirestoreClient.h" -#import "FSTLogger.h" -#import "FSTPath.h" -#import "FSTUsageValidation.h" +#import "Firestore/Source/API/FIRCollectionReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRTransaction+Internal.h" +#import "Firestore/Source/API/FIRWriteBatch+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" + +#import "Firestore/Source/Auth/FSTCredentialsProvider.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTLogger.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRFirestoreSettings.m b/Firestore/Source/API/FIRFirestoreSettings.m index 106a0b5..9677ff6 100644 --- a/Firestore/Source/API/FIRFirestoreSettings.m +++ b/Firestore/Source/API/FIRFirestoreSettings.m @@ -16,7 +16,7 @@ #import "FIRFirestoreSettings.h" -#import "FSTUsageValidation.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRGeoPoint.m b/Firestore/Source/API/FIRGeoPoint.m index a50cf37..72e9e7d 100644 --- a/Firestore/Source/API/FIRGeoPoint.m +++ b/Firestore/Source/API/FIRGeoPoint.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FIRGeoPoint+Internal.h" +#import "Firestore/Source/API/FIRGeoPoint+Internal.h" -#import "FSTComparison.h" -#import "FSTUsageValidation.h" +#import "Firestore/Source/Util/FSTComparison.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRListenerRegistration.m b/Firestore/Source/API/FIRListenerRegistration.m index 5d3ea8e..9f4ddd5 100644 --- a/Firestore/Source/API/FIRListenerRegistration.m +++ b/Firestore/Source/API/FIRListenerRegistration.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FIRListenerRegistration+Internal.h" +#import "Firestore/Source/API/FIRListenerRegistration+Internal.h" -#import "FSTAsyncQueryListener.h" -#import "FSTFirestoreClient.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" +#import "Firestore/Source/Util/FSTAsyncQueryListener.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRQuery.m b/Firestore/Source/API/FIRQuery.m index be64bf5..12e79c5 100644 --- a/Firestore/Source/API/FIRQuery.m +++ b/Firestore/Source/API/FIRQuery.m @@ -16,27 +16,27 @@ #import "FIRQuery.h" -#import "FIRDocumentReference+Internal.h" #import "FIRDocumentReference.h" -#import "FIRDocumentSnapshot+Internal.h" -#import "FIRFieldPath+Internal.h" -#import "FIRFirestore+Internal.h" -#import "FIRListenerRegistration+Internal.h" -#import "FIRQuery+Internal.h" -#import "FIRQuerySnapshot+Internal.h" -#import "FIRQuery_Init.h" -#import "FIRSnapshotMetadata+Internal.h" -#import "FSTAssert.h" -#import "FSTAsyncQueryListener.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTEventManager.h" -#import "FSTFieldValue.h" -#import "FSTFirestoreClient.h" -#import "FSTPath.h" -#import "FSTQuery.h" -#import "FSTUsageValidation.h" -#import "FSTUserDataConverter.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRListenerRegistration+Internal.h" +#import "Firestore/Source/API/FIRQuery+Internal.h" +#import "Firestore/Source/API/FIRQuerySnapshot+Internal.h" +#import "Firestore/Source/API/FIRQuery_Init.h" +#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Core/FSTEventManager.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTAsyncQueryListener.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRQuerySnapshot.m b/Firestore/Source/API/FIRQuerySnapshot.m index 4bf4edf..6bc6761 100644 --- a/Firestore/Source/API/FIRQuerySnapshot.m +++ b/Firestore/Source/API/FIRQuerySnapshot.m @@ -14,17 +14,17 @@ * limitations under the License. */ -#import "FIRQuerySnapshot+Internal.h" +#import "Firestore/Source/API/FIRQuerySnapshot+Internal.h" -#import "FIRDocumentChange+Internal.h" -#import "FIRDocumentSnapshot+Internal.h" -#import "FIRQuery+Internal.h" #import "FIRSnapshotMetadata.h" -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentSet.h" -#import "FSTQuery.h" -#import "FSTViewSnapshot.h" +#import "Firestore/Source/API/FIRDocumentChange+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRQuery+Internal.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRSetOptions.m b/Firestore/Source/API/FIRSetOptions.m index ea68c63..623deaa 100644 --- a/Firestore/Source/API/FIRSetOptions.m +++ b/Firestore/Source/API/FIRSetOptions.m @@ -14,8 +14,8 @@ * limitations under the License. */ -#import "FIRSetOptions+Internal.h" -#import "FSTMutation.h" +#import "Firestore/Source/API/FIRSetOptions+Internal.h" +#import "Firestore/Source/Model/FSTMutation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRSnapshotMetadata.m b/Firestore/Source/API/FIRSnapshotMetadata.m index ff49d8f..224015f 100644 --- a/Firestore/Source/API/FIRSnapshotMetadata.m +++ b/Firestore/Source/API/FIRSnapshotMetadata.m @@ -16,7 +16,7 @@ #import "FIRSnapshotMetadata.h" -#import "FIRSnapshotMetadata+Internal.h" +#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRTransaction.m b/Firestore/Source/API/FIRTransaction.m index 69e7b12..5edff19 100644 --- a/Firestore/Source/API/FIRTransaction.m +++ b/Firestore/Source/API/FIRTransaction.m @@ -14,17 +14,17 @@ * limitations under the License. */ -#import "FIRTransaction+Internal.h" - -#import "FIRDocumentReference+Internal.h" -#import "FIRDocumentSnapshot+Internal.h" -#import "FIRFirestore+Internal.h" -#import "FIRSetOptions+Internal.h" -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTTransaction.h" -#import "FSTUsageValidation.h" -#import "FSTUserDataConverter.h" +#import "Firestore/Source/API/FIRTransaction+Internal.h" + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRSetOptions+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Core/FSTTransaction.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FIRWriteBatch.m b/Firestore/Source/API/FIRWriteBatch.m index 20559b8..b918a9a 100644 --- a/Firestore/Source/API/FIRWriteBatch.m +++ b/Firestore/Source/API/FIRWriteBatch.m @@ -14,15 +14,15 @@ * limitations under the License. */ -#import "FIRWriteBatch+Internal.h" - -#import "FIRDocumentReference+Internal.h" -#import "FIRFirestore+Internal.h" -#import "FIRSetOptions+Internal.h" -#import "FSTFirestoreClient.h" -#import "FSTMutation.h" -#import "FSTUsageValidation.h" -#import "FSTUserDataConverter.h" +#import "Firestore/Source/API/FIRWriteBatch+Internal.h" + +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRSetOptions+Internal.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/API/FSTUserDataConverter.m b/Firestore/Source/API/FSTUserDataConverter.m index aa79a51..414aadb 100644 --- a/Firestore/Source/API/FSTUserDataConverter.m +++ b/Firestore/Source/API/FSTUserDataConverter.m @@ -14,22 +14,22 @@ * limitations under the License. */ -#import "FSTUserDataConverter.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" -#import "FIRDocumentReference+Internal.h" -#import "FIRFieldPath+Internal.h" -#import "FIRFieldValue+Internal.h" -#import "FIRFirestore+Internal.h" #import "FIRGeoPoint.h" -#import "FIRSetOptions+Internal.h" -#import "FSTAssert.h" -#import "FSTDatabaseID.h" -#import "FSTDocumentKey.h" -#import "FSTFieldValue.h" -#import "FSTMutation.h" -#import "FSTPath.h" -#import "FSTTimestamp.h" -#import "FSTUsageValidation.h" +#import "Firestore/Source/API/FIRDocumentReference+Internal.h" +#import "Firestore/Source/API/FIRFieldPath+Internal.h" +#import "Firestore/Source/API/FIRFieldValue+Internal.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRSetOptions+Internal.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Auth/FSTCredentialsProvider.m b/Firestore/Source/Auth/FSTCredentialsProvider.m index cec7c2b..821341e 100644 --- a/Firestore/Source/Auth/FSTCredentialsProvider.m +++ b/Firestore/Source/Auth/FSTCredentialsProvider.m @@ -14,21 +14,19 @@ * limitations under the License. */ -#import "FSTCredentialsProvider.h" +#import "Firestore/Source/Auth/FSTCredentialsProvider.h" -#import <FirebaseCommunity/FIRApp.h> -#import <FirebaseCommunity/FIRAuth.h> -#import <FirebaseCommunity/FIRUser.h> +#import <FirebaseAuth/FIRAuth.h> +#import <FirebaseAuth/FIRUser.h> +#import <FirebaseCore/FIRApp.h> +#import <FirebaseCore/FIRAppInternal.h> #import <GRPCClient/GRPCCall.h> -// This is not an exported header so it's not visible via FirebaseCommunity -#import "FIRAppInternal.h" - #import "FIRFirestoreErrors.h" -#import "FSTAssert.h" -#import "FSTClasses.h" -#import "FSTDispatchQueue.h" -#import "FSTUser.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Auth/FSTUser.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Auth/FSTEmptyCredentialsProvider.h b/Firestore/Source/Auth/FSTEmptyCredentialsProvider.h index c0074c2..5783bcc 100644 --- a/Firestore/Source/Auth/FSTEmptyCredentialsProvider.h +++ b/Firestore/Source/Auth/FSTEmptyCredentialsProvider.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTCredentialsProvider.h" +#import "Firestore/Source/Auth/FSTCredentialsProvider.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Auth/FSTEmptyCredentialsProvider.m b/Firestore/Source/Auth/FSTEmptyCredentialsProvider.m index 266e09b..e78452a 100644 --- a/Firestore/Source/Auth/FSTEmptyCredentialsProvider.m +++ b/Firestore/Source/Auth/FSTEmptyCredentialsProvider.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "FSTEmptyCredentialsProvider.h" +#import "Firestore/Source/Auth/FSTEmptyCredentialsProvider.h" -#import "FSTUser.h" -#import "FSTAssert.h" -#import "FSTDispatchQueue.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Auth/FSTUser.m b/Firestore/Source/Auth/FSTUser.m index a7492b2..605b4e6 100644 --- a/Firestore/Source/Auth/FSTUser.m +++ b/Firestore/Source/Auth/FSTUser.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FSTUser.h" +#import "Firestore/Source/Auth/FSTUser.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTDatabaseInfo.m b/Firestore/Source/Core/FSTDatabaseInfo.m index d2cd0ed..2dbe61a 100644 --- a/Firestore/Source/Core/FSTDatabaseInfo.m +++ b/Firestore/Source/Core/FSTDatabaseInfo.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "FSTDatabaseInfo.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" -#import "FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTEventManager.h b/Firestore/Source/Core/FSTEventManager.h index 43ada66..edd2a96 100644 --- a/Firestore/Source/Core/FSTEventManager.h +++ b/Firestore/Source/Core/FSTEventManager.h @@ -16,9 +16,9 @@ #import <Foundation/Foundation.h> -#import "FSTRemoteStore.h" -#import "FSTTypes.h" -#import "FSTViewSnapshot.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Remote/FSTRemoteStore.h" @class FSTQuery; @class FSTSyncEngine; diff --git a/Firestore/Source/Core/FSTEventManager.m b/Firestore/Source/Core/FSTEventManager.m index 17a0546..3e1b99b 100644 --- a/Firestore/Source/Core/FSTEventManager.m +++ b/Firestore/Source/Core/FSTEventManager.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "FSTEventManager.h" +#import "Firestore/Source/Core/FSTEventManager.h" -#import "FSTAssert.h" -#import "FSTDocumentSet.h" -#import "FSTQuery.h" -#import "FSTSyncEngine.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSyncEngine.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTFirestoreClient.h b/Firestore/Source/Core/FSTFirestoreClient.h index 21d61d4..6a1e11b 100644 --- a/Firestore/Source/Core/FSTFirestoreClient.h +++ b/Firestore/Source/Core/FSTFirestoreClient.h @@ -16,9 +16,9 @@ #import <Foundation/Foundation.h> -#import "FSTRemoteStore.h" -#import "FSTTypes.h" -#import "FSTViewSnapshot.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Remote/FSTRemoteStore.h" @class FSTDatabaseID; @class FSTDatabaseInfo; diff --git a/Firestore/Source/Core/FSTFirestoreClient.m b/Firestore/Source/Core/FSTFirestoreClient.m index 1a53197..2e0e407 100644 --- a/Firestore/Source/Core/FSTFirestoreClient.m +++ b/Firestore/Source/Core/FSTFirestoreClient.m @@ -14,26 +14,26 @@ * limitations under the License. */ -#import "FSTFirestoreClient.h" - -#import "FSTAssert.h" -#import "FSTClasses.h" -#import "FSTCredentialsProvider.h" -#import "FSTDatabaseInfo.h" -#import "FSTDatastore.h" -#import "FSTDispatchQueue.h" -#import "FSTEagerGarbageCollector.h" -#import "FSTEventManager.h" -#import "FSTLevelDB.h" -#import "FSTLocalSerializer.h" -#import "FSTLocalStore.h" -#import "FSTLogger.h" -#import "FSTMemoryPersistence.h" -#import "FSTNoOpGarbageCollector.h" -#import "FSTRemoteStore.h" -#import "FSTSerializerBeta.h" -#import "FSTSyncEngine.h" -#import "FSTTransaction.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" + +#import "Firestore/Source/Auth/FSTCredentialsProvider.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Core/FSTEventManager.h" +#import "Firestore/Source/Core/FSTSyncEngine.h" +#import "Firestore/Source/Core/FSTTransaction.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLocalSerializer.h" +#import "Firestore/Source/Local/FSTLocalStore.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" +#import "Firestore/Source/Local/FSTNoOpGarbageCollector.h" +#import "Firestore/Source/Remote/FSTDatastore.h" +#import "Firestore/Source/Remote/FSTRemoteStore.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTLogger.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTQuery.m b/Firestore/Source/Core/FSTQuery.m index b220c7c..0bfd917 100644 --- a/Firestore/Source/Core/FSTQuery.m +++ b/Firestore/Source/Core/FSTQuery.m @@ -14,14 +14,14 @@ * limitations under the License. */ -#import "FSTQuery.h" - -#import "FIRFirestore+Internal.h" -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTFieldValue.h" -#import "FSTPath.h" +#import "Firestore/Source/Core/FSTQuery.h" + +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTSnapshotVersion.m b/Firestore/Source/Core/FSTSnapshotVersion.m index 68d5d7f..980ae52 100644 --- a/Firestore/Source/Core/FSTSnapshotVersion.m +++ b/Firestore/Source/Core/FSTSnapshotVersion.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" -#import "FSTTimestamp.h" +#import "Firestore/Source/Core/FSTTimestamp.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTSyncEngine.h b/Firestore/Source/Core/FSTSyncEngine.h index 1348ce1..bb45196 100644 --- a/Firestore/Source/Core/FSTSyncEngine.h +++ b/Firestore/Source/Core/FSTSyncEngine.h @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "FSTRemoteStore.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Remote/FSTRemoteStore.h" @class FSTDispatchQueue; @class FSTLocalStore; diff --git a/Firestore/Source/Core/FSTSyncEngine.m b/Firestore/Source/Core/FSTSyncEngine.m index 8698a97..98658e4 100644 --- a/Firestore/Source/Core/FSTSyncEngine.m +++ b/Firestore/Source/Core/FSTSyncEngine.m @@ -14,32 +14,32 @@ * limitations under the License. */ -#import "FSTSyncEngine.h" +#import "Firestore/Source/Core/FSTSyncEngine.h" #import <GRPCClient/GRPCCall.h> #import "FIRFirestoreErrors.h" -#import "FSTAssert.h" -#import "FSTDispatchQueue.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentSet.h" -#import "FSTEagerGarbageCollector.h" -#import "FSTLocalStore.h" -#import "FSTLocalViewChanges.h" -#import "FSTLocalWriteResult.h" -#import "FSTLogger.h" -#import "FSTMutationBatch.h" -#import "FSTQuery.h" -#import "FSTQueryData.h" -#import "FSTReferenceSet.h" -#import "FSTRemoteEvent.h" -#import "FSTSnapshotVersion.h" -#import "FSTTargetIDGenerator.h" -#import "FSTTransaction.h" -#import "FSTUser.h" -#import "FSTView.h" -#import "FSTViewSnapshot.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTargetIDGenerator.h" +#import "Firestore/Source/Core/FSTTransaction.h" +#import "Firestore/Source/Core/FSTView.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTLocalStore.h" +#import "Firestore/Source/Local/FSTLocalViewChanges.h" +#import "Firestore/Source/Local/FSTLocalWriteResult.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Local/FSTReferenceSet.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTLogger.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTTargetIDGenerator.h b/Firestore/Source/Core/FSTTargetIDGenerator.h index 5b9db10..0b230ae 100644 --- a/Firestore/Source/Core/FSTTargetIDGenerator.h +++ b/Firestore/Source/Core/FSTTargetIDGenerator.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTTargetIDGenerator.m b/Firestore/Source/Core/FSTTargetIDGenerator.m index 86ded30..58092ec 100644 --- a/Firestore/Source/Core/FSTTargetIDGenerator.m +++ b/Firestore/Source/Core/FSTTargetIDGenerator.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FSTTargetIDGenerator.h" +#import "Firestore/Source/Core/FSTTargetIDGenerator.h" #import <libkern/OSAtomic.h> diff --git a/Firestore/Source/Core/FSTTimestamp.m b/Firestore/Source/Core/FSTTimestamp.m index 941217a..6d9e314 100644 --- a/Firestore/Source/Core/FSTTimestamp.m +++ b/Firestore/Source/Core/FSTTimestamp.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTTimestamp.h" +#import "Firestore/Source/Core/FSTTimestamp.h" -#import "FSTAssert.h" -#import "FSTComparison.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTComparison.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTTransaction.h b/Firestore/Source/Core/FSTTransaction.h index 7fa3a10..d4f3d8d 100644 --- a/Firestore/Source/Core/FSTTransaction.h +++ b/Firestore/Source/Core/FSTTransaction.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" @class FIRSetOptions; @class FSTDatastore; diff --git a/Firestore/Source/Core/FSTTransaction.m b/Firestore/Source/Core/FSTTransaction.m index 26c69e0..c4c5f27 100644 --- a/Firestore/Source/Core/FSTTransaction.m +++ b/Firestore/Source/Core/FSTTransaction.m @@ -14,21 +14,21 @@ * limitations under the License. */ -#import "FSTTransaction.h" +#import "Firestore/Source/Core/FSTTransaction.h" #import <GRPCClient/GRPCCall.h> #import "FIRFirestoreErrors.h" #import "FIRSetOptions.h" -#import "FSTAssert.h" -#import "FSTDatastore.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentKeySet.h" -#import "FSTMutation.h" -#import "FSTSnapshotVersion.h" -#import "FSTUsageValidation.h" -#import "FSTUserDataConverter.h" +#import "Firestore/Source/API/FSTUserDataConverter.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Remote/FSTDatastore.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTView.h b/Firestore/Source/Core/FSTView.h index 2dbfac2..ed230a3 100644 --- a/Firestore/Source/Core/FSTView.h +++ b/Firestore/Source/Core/FSTView.h @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKeySet.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" @class FSTDocumentKey; @class FSTDocumentSet; diff --git a/Firestore/Source/Core/FSTView.m b/Firestore/Source/Core/FSTView.m index 719e303..9b44bf4 100644 --- a/Firestore/Source/Core/FSTView.m +++ b/Firestore/Source/Core/FSTView.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "FSTView.h" - -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentSet.h" -#import "FSTFieldValue.h" -#import "FSTQuery.h" -#import "FSTRemoteEvent.h" -#import "FSTViewSnapshot.h" +#import "Firestore/Source/Core/FSTView.h" + +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Core/FSTViewSnapshot.m b/Firestore/Source/Core/FSTViewSnapshot.m index 016f890..e60b785 100644 --- a/Firestore/Source/Core/FSTViewSnapshot.m +++ b/Firestore/Source/Core/FSTViewSnapshot.m @@ -14,14 +14,14 @@ * limitations under the License. */ -#import "FSTViewSnapshot.h" - -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentSet.h" -#import "FSTImmutableSortedDictionary.h" -#import "FSTQuery.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" + +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTDocumentReference.m b/Firestore/Source/Local/FSTDocumentReference.m index 7d9e3db..1631789 100644 --- a/Firestore/Source/Local/FSTDocumentReference.m +++ b/Firestore/Source/Local/FSTDocumentReference.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTDocumentReference.h" +#import "Firestore/Source/Local/FSTDocumentReference.h" -#import "FSTComparison.h" -#import "FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Util/FSTComparison.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTEagerGarbageCollector.h b/Firestore/Source/Local/FSTEagerGarbageCollector.h index f2f373c..40815b7 100644 --- a/Firestore/Source/Local/FSTEagerGarbageCollector.h +++ b/Firestore/Source/Local/FSTEagerGarbageCollector.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTGarbageCollector.h" +#import "Firestore/Source/Local/FSTGarbageCollector.h" @class FSTDocumentKey; diff --git a/Firestore/Source/Local/FSTEagerGarbageCollector.m b/Firestore/Source/Local/FSTEagerGarbageCollector.m index 971f368..77a577e 100644 --- a/Firestore/Source/Local/FSTEagerGarbageCollector.m +++ b/Firestore/Source/Local/FSTEagerGarbageCollector.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "FSTEagerGarbageCollector.h" +#import "Firestore/Source/Local/FSTEagerGarbageCollector.h" -#import "FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTGarbageCollector.h b/Firestore/Source/Local/FSTGarbageCollector.h index c999f66..ff5116b 100644 --- a/Firestore/Source/Local/FSTGarbageCollector.h +++ b/Firestore/Source/Local/FSTGarbageCollector.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" @class FSTDocumentKey; @class FSTDocumentReference; diff --git a/Firestore/Source/Local/FSTLevelDB.h b/Firestore/Source/Local/FSTLevelDB.h index a2c838d..762054b 100644 --- a/Firestore/Source/Local/FSTLevelDB.h +++ b/Firestore/Source/Local/FSTLevelDB.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTPersistence.h" +#import "Firestore/Source/Local/FSTPersistence.h" #ifdef __cplusplus #include <memory> diff --git a/Firestore/Source/Local/FSTLevelDB.mm b/Firestore/Source/Local/FSTLevelDB.mm index 81e1064..fb1c81a 100644 --- a/Firestore/Source/Local/FSTLevelDB.mm +++ b/Firestore/Source/Local/FSTLevelDB.mm @@ -14,21 +14,21 @@ * limitations under the License. */ -#import "FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLevelDB.h" #include <leveldb/db.h> #import "FIRFirestoreErrors.h" -#import "FSTAssert.h" -#import "FSTDatabaseID.h" -#import "FSTDatabaseInfo.h" -#import "FSTLevelDBMutationQueue.h" -#import "FSTLevelDBQueryCache.h" -#import "FSTLevelDBRemoteDocumentCache.h" -#import "FSTLogger.h" -#import "FSTSerializerBeta.h" -#import "FSTWriteGroup.h" -#import "FSTWriteGroupTracker.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Local/FSTLevelDBMutationQueue.h" +#import "Firestore/Source/Local/FSTLevelDBQueryCache.h" +#import "Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Local/FSTWriteGroupTracker.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTLogger.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLevelDBKey.h b/Firestore/Source/Local/FSTLevelDBKey.h index bad7829..2e9b9b2 100644 --- a/Firestore/Source/Local/FSTLevelDBKey.h +++ b/Firestore/Source/Local/FSTLevelDBKey.h @@ -20,9 +20,8 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" - -#import "StringView.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Local/StringView.h" @class FSTDocumentKey; @class FSTResourcePath; diff --git a/Firestore/Source/Local/FSTLevelDBKey.mm b/Firestore/Source/Local/FSTLevelDBKey.mm index 1c0af45..c6f51b9 100644 --- a/Firestore/Source/Local/FSTLevelDBKey.mm +++ b/Firestore/Source/Local/FSTLevelDBKey.mm @@ -14,14 +14,14 @@ * limitations under the License. */ -#import "FSTLevelDBKey.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" #include <string> -#import "FSTDocumentKey.h" -#import "FSTPath.h" -#include "ordered_code.h" -#include "string_util.h" +#include "Firestore/Port/ordered_code.h" +#include "Firestore/Port/string_util.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTPath.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLevelDBMutationQueue.h b/Firestore/Source/Local/FSTLevelDBMutationQueue.h index c9b5166..dd2ed4f 100644 --- a/Firestore/Source/Local/FSTLevelDBMutationQueue.h +++ b/Firestore/Source/Local/FSTLevelDBMutationQueue.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTMutationQueue.h" +#import "Firestore/Source/Local/FSTMutationQueue.h" #ifdef __cplusplus #include <memory> diff --git a/Firestore/Source/Local/FSTLevelDBMutationQueue.mm b/Firestore/Source/Local/FSTLevelDBMutationQueue.mm index 689ea6e..56a22a1 100644 --- a/Firestore/Source/Local/FSTLevelDBMutationQueue.mm +++ b/Firestore/Source/Local/FSTLevelDBMutationQueue.mm @@ -14,28 +14,28 @@ * limitations under the License. */ -#import "FSTLevelDBMutationQueue.h" +#import "Firestore/Source/Local/FSTLevelDBMutationQueue.h" #include <leveldb/db.h> #include <leveldb/write_batch.h> #include <set> #include <string> -#import "FSTAssert.h" -#import "FSTDocumentKey.h" -#import "FSTLevelDB.h" -#import "FSTLevelDBKey.h" -#import "FSTLocalSerializer.h" -#import "FSTMutation.h" -#import "FSTMutationBatch.h" -#import "FSTPath.h" -#import "FSTQuery.h" -#import "FSTUser.h" -#import "FSTWriteGroup.h" -#import "Mutation.pbobjc.h" - -#include "ordered_code.h" -#include "string_util.h" +#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Local/FSTLevelDB.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" +#import "Firestore/Source/Local/FSTLocalSerializer.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" + +#include "Firestore/Port/ordered_code.h" +#include "Firestore/Port/string_util.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLevelDBQueryCache.h b/Firestore/Source/Local/FSTLevelDBQueryCache.h index 3f24e6a..6d5cd60 100644 --- a/Firestore/Source/Local/FSTLevelDBQueryCache.h +++ b/Firestore/Source/Local/FSTLevelDBQueryCache.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTQueryCache.h" +#import "Firestore/Source/Local/FSTQueryCache.h" #ifdef __cplusplus #include <memory> diff --git a/Firestore/Source/Local/FSTLevelDBQueryCache.mm b/Firestore/Source/Local/FSTLevelDBQueryCache.mm index c79014d..13d15ee 100644 --- a/Firestore/Source/Local/FSTLevelDBQueryCache.mm +++ b/Firestore/Source/Local/FSTLevelDBQueryCache.mm @@ -14,23 +14,23 @@ * limitations under the License. */ -#import "FSTLevelDBQueryCache.h" +#import "Firestore/Source/Local/FSTLevelDBQueryCache.h" #include <leveldb/db.h> #include <leveldb/write_batch.h> #include <string> -#import "FSTAssert.h" -#import "FSTDocumentKey.h" -#import "FSTLevelDBKey.h" -#import "FSTLocalSerializer.h" -#import "FSTQuery.h" -#import "FSTQueryData.h" -#import "FSTWriteGroup.h" -#import "Target.pbobjc.h" - -#include "ordered_code.h" -#include "string_util.h" +#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" +#import "Firestore/Source/Local/FSTLocalSerializer.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Util/FSTAssert.h" + +#include "Firestore/Port/ordered_code.h" +#include "Firestore/Port/string_util.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h b/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h index f327813..1da3cca 100644 --- a/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h +++ b/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTRemoteDocumentCache.h" #ifdef __cplusplus #include <memory> diff --git a/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.mm b/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.mm index 67c654e..02f9f3e 100644 --- a/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.mm +++ b/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.mm @@ -14,24 +14,26 @@ * limitations under the License. */ -#import "FSTLevelDBRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h" #include <leveldb/db.h> #include <leveldb/write_batch.h> #include <string> -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentSet.h" -#import "FSTLevelDBKey.h" -#import "FSTLocalSerializer.h" -#import "FSTWriteGroup.h" -#import "MaybeDocument.pbobjc.h" - -#include "ordered_code.h" -#include "string_util.h" +#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" +#import "Firestore/Source/Local/FSTLocalSerializer.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" + +#include "Firestore/Port/ordered_code.h" +#include "Firestore/Port/string_util.h" NS_ASSUME_NONNULL_BEGIN @@ -102,10 +104,11 @@ static ReadOptions StandardReadOptions() { } - (FSTDocumentDictionary *)documentsMatchingQuery:(FSTQuery *)query { - // TODO(mikelehen): PERF: At least filter to the documents that match the path of the query. FSTDocumentDictionary *results = [FSTDocumentDictionary documentDictionary]; - std::string startKey = [FSTLevelDBRemoteDocumentKey keyPrefix]; + // Documents are ordered by key, so we can use a prefix scan to narrow down + // the documents we need to match the query against. + std::string startKey = [FSTLevelDBRemoteDocumentKey keyPrefixWithResourcePath:query.path]; std::unique_ptr<Iterator> it(_db->NewIterator(StandardReadOptions())); it->Seek(startKey); @@ -113,7 +116,9 @@ static ReadOptions StandardReadOptions() { for (; it->Valid() && [currentKey decodeKey:it->key()]; it->Next()) { FSTMaybeDocument *maybeDoc = [self decodedMaybeDocument:it->value() withKey:currentKey.documentKey]; - if ([maybeDoc isKindOfClass:[FSTDocument class]]) { + if (![query.path isPrefixOfPath:maybeDoc.key.path]) { + break; + } else if ([maybeDoc isKindOfClass:[FSTDocument class]]) { results = [results dictionaryBySettingObject:(FSTDocument *)maybeDoc forKey:maybeDoc.key]; } } diff --git a/Firestore/Source/Local/FSTLocalDocumentsView.h b/Firestore/Source/Local/FSTLocalDocumentsView.h index 60571c2..46830e7 100644 --- a/Firestore/Source/Local/FSTLocalDocumentsView.h +++ b/Firestore/Source/Local/FSTLocalDocumentsView.h @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKeySet.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" @class FSTDocumentKey; @class FSTMaybeDocument; diff --git a/Firestore/Source/Local/FSTLocalDocumentsView.m b/Firestore/Source/Local/FSTLocalDocumentsView.m index 0cad593..a6734c4 100644 --- a/Firestore/Source/Local/FSTLocalDocumentsView.m +++ b/Firestore/Source/Local/FSTLocalDocumentsView.m @@ -14,18 +14,18 @@ * limitations under the License. */ -#import "FSTLocalDocumentsView.h" - -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKey.h" -#import "FSTMutation.h" -#import "FSTMutationBatch.h" -#import "FSTMutationQueue.h" -#import "FSTQuery.h" -#import "FSTRemoteDocumentCache.h" -#import "FSTSnapshotVersion.h" +#import "Firestore/Source/Local/FSTLocalDocumentsView.h" + +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Local/FSTMutationQueue.h" +#import "Firestore/Source/Local/FSTRemoteDocumentCache.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLocalSerializer.m b/Firestore/Source/Local/FSTLocalSerializer.m index 58b09af..c71e9dd 100644 --- a/Firestore/Source/Local/FSTLocalSerializer.m +++ b/Firestore/Source/Local/FSTLocalSerializer.m @@ -14,19 +14,19 @@ * limitations under the License. */ -#import "FSTLocalSerializer.h" - -#import "Document.pbobjc.h" -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTFieldValue.h" -#import "FSTMutationBatch.h" -#import "FSTQuery.h" -#import "FSTQueryData.h" -#import "FSTSerializerBeta.h" -#import "MaybeDocument.pbobjc.h" -#import "Mutation.pbobjc.h" -#import "Target.pbobjc.h" +#import "Firestore/Source/Local/FSTLocalSerializer.h" + +#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h" +#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" +#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Util/FSTAssert.h" @interface FSTLocalSerializer () diff --git a/Firestore/Source/Local/FSTLocalStore.h b/Firestore/Source/Local/FSTLocalStore.h index 0fdc08e..19803ac 100644 --- a/Firestore/Source/Local/FSTLocalStore.h +++ b/Firestore/Source/Local/FSTLocalStore.h @@ -16,10 +16,10 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKeySet.h" -#import "FSTDocumentVersionDictionary.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" +#import "Firestore/Source/Model/FSTDocumentVersionDictionary.h" @class FSTLocalViewChanges; @class FSTLocalWriteResult; diff --git a/Firestore/Source/Local/FSTLocalStore.m b/Firestore/Source/Local/FSTLocalStore.m index d31712a..cde7104 100644 --- a/Firestore/Source/Local/FSTLocalStore.m +++ b/Firestore/Source/Local/FSTLocalStore.m @@ -14,32 +14,32 @@ * limitations under the License. */ -#import "FSTLocalStore.h" - -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKey.h" -#import "FSTGarbageCollector.h" -#import "FSTLocalDocumentsView.h" -#import "FSTLocalViewChanges.h" -#import "FSTLocalWriteResult.h" -#import "FSTLogger.h" -#import "FSTMutation.h" -#import "FSTMutationBatch.h" -#import "FSTMutationQueue.h" -#import "FSTPersistence.h" -#import "FSTQuery.h" -#import "FSTQueryCache.h" -#import "FSTQueryData.h" -#import "FSTReferenceSet.h" -#import "FSTRemoteDocumentCache.h" -#import "FSTRemoteDocumentChangeBuffer.h" -#import "FSTRemoteEvent.h" -#import "FSTSnapshotVersion.h" -#import "FSTTargetIDGenerator.h" -#import "FSTTimestamp.h" -#import "FSTUser.h" +#import "Firestore/Source/Local/FSTLocalStore.h" + +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTargetIDGenerator.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Local/FSTGarbageCollector.h" +#import "Firestore/Source/Local/FSTLocalDocumentsView.h" +#import "Firestore/Source/Local/FSTLocalViewChanges.h" +#import "Firestore/Source/Local/FSTLocalWriteResult.h" +#import "Firestore/Source/Local/FSTMutationQueue.h" +#import "Firestore/Source/Local/FSTPersistence.h" +#import "Firestore/Source/Local/FSTQueryCache.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Local/FSTReferenceSet.h" +#import "Firestore/Source/Local/FSTRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTLogger.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLocalViewChanges.h b/Firestore/Source/Local/FSTLocalViewChanges.h index d44959e..e391472 100644 --- a/Firestore/Source/Local/FSTLocalViewChanges.h +++ b/Firestore/Source/Local/FSTLocalViewChanges.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentKeySet.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" @class FSTDocumentKey; @class FSTDocumentSet; diff --git a/Firestore/Source/Local/FSTLocalViewChanges.m b/Firestore/Source/Local/FSTLocalViewChanges.m index 05407b2..9a7f445 100644 --- a/Firestore/Source/Local/FSTLocalViewChanges.m +++ b/Firestore/Source/Local/FSTLocalViewChanges.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTLocalViewChanges.h" +#import "Firestore/Source/Local/FSTLocalViewChanges.h" -#import "FSTDocument.h" -#import "FSTViewSnapshot.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" +#import "Firestore/Source/Model/FSTDocument.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLocalWriteResult.h b/Firestore/Source/Local/FSTLocalWriteResult.h index 4cd7d34..b6190aa 100644 --- a/Firestore/Source/Local/FSTLocalWriteResult.h +++ b/Firestore/Source/Local/FSTLocalWriteResult.h @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentDictionary.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTLocalWriteResult.m b/Firestore/Source/Local/FSTLocalWriteResult.m index 7586686..c1753fe 100644 --- a/Firestore/Source/Local/FSTLocalWriteResult.m +++ b/Firestore/Source/Local/FSTLocalWriteResult.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FSTLocalWriteResult.h" +#import "Firestore/Source/Local/FSTLocalWriteResult.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMemoryMutationQueue.h b/Firestore/Source/Local/FSTMemoryMutationQueue.h index 6d917b7..f0786cc 100644 --- a/Firestore/Source/Local/FSTMemoryMutationQueue.h +++ b/Firestore/Source/Local/FSTMemoryMutationQueue.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTMutationQueue.h" +#import "Firestore/Source/Local/FSTMutationQueue.h" @protocol FSTGarbageCollector; diff --git a/Firestore/Source/Local/FSTMemoryMutationQueue.m b/Firestore/Source/Local/FSTMemoryMutationQueue.m index 6118ad6..b155264 100644 --- a/Firestore/Source/Local/FSTMemoryMutationQueue.m +++ b/Firestore/Source/Local/FSTMemoryMutationQueue.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "FSTMemoryMutationQueue.h" - -#import "FSTAssert.h" -#import "FSTComparison.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentReference.h" -#import "FSTMutation.h" -#import "FSTMutationBatch.h" -#import "FSTPath.h" -#import "FSTQuery.h" +#import "Firestore/Source/Local/FSTMemoryMutationQueue.h" + +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Local/FSTDocumentReference.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTComparison.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMemoryPersistence.h b/Firestore/Source/Local/FSTMemoryPersistence.h index c52962a..a1c4f13 100644 --- a/Firestore/Source/Local/FSTMemoryPersistence.h +++ b/Firestore/Source/Local/FSTMemoryPersistence.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTPersistence.h" +#import "Firestore/Source/Local/FSTPersistence.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMemoryPersistence.m b/Firestore/Source/Local/FSTMemoryPersistence.m index 9caf3e7..e301820 100644 --- a/Firestore/Source/Local/FSTMemoryPersistence.m +++ b/Firestore/Source/Local/FSTMemoryPersistence.m @@ -14,15 +14,15 @@ * limitations under the License. */ -#import "FSTMemoryPersistence.h" - -#import "FSTAssert.h" -#import "FSTMemoryMutationQueue.h" -#import "FSTMemoryQueryCache.h" -#import "FSTMemoryRemoteDocumentCache.h" -#import "FSTUser.h" -#import "FSTWriteGroup.h" -#import "FSTWriteGroupTracker.h" +#import "Firestore/Source/Local/FSTMemoryPersistence.h" + +#import "Firestore/Source/Auth/FSTUser.h" +#import "Firestore/Source/Local/FSTMemoryMutationQueue.h" +#import "Firestore/Source/Local/FSTMemoryQueryCache.h" +#import "Firestore/Source/Local/FSTMemoryRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Local/FSTWriteGroupTracker.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMemoryQueryCache.h b/Firestore/Source/Local/FSTMemoryQueryCache.h index 58e0133..98f0277 100644 --- a/Firestore/Source/Local/FSTMemoryQueryCache.h +++ b/Firestore/Source/Local/FSTMemoryQueryCache.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTQueryCache.h" +#import "Firestore/Source/Local/FSTQueryCache.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMemoryQueryCache.m b/Firestore/Source/Local/FSTMemoryQueryCache.m index 1466caa..8d37bcb 100644 --- a/Firestore/Source/Local/FSTMemoryQueryCache.m +++ b/Firestore/Source/Local/FSTMemoryQueryCache.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "FSTMemoryQueryCache.h" +#import "Firestore/Source/Local/FSTMemoryQueryCache.h" -#import "FSTQuery.h" -#import "FSTQueryData.h" -#import "FSTReferenceSet.h" -#import "FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Local/FSTReferenceSet.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.h b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.h index aca0ca1..d718a04 100644 --- a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.h +++ b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTRemoteDocumentCache.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.m b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.m index 175be43..9bbc047 100644 --- a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.m +++ b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.m @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "FSTMemoryRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTMemoryRemoteDocumentCache.h" -#import "FSTDocument.h" -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKey.h" -#import "FSTPath.h" -#import "FSTQuery.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTPath.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTMutationQueue.h b/Firestore/Source/Local/FSTMutationQueue.h index c822b96..a1eddd4 100644 --- a/Firestore/Source/Local/FSTMutationQueue.h +++ b/Firestore/Source/Local/FSTMutationQueue.h @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "FSTGarbageCollector.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Local/FSTGarbageCollector.h" @class FSTDocumentKey; @class FSTMutation; diff --git a/Firestore/Source/Local/FSTNoOpGarbageCollector.h b/Firestore/Source/Local/FSTNoOpGarbageCollector.h index 8873a1b..c9b5862 100644 --- a/Firestore/Source/Local/FSTNoOpGarbageCollector.h +++ b/Firestore/Source/Local/FSTNoOpGarbageCollector.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTGarbageCollector.h" +#import "Firestore/Source/Local/FSTGarbageCollector.h" @class FSTDocumentKey; diff --git a/Firestore/Source/Local/FSTNoOpGarbageCollector.m b/Firestore/Source/Local/FSTNoOpGarbageCollector.m index 6e035ab..e03b599 100644 --- a/Firestore/Source/Local/FSTNoOpGarbageCollector.m +++ b/Firestore/Source/Local/FSTNoOpGarbageCollector.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FSTNoOpGarbageCollector.h" +#import "Firestore/Source/Local/FSTNoOpGarbageCollector.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTQueryCache.h b/Firestore/Source/Local/FSTQueryCache.h index 87ee342..e0cf4c8 100644 --- a/Firestore/Source/Local/FSTQueryCache.h +++ b/Firestore/Source/Local/FSTQueryCache.h @@ -16,9 +16,9 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentKeySet.h" -#import "FSTGarbageCollector.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Local/FSTGarbageCollector.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" @class FSTDocumentKey; @class FSTDocumentSet; diff --git a/Firestore/Source/Local/FSTQueryData.h b/Firestore/Source/Local/FSTQueryData.h index 060fd78..048bfad 100644 --- a/Firestore/Source/Local/FSTQueryData.h +++ b/Firestore/Source/Local/FSTQueryData.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" @class FSTQuery; @class FSTSnapshotVersion; diff --git a/Firestore/Source/Local/FSTQueryData.m b/Firestore/Source/Local/FSTQueryData.m index 438f229..080f136 100644 --- a/Firestore/Source/Local/FSTQueryData.m +++ b/Firestore/Source/Local/FSTQueryData.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTQueryData.h" +#import "Firestore/Source/Local/FSTQueryData.h" -#import "FSTQuery.h" -#import "FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTReferenceSet.h b/Firestore/Source/Local/FSTReferenceSet.h index e4f50a7..66285d9 100644 --- a/Firestore/Source/Local/FSTReferenceSet.h +++ b/Firestore/Source/Local/FSTReferenceSet.h @@ -16,9 +16,9 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentKeySet.h" -#import "FSTGarbageCollector.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Local/FSTGarbageCollector.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" @class FSTDocumentKey; diff --git a/Firestore/Source/Local/FSTReferenceSet.m b/Firestore/Source/Local/FSTReferenceSet.m index 2326ded..2acd64b 100644 --- a/Firestore/Source/Local/FSTReferenceSet.m +++ b/Firestore/Source/Local/FSTReferenceSet.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTReferenceSet.h" +#import "Firestore/Source/Local/FSTReferenceSet.h" -#import "FSTDocumentKey.h" -#import "FSTDocumentReference.h" +#import "Firestore/Source/Local/FSTDocumentReference.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTRemoteDocumentCache.h b/Firestore/Source/Local/FSTRemoteDocumentCache.h index 8979455..fa42ce5 100644 --- a/Firestore/Source/Local/FSTRemoteDocumentCache.h +++ b/Firestore/Source/Local/FSTRemoteDocumentCache.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" @class FSTDocumentKey; @class FSTMaybeDocument; diff --git a/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.m b/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.m index 12a68ff..bca587a 100644 --- a/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.m +++ b/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "FSTRemoteDocumentChangeBuffer.h" +#import "Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.h" -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTRemoteDocumentCache.h" +#import "Firestore/Source/Local/FSTRemoteDocumentCache.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Local/FSTWriteGroup.h b/Firestore/Source/Local/FSTWriteGroup.h index 21482af..5ea0387 100644 --- a/Firestore/Source/Local/FSTWriteGroup.h +++ b/Firestore/Source/Local/FSTWriteGroup.h @@ -19,7 +19,7 @@ #ifdef __cplusplus #include <memory> -#include "StringView.h" +#include "Firestore/Source/Local/StringView.h" namespace leveldb { class DB; diff --git a/Firestore/Source/Local/FSTWriteGroup.mm b/Firestore/Source/Local/FSTWriteGroup.mm index 7ddf642..6859d53 100644 --- a/Firestore/Source/Local/FSTWriteGroup.mm +++ b/Firestore/Source/Local/FSTWriteGroup.mm @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "FSTWriteGroup.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" #import <Protobuf/GPBProtocolBuffers.h> #include <leveldb/db.h> #include <leveldb/write_batch.h> -#import "FSTAssert.h" -#import "FSTLevelDBKey.h" +#import "Firestore/Source/Local/FSTLevelDBKey.h" +#import "Firestore/Source/Util/FSTAssert.h" -#include "ordered_code.h" +#include "Firestore/Port/ordered_code.h" using Firestore::OrderedCode; using Firestore::StringView; diff --git a/Firestore/Source/Local/FSTWriteGroupTracker.m b/Firestore/Source/Local/FSTWriteGroupTracker.m index 1c6c84d..7e3bf60 100644 --- a/Firestore/Source/Local/FSTWriteGroupTracker.m +++ b/Firestore/Source/Local/FSTWriteGroupTracker.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTWriteGroupTracker.h" +#import "Firestore/Source/Local/FSTWriteGroupTracker.h" -#import "FSTAssert.h" -#import "FSTWriteGroup.h" +#import "Firestore/Source/Local/FSTWriteGroup.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTDatabaseID.m b/Firestore/Source/Model/FSTDatabaseID.m index bf4b417..4d0448a 100644 --- a/Firestore/Source/Model/FSTDatabaseID.m +++ b/Firestore/Source/Model/FSTDatabaseID.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" -#import "FSTAssert.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTDocument.m b/Firestore/Source/Model/FSTDocument.m index 5146d46..bf416e7 100644 --- a/Firestore/Source/Model/FSTDocument.m +++ b/Firestore/Source/Model/FSTDocument.m @@ -14,13 +14,13 @@ * limitations under the License. */ -#import "FSTDocument.h" +#import "Firestore/Source/Model/FSTDocument.h" -#import "FSTAssert.h" -#import "FSTDocumentKey.h" -#import "FSTFieldValue.h" -#import "FSTPath.h" -#import "FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTDocumentDictionary.h b/Firestore/Source/Model/FSTDocumentDictionary.h index 8ae8e01..f4e4ba1 100644 --- a/Firestore/Source/Model/FSTDocumentDictionary.h +++ b/Firestore/Source/Model/FSTDocumentDictionary.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" @class FSTDocument; @class FSTDocumentKey; diff --git a/Firestore/Source/Model/FSTDocumentDictionary.m b/Firestore/Source/Model/FSTDocumentDictionary.m index 67e3ae7..362af54 100644 --- a/Firestore/Source/Model/FSTDocumentDictionary.m +++ b/Firestore/Source/Model/FSTDocumentDictionary.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" -#import "FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTDocumentKey.m b/Firestore/Source/Model/FSTDocumentKey.m index a412b13..a382a55 100644 --- a/Firestore/Source/Model/FSTDocumentKey.m +++ b/Firestore/Source/Model/FSTDocumentKey.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" -#import "FSTAssert.h" -#import "FSTFirestoreClient.h" -#import "FSTPath.h" +#import "Firestore/Source/Core/FSTFirestoreClient.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTDocumentKeySet.h b/Firestore/Source/Model/FSTDocumentKeySet.h index 7352985..80f6624 100644 --- a/Firestore/Source/Model/FSTDocumentKeySet.h +++ b/Firestore/Source/Model/FSTDocumentKeySet.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTImmutableSortedSet.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedSet.h" @class FSTDocumentKey; diff --git a/Firestore/Source/Model/FSTDocumentKeySet.m b/Firestore/Source/Model/FSTDocumentKeySet.m index 54f1b2c..f07b785 100644 --- a/Firestore/Source/Model/FSTDocumentKeySet.m +++ b/Firestore/Source/Model/FSTDocumentKeySet.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "FSTDocumentKeySet.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" -#import "FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTDocumentSet.h b/Firestore/Source/Model/FSTDocumentSet.h index 7457ea3..a7f8c4a 100644 --- a/Firestore/Source/Model/FSTDocumentSet.h +++ b/Firestore/Source/Model/FSTDocumentSet.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" @class FSTDocument; @class FSTDocumentKey; diff --git a/Firestore/Source/Model/FSTDocumentSet.m b/Firestore/Source/Model/FSTDocumentSet.m index 94b7b58..c4c0f49 100644 --- a/Firestore/Source/Model/FSTDocumentSet.m +++ b/Firestore/Source/Model/FSTDocumentSet.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "FSTDocumentSet.h" +#import "Firestore/Source/Model/FSTDocumentSet.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTImmutableSortedSet.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedSet.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTDocumentVersionDictionary.h b/Firestore/Source/Model/FSTDocumentVersionDictionary.h index f94545f..674614e 100644 --- a/Firestore/Source/Model/FSTDocumentVersionDictionary.h +++ b/Firestore/Source/Model/FSTDocumentVersionDictionary.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" @class FSTDocumentKey; @class FSTSnapshotVersion; diff --git a/Firestore/Source/Model/FSTDocumentVersionDictionary.m b/Firestore/Source/Model/FSTDocumentVersionDictionary.m index 0eaf9f8..870e082 100644 --- a/Firestore/Source/Model/FSTDocumentVersionDictionary.m +++ b/Firestore/Source/Model/FSTDocumentVersionDictionary.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTDocumentVersionDictionary.h" +#import "Firestore/Source/Model/FSTDocumentVersionDictionary.h" -#import "FSTDocumentKey.h" -#import "FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTFieldValue.h b/Firestore/Source/Model/FSTFieldValue.h index cbf7e3e..6de9793 100644 --- a/Firestore/Source/Model/FSTFieldValue.h +++ b/Firestore/Source/Model/FSTFieldValue.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" @class FSTDatabaseID; @class FSTDocumentKey; diff --git a/Firestore/Source/Model/FSTFieldValue.m b/Firestore/Source/Model/FSTFieldValue.m index 7f96a3c..95ad306 100644 --- a/Firestore/Source/Model/FSTFieldValue.m +++ b/Firestore/Source/Model/FSTFieldValue.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "FSTFieldValue.h" - -#import "FIRGeoPoint+Internal.h" -#import "FSTAssert.h" -#import "FSTClasses.h" -#import "FSTComparison.h" -#import "FSTDatabaseID.h" -#import "FSTDocumentKey.h" -#import "FSTPath.h" -#import "FSTTimestamp.h" +#import "Firestore/Source/Model/FSTFieldValue.h" + +#import "Firestore/Source/API/FIRGeoPoint+Internal.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/Source/Util/FSTComparison.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTMutation.m b/Firestore/Source/Model/FSTMutation.m index 9704fde..5b47280 100644 --- a/Firestore/Source/Model/FSTMutation.m +++ b/Firestore/Source/Model/FSTMutation.m @@ -14,16 +14,16 @@ * limitations under the License. */ -#import "FSTMutation.h" - -#import "FSTAssert.h" -#import "FSTClasses.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTFieldValue.h" -#import "FSTPath.h" -#import "FSTSnapshotVersion.h" -#import "FSTTimestamp.h" +#import "Firestore/Source/Model/FSTMutation.h" + +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTMutationBatch.h b/Firestore/Source/Model/FSTMutationBatch.h index cbc31b6..145adfa 100644 --- a/Firestore/Source/Model/FSTMutationBatch.h +++ b/Firestore/Source/Model/FSTMutationBatch.h @@ -16,9 +16,9 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentKeySet.h" -#import "FSTDocumentVersionDictionary.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" +#import "Firestore/Source/Model/FSTDocumentVersionDictionary.h" @class FSTMutation; @class FSTTimestamp; diff --git a/Firestore/Source/Model/FSTMutationBatch.m b/Firestore/Source/Model/FSTMutationBatch.m index ed0e659..3677908 100644 --- a/Firestore/Source/Model/FSTMutationBatch.m +++ b/Firestore/Source/Model/FSTMutationBatch.m @@ -14,14 +14,14 @@ * limitations under the License. */ -#import "FSTMutationBatch.h" - -#import "FSTAssert.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTMutation.h" -#import "FSTSnapshotVersion.h" -#import "FSTTimestamp.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" + +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Model/FSTPath.m b/Firestore/Source/Model/FSTPath.m index 0588612..b236107 100644 --- a/Firestore/Source/Model/FSTPath.m +++ b/Firestore/Source/Model/FSTPath.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "FSTPath.h" +#import "Firestore/Source/Model/FSTPath.h" -#import "FSTAssert.h" -#import "FSTClasses.h" -#import "FSTDocumentKey.h" -#import "FSTUsageValidation.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/Source/Util/FSTUsageValidation.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Public/FIRCollectionReference.h b/Firestore/Source/Public/FIRCollectionReference.h index 11cb969..ba3389f 100644 --- a/Firestore/Source/Public/FIRCollectionReference.h +++ b/Firestore/Source/Public/FIRCollectionReference.h @@ -16,7 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" #import "FIRQuery.h" NS_ASSUME_NONNULL_BEGIN @@ -27,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * A `FIRCollectionReference` object can be used for adding documents, getting document references, * and querying for documents (using the methods inherited from `FIRQuery`). */ -FIR_SWIFT_NAME(CollectionReference) +NS_SWIFT_NAME(CollectionReference) @interface FIRCollectionReference : FIRQuery /** */ @@ -53,7 +52,7 @@ FIR_SWIFT_NAME(CollectionReference) * * @return A FIRDocumentReference pointing to a new document with an auto-generated ID. */ -- (FIRDocumentReference *)documentWithAutoID FIR_SWIFT_NAME(document()); +- (FIRDocumentReference *)documentWithAutoID NS_SWIFT_NAME(document()); /** * Gets a `FIRDocumentReference` referring to the document at the specified path, relative to this @@ -64,7 +63,7 @@ FIR_SWIFT_NAME(CollectionReference) * * @return The `FIRDocumentReference` for the specified document path. */ -- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath FIR_SWIFT_NAME(document(_:)); +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath NS_SWIFT_NAME(document(_:)); /** * Add a new document to this collection with the specified data, assigning it a document ID @@ -75,7 +74,7 @@ FIR_SWIFT_NAME(CollectionReference) * @return A `FIRDocumentReference` pointing to the newly created document. */ - (FIRDocumentReference *)addDocumentWithData:(NSDictionary<NSString *, id> *)data - FIR_SWIFT_NAME(addDocument(data:)); + NS_SWIFT_NAME(addDocument(data:)); /** * Add a new document to this collection with the specified data, assigning it a document ID @@ -87,11 +86,11 @@ FIR_SWIFT_NAME(CollectionReference) * @return A `FIRDocumentReference` pointing to the newly created document. */ // clang-format off -// clang-format breaks the FIR_SWIFT_NAME attribute +// clang-format breaks the NS_SWIFT_NAME attribute - (FIRDocumentReference *)addDocumentWithData:(NSDictionary<NSString *, id> *)data completion: (nullable void (^)(NSError *_Nullable error))completion - FIR_SWIFT_NAME(addDocument(data:completion:)); + NS_SWIFT_NAME(addDocument(data:completion:)); // clang-format on @end diff --git a/Firestore/Source/Public/FIRDocumentChange.h b/Firestore/Source/Public/FIRDocumentChange.h index 674e3b2..022c81b 100644 --- a/Firestore/Source/Public/FIRDocumentChange.h +++ b/Firestore/Source/Public/FIRDocumentChange.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentSnapshot; @@ -33,13 +31,13 @@ typedef NS_ENUM(NSInteger, FIRDocumentChangeType) { * the query. */ FIRDocumentChangeTypeRemoved -} FIR_SWIFT_NAME(DocumentChangeType); +} NS_SWIFT_NAME(DocumentChangeType); /** * A `FIRDocumentChange` represents a change to the documents matching a query. It contains the * document affected and the type of change that occurred (added, modified, or removed). */ -FIR_SWIFT_NAME(DocumentChange) +NS_SWIFT_NAME(DocumentChange) @interface FIRDocumentChange : NSObject /** */ diff --git a/Firestore/Source/Public/FIRDocumentReference.h b/Firestore/Source/Public/FIRDocumentReference.h index 03340c1..bd6d7b8 100644 --- a/Firestore/Source/Public/FIRDocumentReference.h +++ b/Firestore/Source/Public/FIRDocumentReference.h @@ -16,7 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" #import "FIRListenerRegistration.h" @class FIRFirestore; @@ -30,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * Options for use with `[FIRDocumentReference addSnapshotListener]` to control the behavior of the * snapshot listener. */ -FIR_SWIFT_NAME(DocumentListenOptions) +NS_SWIFT_NAME(DocumentListenOptions) @interface FIRDocumentListenOptions : NSObject + (instancetype)options NS_SWIFT_UNAVAILABLE("Use initializer"); @@ -47,7 +46,7 @@ FIR_SWIFT_NAME(DocumentListenOptions) * @return The receiver is returned for optional method chaining. */ - (instancetype)includeMetadataChanges:(BOOL)includeMetadataChanges - FIR_SWIFT_NAME(includeMetadataChanges(_:)); + NS_SWIFT_NAME(includeMetadataChanges(_:)); @end @@ -60,7 +59,7 @@ typedef void (^FIRDocumentSnapshotBlock)(FIRDocumentSnapshot *_Nullable snapshot * may or may not exist. A `FIRDocumentReference` can also be used to create a * `FIRCollectionReference` to a subcollection. */ -FIR_SWIFT_NAME(DocumentReference) +NS_SWIFT_NAME(DocumentReference) @interface FIRDocumentReference : NSObject /** */ @@ -92,7 +91,7 @@ FIR_SWIFT_NAME(DocumentReference) * @return The `FIRCollectionReference` at the specified _collectionPath_. */ - (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath - FIR_SWIFT_NAME(collection(_:)); + NS_SWIFT_NAME(collection(_:)); #pragma mark - Writing Data @@ -166,7 +165,7 @@ FIR_SWIFT_NAME(DocumentReference) // NOTE: this is named 'deleteDocument' because 'delete' is a keyword in Objective-C++. /** Deletes the document referred to by this `FIRDocumentReference`. */ // clang-format off -- (void)deleteDocument FIR_SWIFT_NAME(delete()); +- (void)deleteDocument NS_SWIFT_NAME(delete()); // clang-format on /** @@ -176,7 +175,7 @@ FIR_SWIFT_NAME(DocumentReference) */ // clang-format off - (void)deleteDocumentWithCompletion:(nullable void (^)(NSError *_Nullable error))completion - FIR_SWIFT_NAME(delete(completion:)); + NS_SWIFT_NAME(delete(completion:)); // clang-format on #pragma mark - Retrieving Data @@ -187,7 +186,7 @@ FIR_SWIFT_NAME(DocumentReference) * @param completion a block to execute once the document has been successfully read. */ - (void)getDocumentWithCompletion:(FIRDocumentSnapshotBlock)completion - FIR_SWIFT_NAME(getDocument(completion:)); + NS_SWIFT_NAME(getDocument(completion:)); /** * Attaches a listener for DocumentSnapshot events. @@ -197,7 +196,7 @@ FIR_SWIFT_NAME(DocumentReference) * @return A FIRListenerRegistration that can be used to remove this listener. */ - (id<FIRListenerRegistration>)addSnapshotListener:(FIRDocumentSnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(_:)); + NS_SWIFT_NAME(addSnapshotListener(_:)); /** * Attaches a listener for DocumentSnapshot events. @@ -211,7 +210,7 @@ FIR_SWIFT_NAME(DocumentReference) - (id<FIRListenerRegistration>)addSnapshotListenerWithOptions: (nullable FIRDocumentListenOptions *)options listener:(FIRDocumentSnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(options:listener:)); + NS_SWIFT_NAME(addSnapshotListener(options:listener:)); // clang-format on @end diff --git a/Firestore/Source/Public/FIRDocumentSnapshot.h b/Firestore/Source/Public/FIRDocumentSnapshot.h index e923e3e..3e67c25 100644 --- a/Firestore/Source/Public/FIRDocumentSnapshot.h +++ b/Firestore/Source/Public/FIRDocumentSnapshot.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - @class FIRDocumentReference; @class FIRSnapshotMetadata; @@ -28,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * can be extracted with the `data` property or by using subscript syntax to access a specific * field. */ -FIR_SWIFT_NAME(DocumentSnapshot) +NS_SWIFT_NAME(DocumentSnapshot) @interface FIRDocumentSnapshot : NSObject /** */ diff --git a/Firestore/Source/Public/FIRFieldPath.h b/Firestore/Source/Public/FIRFieldPath.h index b80eda7..3445f2e 100644 --- a/Firestore/Source/Public/FIRFieldPath.h +++ b/Firestore/Source/Public/FIRFieldPath.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @@ -25,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN * (referring to a top level field in the document), or a list of field names (referring to a nested * field in the document). */ -FIR_SWIFT_NAME(FieldPath) +NS_SWIFT_NAME(FieldPath) @interface FIRFieldPath : NSObject <NSCopying> - (instancetype)init NS_UNAVAILABLE; @@ -37,7 +35,7 @@ FIR_SWIFT_NAME(FieldPath) * @param fieldNames A list of field names. * @return A `FieldPath` that points to a field location in a document. */ -- (instancetype)initWithFields:(NSArray<NSString *> *)fieldNames FIR_SWIFT_NAME(init(_:)); +- (instancetype)initWithFields:(NSArray<NSString *> *)fieldNames NS_SWIFT_NAME(init(_:)); /** * A special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to diff --git a/Firestore/Source/Public/FIRFieldValue.h b/Firestore/Source/Public/FIRFieldValue.h index f7d19f0..11a0da0 100644 --- a/Firestore/Source/Public/FIRFieldValue.h +++ b/Firestore/Source/Public/FIRFieldValue.h @@ -16,14 +16,12 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** * Sentinel values that can be used when writing document fields with setData() or updateData(). */ -FIR_SWIFT_NAME(FieldValue) +NS_SWIFT_NAME(FieldValue) @interface FIRFieldValue : NSObject /** */ @@ -31,14 +29,14 @@ FIR_SWIFT_NAME(FieldValue) /** Used with updateData() to mark a field for deletion. */ // clang-format off -+ (instancetype)fieldValueForDelete FIR_SWIFT_NAME(delete()); ++ (instancetype)fieldValueForDelete NS_SWIFT_NAME(delete()); // clang-format on /** * Used with setData() or updateData() to include a server-generated timestamp in the written * data. */ -+ (instancetype)fieldValueForServerTimestamp FIR_SWIFT_NAME(serverTimestamp()); ++ (instancetype)fieldValueForServerTimestamp NS_SWIFT_NAME(serverTimestamp()); @end diff --git a/Firestore/Source/Public/FIRFirestore.h b/Firestore/Source/Public/FIRFirestore.h index c31fef6..0935917 100644 --- a/Firestore/Source/Public/FIRFirestore.h +++ b/Firestore/Source/Public/FIRFirestore.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - @class FIRApp; @class FIRCollectionReference; @class FIRDocumentReference; @@ -31,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * `FIRFirestore` represents a Firestore Database and is the entry point for all Firestore * operations. */ -FIR_SWIFT_NAME(Firestore) +NS_SWIFT_NAME(Firestore) @interface FIRFirestore : NSObject #pragma mark - Initializing @@ -44,7 +42,7 @@ FIR_SWIFT_NAME(Firestore) * * @return The `FIRFirestore` instance. */ -+ (instancetype)firestore FIR_SWIFT_NAME(firestore()); ++ (instancetype)firestore NS_SWIFT_NAME(firestore()); /** * Creates, caches, and returns a `FIRFirestore` object for the specified _app_. Each subsequent @@ -56,7 +54,7 @@ FIR_SWIFT_NAME(Firestore) * * @return The `FIRFirestore` instance. */ -+ (instancetype)firestoreForApp:(FIRApp *)app FIR_SWIFT_NAME(firestore(app:)); ++ (instancetype)firestoreForApp:(FIRApp *)app NS_SWIFT_NAME(firestore(app:)); /** * Custom settings used to configure this `FIRFirestore` object. @@ -80,7 +78,7 @@ FIR_SWIFT_NAME(Firestore) * @return The `FIRCollectionReference` at the specified _collectionPath_. */ - (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath - FIR_SWIFT_NAME(collection(_:)); + NS_SWIFT_NAME(collection(_:)); /** * Gets a `FIRDocumentReference` referring to the document at the specified path within the @@ -91,7 +89,7 @@ FIR_SWIFT_NAME(Firestore) * * @return The `FIRDocumentReference` for the specified _documentPath_. */ -- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath FIR_SWIFT_NAME(document(_:)); +- (FIRDocumentReference *)documentWithPath:(NSString *)documentPath NS_SWIFT_NAME(document(_:)); #pragma mark - Transactions and Write Batches diff --git a/Firestore/Source/Public/FIRFirestoreErrors.h b/Firestore/Source/Public/FIRFirestoreErrors.h index f2e19d9..968391c 100644 --- a/Firestore/Source/Public/FIRFirestoreErrors.h +++ b/Firestore/Source/Public/FIRFirestoreErrors.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** The Cloud Firestore error domain. */ -FOUNDATION_EXPORT NSString *const FIRFirestoreErrorDomain FIR_SWIFT_NAME(FirestoreErrorDomain); +FOUNDATION_EXPORT NSString *const FIRFirestoreErrorDomain NS_SWIFT_NAME(FirestoreErrorDomain); /** Error codes used by Cloud Firestore. */ typedef NS_ENUM(NSInteger, FIRFirestoreErrorCode) { @@ -100,6 +98,6 @@ typedef NS_ENUM(NSInteger, FIRFirestoreErrorCode) { /** The request does not have valid authentication credentials for the operation. */ FIRFirestoreErrorCodeUnauthenticated = 16 -} FIR_SWIFT_NAME(FirestoreErrorCode); +} NS_SWIFT_NAME(FirestoreErrorCode); NS_ASSUME_NONNULL_END diff --git a/Firestore/Source/Public/FIRFirestoreSettings.h b/Firestore/Source/Public/FIRFirestoreSettings.h index 7097e60..7a1f2a3 100644 --- a/Firestore/Source/Public/FIRFirestoreSettings.h +++ b/Firestore/Source/Public/FIRFirestoreSettings.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** Settings used to configure a `FIRFirestore` instance. */ -FIR_SWIFT_NAME(FirestoreSettings) +NS_SWIFT_NAME(FirestoreSettings) @interface FIRFirestoreSettings : NSObject <NSCopying> /** diff --git a/Firestore/Source/Public/FIRGeoPoint.h b/Firestore/Source/Public/FIRGeoPoint.h index de409b5..ee7a7ea 100644 --- a/Firestore/Source/Public/FIRGeoPoint.h +++ b/Firestore/Source/Public/FIRGeoPoint.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @@ -27,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN * Latitude values are in the range of [-90, 90]. * Longitude values are in the range of [-180, 180]. */ -FIR_SWIFT_NAME(GeoPoint) +NS_SWIFT_NAME(GeoPoint) @interface FIRGeoPoint : NSObject <NSCopying> /** */ diff --git a/Firestore/Source/Public/FIRListenerRegistration.h b/Firestore/Source/Public/FIRListenerRegistration.h index 93df407..c3a16cd 100644 --- a/Firestore/Source/Public/FIRListenerRegistration.h +++ b/Firestore/Source/Public/FIRListenerRegistration.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** Represents a listener that can be removed by calling remove. */ -FIR_SWIFT_NAME(ListenerRegistration) +NS_SWIFT_NAME(ListenerRegistration) @protocol FIRListenerRegistration <NSObject> /** diff --git a/Firestore/Source/Public/FIRQuery.h b/Firestore/Source/Public/FIRQuery.h index 5c5546d..0f3aeed 100644 --- a/Firestore/Source/Public/FIRQuery.h +++ b/Firestore/Source/Public/FIRQuery.h @@ -16,7 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" #import "FIRListenerRegistration.h" @class FIRFieldPath; @@ -30,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN * Options for use with `[FIRQuery addSnapshotListener]` to control the behavior of the snapshot * listener. */ -FIR_SWIFT_NAME(QueryListenOptions) +NS_SWIFT_NAME(QueryListenOptions) @interface FIRQueryListenOptions : NSObject + (instancetype)options NS_SWIFT_UNAVAILABLE("Use initializer"); @@ -49,7 +48,7 @@ FIR_SWIFT_NAME(QueryListenOptions) * @return The receiver is returned for optional method chaining. */ - (instancetype)includeQueryMetadataChanges:(BOOL)includeQueryMetadataChanges - FIR_SWIFT_NAME(includeQueryMetadataChanges(_:)); + NS_SWIFT_NAME(includeQueryMetadataChanges(_:)); @property(nonatomic, assign, readonly) BOOL includeDocumentMetadataChanges; @@ -62,7 +61,7 @@ FIR_SWIFT_NAME(QueryListenOptions) * @return The receiver is returned for optional method chaining. */ - (instancetype)includeDocumentMetadataChanges:(BOOL)includeDocumentMetadataChanges - FIR_SWIFT_NAME(includeDocumentMetadataChanges(_:)); + NS_SWIFT_NAME(includeDocumentMetadataChanges(_:)); @end @@ -73,7 +72,7 @@ typedef void (^FIRQuerySnapshotBlock)(FIRQuerySnapshot *_Nullable snapshot, * A `FIRQuery` refers to a Query which you can read or listen to. You can also construct * refined `FIRQuery` objects by adding filters and ordering. */ -FIR_SWIFT_NAME(Query) +NS_SWIFT_NAME(Query) @interface FIRQuery : NSObject /** */ - (id)init __attribute__((unavailable("FIRQuery cannot be created directly."))); @@ -89,7 +88,7 @@ FIR_SWIFT_NAME(Query) * documentSet will be `nil` only if error is `non-nil`. */ - (void)getDocumentsWithCompletion:(FIRQuerySnapshotBlock)completion - FIR_SWIFT_NAME(getDocuments(completion:)); + NS_SWIFT_NAME(getDocuments(completion:)); /** * Attaches a listener for QuerySnapshot events. @@ -99,7 +98,7 @@ FIR_SWIFT_NAME(Query) * @return A FIRListenerRegistration that can be used to remove this listener. */ - (id<FIRListenerRegistration>)addSnapshotListener:(FIRQuerySnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(_:)); + NS_SWIFT_NAME(addSnapshotListener(_:)); /** * Attaches a listener for QuerySnapshot events. @@ -113,7 +112,7 @@ FIR_SWIFT_NAME(Query) - (id<FIRListenerRegistration>)addSnapshotListenerWithOptions: (nullable FIRQueryListenOptions *)options listener:(FIRQuerySnapshotBlock)listener - FIR_SWIFT_NAME(addSnapshotListener(options:listener:)); + NS_SWIFT_NAME(addSnapshotListener(options:listener:)); // clang-format on #pragma mark - Filtering Data @@ -128,7 +127,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isEqualTo:)); + isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); // clang-format on /** @@ -142,7 +141,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isEqualTo:)); + isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); // clang-format on /** @@ -156,7 +155,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isLessThan:(id)value FIR_SWIFT_NAME(whereField(_:isLessThan:)); + isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); // clang-format on /** @@ -170,7 +169,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isLessThan:(id)value FIR_SWIFT_NAME(whereField(_:isLessThan:)); + isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); // clang-format on /** @@ -184,7 +183,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isLessThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); + isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); // clang-format on /** @@ -198,7 +197,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isLessThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); + isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); // clang-format on /** @@ -212,7 +211,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isGreaterThan:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThan:)); + isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); // clang-format on /** @@ -226,7 +225,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isGreaterThan:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThan:)); + isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); // clang-format on /** @@ -240,7 +239,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereField:(NSString *)field - isGreaterThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); + isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); // clang-format on /** @@ -254,7 +253,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isGreaterThanOrEqualTo:(id)value FIR_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); + isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); // clang-format on #pragma mark - Sorting Data @@ -265,7 +264,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryOrderedByField:(NSString *)field FIR_SWIFT_NAME(order(by:)); +- (FIRQuery *)queryOrderedByField:(NSString *)field NS_SWIFT_NAME(order(by:)); /** * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field. @@ -274,7 +273,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path FIR_SWIFT_NAME(order(by:)); +- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path NS_SWIFT_NAME(order(by:)); /** * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field, @@ -287,7 +286,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryOrderedByField:(NSString *)field - descending:(BOOL)descending FIR_SWIFT_NAME(order(by:descending:)); + descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); // clang-format on /** @@ -301,7 +300,7 @@ FIR_SWIFT_NAME(Query) */ // clang-format off - (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path - descending:(BOOL)descending FIR_SWIFT_NAME(order(by:descending:)); + descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); // clang-format on #pragma mark - Limiting Data @@ -313,7 +312,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryLimitedTo:(NSInteger)limit FIR_SWIFT_NAME(limit(to:)); +- (FIRQuery *)queryLimitedTo:(NSInteger)limit NS_SWIFT_NAME(limit(to:)); #pragma mark - Choosing Endpoints /** @@ -326,7 +325,7 @@ FIR_SWIFT_NAME(Query) * @return The created `FIRQuery`. */ - (FIRQuery *)queryStartingAtDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(start(atDocument:)); + NS_SWIFT_NAME(start(atDocument:)); /** * Creates and returns a new `FIRQuery` that starts at the provided fields relative to the order of @@ -337,7 +336,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryStartingAtValues:(NSArray *)fieldValues FIR_SWIFT_NAME(start(at:)); +- (FIRQuery *)queryStartingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(at:)); /** * Creates and returns a new `FIRQuery` that starts after the provided document (exclusive). The @@ -349,7 +348,7 @@ FIR_SWIFT_NAME(Query) * @return The created `FIRQuery`. */ - (FIRQuery *)queryStartingAfterDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(start(afterDocument:)); + NS_SWIFT_NAME(start(afterDocument:)); /** * Creates and returns a new `FIRQuery` that starts after the provided fields relative to the order @@ -361,7 +360,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryStartingAfterValues:(NSArray *)fieldValues FIR_SWIFT_NAME(start(after:)); +- (FIRQuery *)queryStartingAfterValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(after:)); /** * Creates and returns a new `FIRQuery` that ends before the provided document (exclusive). The end @@ -373,7 +372,7 @@ FIR_SWIFT_NAME(Query) * @return The created `FIRQuery`. */ - (FIRQuery *)queryEndingBeforeDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(end(beforeDocument:)); + NS_SWIFT_NAME(end(beforeDocument:)); /** * Creates and returns a new `FIRQuery` that ends before the provided fields relative to the order @@ -384,7 +383,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryEndingBeforeValues:(NSArray *)fieldValues FIR_SWIFT_NAME(end(before:)); +- (FIRQuery *)queryEndingBeforeValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(before:)); /** * Creates and returns a new `FIRQuery` that ends at the provided document (exclusive). The end @@ -395,8 +394,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)document - FIR_SWIFT_NAME(end(atDocument:)); +- (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)document NS_SWIFT_NAME(end(atDocument:)); /** * Creates and returns a new `FIRQuery` that ends at the provided fields relative to the order of @@ -407,7 +405,7 @@ FIR_SWIFT_NAME(Query) * * @return The created `FIRQuery`. */ -- (FIRQuery *)queryEndingAtValues:(NSArray *)fieldValues FIR_SWIFT_NAME(end(at:)); +- (FIRQuery *)queryEndingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(at:)); @end diff --git a/Firestore/Source/Public/FIRQuerySnapshot.h b/Firestore/Source/Public/FIRQuerySnapshot.h index 800368d..c49a07a 100644 --- a/Firestore/Source/Public/FIRQuerySnapshot.h +++ b/Firestore/Source/Public/FIRQuerySnapshot.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentChange; @@ -30,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN * using "for ... in documentSet.documents" and its size can be inspected with `isEmpty` and * `count`. */ -FIR_SWIFT_NAME(QuerySnapshot) +NS_SWIFT_NAME(QuerySnapshot) @interface FIRQuerySnapshot : NSObject /** */ diff --git a/Firestore/Source/Public/FIRSetOptions.h b/Firestore/Source/Public/FIRSetOptions.h index e1103a1..c865e06 100644 --- a/Firestore/Source/Public/FIRSetOptions.h +++ b/Firestore/Source/Public/FIRSetOptions.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** @@ -26,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN * `FIRWriteBatch` and `FIRTransaction` can be configured to perform granular merges instead * of overwriting the target documents in their entirety. */ -FIR_SWIFT_NAME(SetOptions) +NS_SWIFT_NAME(SetOptions) @interface FIRSetOptions : NSObject /** */ diff --git a/Firestore/Source/Public/FIRSnapshotMetadata.h b/Firestore/Source/Public/FIRSnapshotMetadata.h index 04a6b45..4c7ff98 100644 --- a/Firestore/Source/Public/FIRSnapshotMetadata.h +++ b/Firestore/Source/Public/FIRSnapshotMetadata.h @@ -16,12 +16,10 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN /** Metadata about a snapshot, describing the state of the snapshot. */ -FIR_SWIFT_NAME(SnapshotMetadata) +NS_SWIFT_NAME(SnapshotMetadata) @interface FIRSnapshotMetadata : NSObject - (instancetype)init NS_UNAVAILABLE; diff --git a/Firestore/Source/Public/FIRTransaction.h b/Firestore/Source/Public/FIRTransaction.h index 68e4600..51a6e90 100644 --- a/Firestore/Source/Public/FIRTransaction.h +++ b/Firestore/Source/Public/FIRTransaction.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentReference; @@ -29,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN * * @see FIRFirestore#transaction:completion: */ -FIR_SWIFT_NAME(Transaction) +NS_SWIFT_NAME(Transaction) @interface FIRTransaction : NSObject /** */ @@ -47,7 +45,7 @@ FIR_SWIFT_NAME(Transaction) // clang-format off - (FIRTransaction *)setData:(NSDictionary<NSString *, id> *)data forDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(setData(_:forDocument:)); + NS_SWIFT_NAME(setData(_:forDocument:)); // clang-format on /** @@ -64,7 +62,7 @@ FIR_SWIFT_NAME(Transaction) - (FIRTransaction *)setData:(NSDictionary<NSString *, id> *)data forDocument:(FIRDocumentReference *)document options:(FIRSetOptions *)options - FIR_SWIFT_NAME(setData(_:forDocument:options:)); + NS_SWIFT_NAME(setData(_:forDocument:options:)); // clang-format on /** @@ -79,7 +77,7 @@ FIR_SWIFT_NAME(Transaction) // clang-format off - (FIRTransaction *)updateData:(NSDictionary<id, id> *)fields forDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(updateData(_:forDocument:)); + NS_SWIFT_NAME(updateData(_:forDocument:)); // clang-format on /** @@ -89,7 +87,7 @@ FIR_SWIFT_NAME(Transaction) * @return This `FIRTransaction` instance. Used for chaining method calls. */ - (FIRTransaction *)deleteDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(deleteDocument(_:)); + NS_SWIFT_NAME(deleteDocument(_:)); /** * Reads the document referenced by `document`. @@ -99,7 +97,7 @@ FIR_SWIFT_NAME(Transaction) */ - (FIRDocumentSnapshot *_Nullable)getDocument:(FIRDocumentReference *)document error:(NSError *__autoreleasing *)error - FIR_SWIFT_NAME(getDocument(_:)); + NS_SWIFT_NAME(getDocument(_:)); @end diff --git a/Firestore/Source/Public/FIRWriteBatch.h b/Firestore/Source/Public/FIRWriteBatch.h index b88e6cc..a74d451 100644 --- a/Firestore/Source/Public/FIRWriteBatch.h +++ b/Firestore/Source/Public/FIRWriteBatch.h @@ -16,8 +16,6 @@ #import <Foundation/Foundation.h> -#import "FIRFirestoreSwiftNameSupport.h" - NS_ASSUME_NONNULL_BEGIN @class FIRDocumentReference; @@ -33,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN * Unlike transactions, write batches are persisted offline and therefore are preferable when you * don't need to condition your writes on read data. */ -FIR_SWIFT_NAME(WriteBatch) +NS_SWIFT_NAME(WriteBatch) @interface FIRWriteBatch : NSObject /** :nodoc: */ @@ -50,7 +48,7 @@ FIR_SWIFT_NAME(WriteBatch) */ // clang-format off - (FIRWriteBatch *)setData:(NSDictionary<NSString *, id> *)data - forDocument:(FIRDocumentReference *)document FIR_SWIFT_NAME(setData(_:forDocument:)); + forDocument:(FIRDocumentReference *)document NS_SWIFT_NAME(setData(_:forDocument:)); // clang-format on /** @@ -67,7 +65,7 @@ FIR_SWIFT_NAME(WriteBatch) - (FIRWriteBatch *)setData:(NSDictionary<NSString *, id> *)data forDocument:(FIRDocumentReference *)document options:(FIRSetOptions *)options - FIR_SWIFT_NAME(setData(_:forDocument:options:)); + NS_SWIFT_NAME(setData(_:forDocument:options:)); // clang-format on /** @@ -82,7 +80,7 @@ FIR_SWIFT_NAME(WriteBatch) // clang-format off - (FIRWriteBatch *)updateData:(NSDictionary<id, id> *)fields forDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(updateData(_:forDocument:)); + NS_SWIFT_NAME(updateData(_:forDocument:)); // clang-format on /** @@ -92,7 +90,7 @@ FIR_SWIFT_NAME(WriteBatch) * @return This `FIRWriteBatch` instance. Used for chaining method calls. */ - (FIRWriteBatch *)deleteDocument:(FIRDocumentReference *)document - FIR_SWIFT_NAME(deleteDocument(_:)); + NS_SWIFT_NAME(deleteDocument(_:)); /** * Commits all of the writes in this write batch as a single atomic unit. diff --git a/Firestore/Source/Remote/FSTBufferedWriter.m b/Firestore/Source/Remote/FSTBufferedWriter.m index d86e03a..47dbb21 100644 --- a/Firestore/Source/Remote/FSTBufferedWriter.m +++ b/Firestore/Source/Remote/FSTBufferedWriter.m @@ -16,7 +16,7 @@ #import <Protobuf/GPBProtocolBuffers.h> -#import "FSTBufferedWriter.h" +#import "Firestore/Source/Remote/FSTBufferedWriter.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Remote/FSTDatastore.h b/Firestore/Source/Remote/FSTDatastore.h index 08aa570..13d9eda 100644 --- a/Firestore/Source/Remote/FSTDatastore.h +++ b/Firestore/Source/Remote/FSTDatastore.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" @class FSTDatabaseInfo; @class FSTDocumentKey; diff --git a/Firestore/Source/Remote/FSTDatastore.m b/Firestore/Source/Remote/FSTDatastore.m index a26a5a2..02d868c 100644 --- a/Firestore/Source/Remote/FSTDatastore.m +++ b/Firestore/Source/Remote/FSTDatastore.m @@ -14,28 +14,28 @@ * limitations under the License. */ -#import "FSTDatastore.h" +#import "Firestore/Source/Remote/FSTDatastore.h" #import <GRPCClient/GRPCCall+OAuth2.h> #import <ProtoRPC/ProtoRPC.h> -#import "FIRFirestore+Internal.h" #import "FIRFirestoreErrors.h" -#import "FIRFirestoreVersion.h" -#import "FSTAssert.h" -#import "FSTCredentialsProvider.h" -#import "FSTDatabaseID.h" -#import "FSTDatabaseInfo.h" -#import "FSTDispatchQueue.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTLocalStore.h" -#import "FSTLogger.h" -#import "FSTMutation.h" -#import "FSTSerializerBeta.h" -#import "FSTStream.h" - -#import "Firestore.pbrpc.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/API/FIRFirestoreVersion.h" +#import "Firestore/Source/Auth/FSTCredentialsProvider.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Local/FSTLocalStore.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Remote/FSTStream.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTLogger.h" + +#import "Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Remote/FSTExistenceFilter.m b/Firestore/Source/Remote/FSTExistenceFilter.m index 7c0ded2..d5ec7b3 100644 --- a/Firestore/Source/Remote/FSTExistenceFilter.m +++ b/Firestore/Source/Remote/FSTExistenceFilter.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FSTExistenceFilter.h" +#import "Firestore/Source/Remote/FSTExistenceFilter.h" @interface FSTExistenceFilter () diff --git a/Firestore/Source/Remote/FSTExponentialBackoff.m b/Firestore/Source/Remote/FSTExponentialBackoff.mm index dc589b5..ad27c25 100644 --- a/Firestore/Source/Remote/FSTExponentialBackoff.m +++ b/Firestore/Source/Remote/FSTExponentialBackoff.mm @@ -14,11 +14,14 @@ * limitations under the License. */ -#import "FSTExponentialBackoff.h" +#import "Firestore/Source/Remote/FSTExponentialBackoff.h" -#import "FSTDispatchQueue.h" -#import "FSTLogger.h" -#import "FSTUtil.h" +#include <random> + +#include "Firestore/src/support/secure_random.h" + +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTLogger.h" @interface FSTExponentialBackoff () - (instancetype)initWithDispatchQueue:(FSTDispatchQueue *)dispatchQueue @@ -33,7 +36,9 @@ @property(nonatomic) NSTimeInterval currentBase; @end -@implementation FSTExponentialBackoff +@implementation FSTExponentialBackoff { + firestore::SecureRandom _secureRandom; +} - (instancetype)initWithDispatchQueue:(FSTDispatchQueue *)dispatchQueue initialDelay:(NSTimeInterval)initialDelay @@ -90,7 +95,9 @@ /** Returns a random value in the range [-currentBase/2, currentBase/2] */ - (NSTimeInterval)jitterDelay { - return ([FSTUtil randomDouble] - 0.5) * _currentBase; + std::uniform_real_distribution<double> dist; + double random_double = dist(_secureRandom); + return (random_double - 0.5) * _currentBase; } @end diff --git a/Firestore/Source/Remote/FSTRemoteEvent.h b/Firestore/Source/Remote/FSTRemoteEvent.h index 939a027..72f71a5 100644 --- a/Firestore/Source/Remote/FSTRemoteEvent.h +++ b/Firestore/Source/Remote/FSTRemoteEvent.h @@ -16,9 +16,9 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentDictionary.h" -#import "FSTDocumentKeySet.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Model/FSTDocumentDictionary.h" +#import "Firestore/Source/Model/FSTDocumentKeySet.h" @class FSTDocument; @class FSTDocumentKey; diff --git a/Firestore/Source/Remote/FSTRemoteEvent.m b/Firestore/Source/Remote/FSTRemoteEvent.m index 5c75998..a97eb86 100644 --- a/Firestore/Source/Remote/FSTRemoteEvent.m +++ b/Firestore/Source/Remote/FSTRemoteEvent.m @@ -14,15 +14,15 @@ * limitations under the License. */ -#import "FSTRemoteEvent.h" - -#import "FSTAssert.h" -#import "FSTClasses.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTLogger.h" -#import "FSTSnapshotVersion.h" -#import "FSTWatchChange.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" + +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/Source/Util/FSTLogger.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Remote/FSTRemoteStore.h b/Firestore/Source/Remote/FSTRemoteStore.h index 0948cfa..313ddb7 100644 --- a/Firestore/Source/Remote/FSTRemoteStore.h +++ b/Firestore/Source/Remote/FSTRemoteStore.h @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "FSTDocumentVersionDictionary.h" -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" +#import "Firestore/Source/Model/FSTDocumentVersionDictionary.h" @class FSTDatabaseInfo; @class FSTDatastore; diff --git a/Firestore/Source/Remote/FSTRemoteStore.m b/Firestore/Source/Remote/FSTRemoteStore.m index 45a8aca..f7c3e57 100644 --- a/Firestore/Source/Remote/FSTRemoteStore.m +++ b/Firestore/Source/Remote/FSTRemoteStore.m @@ -14,24 +14,24 @@ * limitations under the License. */ -#import "FSTRemoteStore.h" - -#import "FSTAssert.h" -#import "FSTDatastore.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTExistenceFilter.h" -#import "FSTLocalStore.h" -#import "FSTLogger.h" -#import "FSTMutation.h" -#import "FSTMutationBatch.h" -#import "FSTQuery.h" -#import "FSTQueryData.h" -#import "FSTRemoteEvent.h" -#import "FSTSnapshotVersion.h" -#import "FSTStream.h" -#import "FSTTransaction.h" -#import "FSTWatchChange.h" +#import "Firestore/Source/Remote/FSTRemoteStore.h" + +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTransaction.h" +#import "Firestore/Source/Local/FSTLocalStore.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Remote/FSTDatastore.h" +#import "Firestore/Source/Remote/FSTExistenceFilter.h" +#import "Firestore/Source/Remote/FSTRemoteEvent.h" +#import "Firestore/Source/Remote/FSTStream.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTLogger.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Remote/FSTSerializerBeta.m b/Firestore/Source/Remote/FSTSerializerBeta.m index 418dabd..04785c2 100644 --- a/Firestore/Source/Remote/FSTSerializerBeta.m +++ b/Firestore/Source/Remote/FSTSerializerBeta.m @@ -14,34 +14,34 @@ * limitations under the License. */ -#import "FSTSerializerBeta.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" #import <GRPCClient/GRPCCall.h> -#import "Common.pbobjc.h" -#import "Document.pbobjc.h" -#import "Firestore.pbobjc.h" -#import "Latlng.pbobjc.h" -#import "Query.pbobjc.h" -#import "Status.pbobjc.h" -#import "Write.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h" +#import "Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h" +#import "Firestore/Protos/objc/google/rpc/Status.pbobjc.h" +#import "Firestore/Protos/objc/google/type/Latlng.pbobjc.h" #import "FIRFirestoreErrors.h" #import "FIRGeoPoint.h" -#import "FSTAssert.h" -#import "FSTDatabaseID.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTExistenceFilter.h" -#import "FSTFieldValue.h" -#import "FSTMutation.h" -#import "FSTMutationBatch.h" -#import "FSTPath.h" -#import "FSTQuery.h" -#import "FSTQueryData.h" -#import "FSTSnapshotVersion.h" -#import "FSTTimestamp.h" -#import "FSTWatchChange.h" +#import "Firestore/Source/Core/FSTQuery.h" +#import "Firestore/Source/Core/FSTSnapshotVersion.h" +#import "Firestore/Source/Core/FSTTimestamp.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Model/FSTFieldValue.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Model/FSTMutationBatch.h" +#import "Firestore/Source/Model/FSTPath.h" +#import "Firestore/Source/Remote/FSTExistenceFilter.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" +#import "Firestore/Source/Util/FSTAssert.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Remote/FSTStream.h b/Firestore/Source/Remote/FSTStream.h index a3ca8a4..546aa3d 100644 --- a/Firestore/Source/Remote/FSTStream.h +++ b/Firestore/Source/Remote/FSTStream.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" @class FSTDatabaseInfo; @class FSTDocumentKey; diff --git a/Firestore/Source/Remote/FSTStream.m b/Firestore/Source/Remote/FSTStream.m index bf54a6b..0790d81 100644 --- a/Firestore/Source/Remote/FSTStream.m +++ b/Firestore/Source/Remote/FSTStream.m @@ -14,28 +14,28 @@ * limitations under the License. */ -#import "FSTDatastore.h" +#import "Firestore/Source/Remote/FSTDatastore.h" #import <GRPCClient/GRPCCall+OAuth2.h> #import <GRPCClient/GRPCCall.h> -#import "FIRFirestore+Internal.h" #import "FIRFirestoreErrors.h" -#import "FSTAssert.h" -#import "FSTBufferedWriter.h" -#import "FSTClasses.h" -#import "FSTCredentialsProvider.h" -#import "FSTDatabaseID.h" -#import "FSTDatabaseInfo.h" -#import "FSTDispatchQueue.h" -#import "FSTExponentialBackoff.h" -#import "FSTLogger.h" -#import "FSTMutation.h" -#import "FSTQueryData.h" -#import "FSTSerializerBeta.h" -#import "FSTStream.h" - -#import "Firestore.pbrpc.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Firestore/Source/Auth/FSTCredentialsProvider.h" +#import "Firestore/Source/Core/FSTDatabaseInfo.h" +#import "Firestore/Source/Local/FSTQueryData.h" +#import "Firestore/Source/Model/FSTDatabaseID.h" +#import "Firestore/Source/Model/FSTMutation.h" +#import "Firestore/Source/Remote/FSTBufferedWriter.h" +#import "Firestore/Source/Remote/FSTExponentialBackoff.h" +#import "Firestore/Source/Remote/FSTSerializerBeta.h" +#import "Firestore/Source/Remote/FSTStream.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTLogger.h" + +#import "Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h" /** * Initial backoff time in seconds after an error. diff --git a/Firestore/Source/Remote/FSTWatchChange.h b/Firestore/Source/Remote/FSTWatchChange.h index 6b65279..8ce24fa 100644 --- a/Firestore/Source/Remote/FSTWatchChange.h +++ b/Firestore/Source/Remote/FSTWatchChange.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTTypes.h" +#import "Firestore/Source/Core/FSTTypes.h" @class FSTDocumentKey; @class FSTExistenceFilter; diff --git a/Firestore/Source/Remote/FSTWatchChange.m b/Firestore/Source/Remote/FSTWatchChange.m index 1ace26e..926d027 100644 --- a/Firestore/Source/Remote/FSTWatchChange.m +++ b/Firestore/Source/Remote/FSTWatchChange.m @@ -14,11 +14,11 @@ * limitations under the License. */ -#import "FSTWatchChange.h" +#import "Firestore/Source/Remote/FSTWatchChange.h" -#import "FSTDocument.h" -#import "FSTDocumentKey.h" -#import "FSTExistenceFilter.h" +#import "Firestore/Source/Model/FSTDocument.h" +#import "Firestore/Source/Model/FSTDocumentKey.h" +#import "Firestore/Source/Remote/FSTExistenceFilter.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Util/FSTAsyncQueryListener.h b/Firestore/Source/Util/FSTAsyncQueryListener.h index 0ff1551..4888268 100644 --- a/Firestore/Source/Util/FSTAsyncQueryListener.h +++ b/Firestore/Source/Util/FSTAsyncQueryListener.h @@ -16,7 +16,7 @@ #import <Foundation/Foundation.h> -#import "FSTViewSnapshot.h" +#import "Firestore/Source/Core/FSTViewSnapshot.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Util/FSTAsyncQueryListener.m b/Firestore/Source/Util/FSTAsyncQueryListener.m index 31951e1..d98e2dd 100644 --- a/Firestore/Source/Util/FSTAsyncQueryListener.m +++ b/Firestore/Source/Util/FSTAsyncQueryListener.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "FSTAsyncQueryListener.h" +#import "Firestore/Source/Util/FSTAsyncQueryListener.h" -#import "FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" @implementation FSTAsyncQueryListener { volatile BOOL _muted; diff --git a/Firestore/Source/Util/FSTComparison.m b/Firestore/Source/Util/FSTComparison.m index e4f4ccb..9c5c3eb 100644 --- a/Firestore/Source/Util/FSTComparison.m +++ b/Firestore/Source/Util/FSTComparison.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FSTComparison.h" +#import "Firestore/Source/Util/FSTComparison.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Util/FSTDispatchQueue.m b/Firestore/Source/Util/FSTDispatchQueue.m index 2c8ee55..9ca28a2 100644 --- a/Firestore/Source/Util/FSTDispatchQueue.m +++ b/Firestore/Source/Util/FSTDispatchQueue.m @@ -16,8 +16,8 @@ #import <Foundation/Foundation.h> -#import "FSTAssert.h" -#import "FSTDispatchQueue.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTDispatchQueue.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Util/FSTLogger.m b/Firestore/Source/Util/FSTLogger.m index 396c788..7742aeb 100644 --- a/Firestore/Source/Util/FSTLogger.m +++ b/Firestore/Source/Util/FSTLogger.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "FSTLogger.h" +#import "Firestore/Source/Util/FSTLogger.h" -#import "FIRFirestore+Internal.h" #import "FIRLogger.h" +#import "Firestore/Source/API/FIRFirestore+Internal.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/Source/Util/FSTUsageValidation.h b/Firestore/Source/Util/FSTUsageValidation.h index a80dafa..34a3d64 100644 --- a/Firestore/Source/Util/FSTUsageValidation.h +++ b/Firestore/Source/Util/FSTUsageValidation.h @@ -18,6 +18,10 @@ NS_ASSUME_NONNULL_BEGIN +#if __cplusplus +extern "C" { +#endif + /** Helper for creating a general exception for invalid usage of an API. */ NSException *FSTInvalidUsage(NSString *exceptionName, NSString *format, ...); @@ -42,4 +46,8 @@ NSException *FSTInvalidUsage(NSString *exceptionName, NSString *format, ...); @throw FSTInvalidUsage(@"FIRInvalidArgumentException", format, ##__VA_ARGS__); \ } while (0) +#if __cplusplus +} // extern "C" +#endif + NS_ASSUME_NONNULL_END diff --git a/Firestore/Source/Util/FSTUtil.m b/Firestore/Source/Util/FSTUtil.m deleted file mode 100644 index d14c429..0000000 --- a/Firestore/Source/Util/FSTUtil.m +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2017 Google - * - * 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 "FSTUtil.h" - -NS_ASSUME_NONNULL_BEGIN - -static const double kArc4RandomMax = 0x100000000; - -static const int kAutoIDLength = 20; -static NSString *const kAutoIDAlphabet = - @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - -@implementation FSTUtil - -+ (double)randomDouble { - return ((double)arc4random() / kArc4RandomMax); -} - -+ (NSString *)autoID { - unichar autoID[kAutoIDLength]; - for (int i = 0; i < kAutoIDLength; i++) { - uint32_t randIndex = arc4random_uniform((uint32_t)kAutoIDAlphabet.length); - autoID[i] = [kAutoIDAlphabet characterAtIndex:randIndex]; - } - return [NSString stringWithCharacters:autoID length:kAutoIDLength]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/Firestore/src/.clang-format b/Firestore/src/.clang-format new file mode 100644 index 0000000..7a0e321 --- /dev/null +++ b/Firestore/src/.clang-format @@ -0,0 +1,8 @@ +BasedOnStyle: Google +Standard: Cpp11 +ColumnLimit: 80 +BinPackParameters: false +AllowAllParametersOfDeclarationOnNextLine: true +SpacesInContainerLiterals: true +PointerAlignment: Left +AllowShortFunctionsOnASingleLine: None diff --git a/Firestore/src/core/util/CMakeLists.txt b/Firestore/src/core/util/CMakeLists.txt new file mode 100644 index 0000000..6b08d8e --- /dev/null +++ b/Firestore/src/core/util/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2017 Google +# +# 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. + +add_library( + firestore_core_util + autoid.cc +) +target_link_libraries( + firestore_core_util + firestore_support +) diff --git a/Firestore/src/core/util/autoid.cc b/Firestore/src/core/util/autoid.cc new file mode 100644 index 0000000..762bbcc --- /dev/null +++ b/Firestore/src/core/util/autoid.cc @@ -0,0 +1,52 @@ +/* + * Copyright 2017 Google + * + * 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. + */ + +#include "Firestore/src/core/util/autoid.h" + +#include <random> +#include <string> + +#include "Firestore/src/support/secure_random.h" + +namespace { + +const int kAutoIdLength = 20; +const char kAutoIdAlphabet[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + +firestore::SecureRandom shared_random; + +} // namespace + +namespace firestore { + +std::string CreateAutoId() { + std::string auto_id; + auto_id.reserve(kAutoIdLength); + + // -2 here because: + // * sizeof(kAutoIdAlphabet) includes the trailing null terminator + // * uniform_int_distribution is inclusive on both sizes + std::uniform_int_distribution<int> letters(0, sizeof(kAutoIdAlphabet) - 2); + + for (int i = 0; i < kAutoIdLength; i++) { + int rand_index = letters(shared_random); + auto_id.append(1, kAutoIdAlphabet[rand_index]); + } + return auto_id; +} + +} // namespace firestore diff --git a/Firestore/Source/Util/FSTUtil.h b/Firestore/src/core/util/autoid.h index 3985d10..13486af 100644 --- a/Firestore/Source/Util/FSTUtil.h +++ b/Firestore/src/core/util/autoid.h @@ -14,18 +14,16 @@ * limitations under the License. */ -#import <Foundation/Foundation.h> +#ifndef FIRESTORE_SRC_CORE_UTIL_AUTOID_H_ +#define FIRESTORE_SRC_CORE_UTIL_AUTOID_H_ -NS_ASSUME_NONNULL_BEGIN +#include <string> -@interface FSTUtil : NSObject +namespace firestore { -/** Generates a random double between 0 and 1. */ -+ (double)randomDouble; +// Generates a random ID suitable for use as a document ID. +std::string CreateAutoId(); -/** Generates a random ID suitable for use as a document ID. */ -+ (NSString *)autoID; +} // namespace firestore -@end - -NS_ASSUME_NONNULL_END +#endif // FIRESTORE_SRC_CORE_UTIL_AUTOID_H_ diff --git a/Firestore/src/support/CMakeLists.txt b/Firestore/src/support/CMakeLists.txt new file mode 100644 index 0000000..8110c6f --- /dev/null +++ b/Firestore/src/support/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright 2017 Google +# +# 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. + +add_library( + firestore_support + secure_random_arc4random.cc +) diff --git a/Firestore/src/support/port.h b/Firestore/src/support/port.h new file mode 100644 index 0000000..6af898a --- /dev/null +++ b/Firestore/src/support/port.h @@ -0,0 +1,33 @@ +/* + * Copyright 2017 Google + * + * 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. + */ + +#ifndef FIRESTORE_SRC_SUPPORT_PORT_H_ +#define FIRESTORE_SRC_SUPPORT_PORT_H_ + +#if defined(__APPLE__) +// On Apple platforms we support building via Cocoapods without CMake. When +// building this way we can't test the presence of features so predefine all +// the platform-support feature macros to their expected values. + +// All supported Apple platforms have arc4random(3). +#define HAVE_ARC4RANDOM 1 + +#else + +#error "Unknown platform." +#endif // defined(__APPLE__) + +#endif // FIRESTORE_SRC_SUPPORT_PORT_H_ diff --git a/Firestore/src/support/secure_random.h b/Firestore/src/support/secure_random.h new file mode 100644 index 0000000..92a3eaf --- /dev/null +++ b/Firestore/src/support/secure_random.h @@ -0,0 +1,55 @@ +/* + * Copyright 2017 Google + * + * 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. + */ + +#ifndef FIRESTORE_SRC_SUPPORT_SECURE_RANDOM_H_ +#define FIRESTORE_SRC_SUPPORT_SECURE_RANDOM_H_ + +#include <stdint.h> + +#include <limits> + +namespace firestore { + +// A "secure" pseudorandom number generator, suitable for generating +// unguessable identifiers. This exists because +// +// * std::mt19937 is blazing fast but its outputs can be guessed once enough +// previous outputs have been observed. +// * std::random_device isn't guaranteed to come from a secure PRNG or be +// fast. +// +// The implementation satisfies the C++11 UniformRandomBitGenerator concept and +// delegates to an implementation that generates high quality random values +// quickly with periodic reseeding. +class SecureRandom { + public: + // C++11 UniformRandomBitGenerator interface + using result_type = uint32_t; + + static constexpr result_type min() { + return std::numeric_limits<result_type>::min(); + } + + static constexpr result_type max() { + return std::numeric_limits<result_type>::max(); + } + + result_type operator()(); +}; + +} // namespace firestore + +#endif // FIRESTORE_SRC_SUPPORT_SECURE_RANDOM_H_ diff --git a/Firestore/Source/Public/FIRFirestoreSwiftNameSupport.h b/Firestore/src/support/secure_random_arc4random.cc index 216c047..4cd7f9d 100644 --- a/Firestore/Source/Public/FIRFirestoreSwiftNameSupport.h +++ b/Firestore/src/support/secure_random_arc4random.cc @@ -14,16 +14,20 @@ * limitations under the License. */ -#ifndef FIR_SWIFT_NAME +#include "Firestore/src/support/secure_random.h" -#import <Foundation/Foundation.h> +#include "Firestore/src/support/port.h" -// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. -// Wrap it in our own macro if it's a non-compatible SDK. -#ifdef __IPHONE_9_3 -#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) -#else -#define FIR_SWIFT_NAME(X) // Intentionally blank. -#endif // #ifdef __IPHONE_9_3 +#if HAVE_ARC4RANDOM -#endif // FIR_SWIFT_NAME +#include <stdlib.h> + +namespace firestore { + +SecureRandom::result_type SecureRandom::operator()() { + return arc4random(); +} + +} // namespace firestore + +#endif // HAVE_ARC4RANDOM diff --git a/Firestore/test/core/util/CMakeLists.txt b/Firestore/test/core/util/CMakeLists.txt new file mode 100644 index 0000000..1989c0e --- /dev/null +++ b/Firestore/test/core/util/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2017 Google +# +# 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. + +cc_test( + firestore_core_util_test + autoid_test.cc +) +target_link_libraries( + firestore_core_util_test + firestore_core_util +) diff --git a/Firestore/test/core/util/autoid_test.cc b/Firestore/test/core/util/autoid_test.cc new file mode 100644 index 0000000..b17a34e --- /dev/null +++ b/Firestore/test/core/util/autoid_test.cc @@ -0,0 +1,33 @@ +/* + * Copyright 2017 Google + * + * 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. + */ + +#include "Firestore/src/core/util/autoid.h" + +#include <ctype.h> + +#include "gtest/gtest.h" + +TEST(AutoId, IsSane) { + for (int i = 0; i < 50; i++) { + std::string auto_id = firestore::CreateAutoId(); + EXPECT_EQ(20, auto_id.length()); + for (int pos = 0; pos < 20; pos++) { + char c = auto_id[pos]; + EXPECT_TRUE(isalpha(c) || isdigit(c)) + << "Should be printable ascii character: '" << c << "' in \"" << auto_id << "\""; + } + } +} diff --git a/Firestore/test/support/CMakeLists.txt b/Firestore/test/support/CMakeLists.txt new file mode 100644 index 0000000..7de5367 --- /dev/null +++ b/Firestore/test/support/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2017 Google +# +# 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. + +cc_test( + firestore_support_test + secure_random_test.cc +) +target_link_libraries( + firestore_support_test + firestore_support +) diff --git a/Firestore/Example/Tests/Util/FSTUtilTests.m b/Firestore/test/support/secure_random_test.cc index 998832d..244227b 100644 --- a/Firestore/Example/Tests/Util/FSTUtilTests.m +++ b/Firestore/test/support/secure_random_test.cc @@ -14,22 +14,19 @@ * limitations under the License. */ -#import "Util/FSTUtil.h" +#include "Firestore/src/support/secure_random.h" -#import <XCTest/XCTest.h> +#include "gtest/gtest.h" -@interface FSTUtilTests : XCTestCase -@end +using firestore::SecureRandom; -@implementation FSTUtilTests +TEST(SecureRandomTest, ResultsAreBounded) { + SecureRandom rng; -- (void)testAutoID { - NSString *autoID = [FSTUtil autoID]; - XCTAssertEqual([autoID length], 20); - for (NSUInteger i = 0; i < 20; i++) { - unichar c = [autoID characterAtIndex:i]; - XCTAssert(c >= ' ' && c <= '~', @"Should be printable ascii characters."); + // Verify that values are on the min/max closed interval. + for (int i = 0; i < 1000; i++) { + SecureRandom::result_type value = rng(); + EXPECT_GE(value, rng.min()); + EXPECT_LE(value, rng.max()); } } - -@end diff --git a/Firestore/third_party/Immutable/FSTArraySortedDictionary.h b/Firestore/third_party/Immutable/FSTArraySortedDictionary.h index 4b78360..0fd7b44 100644 --- a/Firestore/third_party/Immutable/FSTArraySortedDictionary.h +++ b/Firestore/third_party/Immutable/FSTArraySortedDictionary.h @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -#import "FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTArraySortedDictionary.m b/Firestore/third_party/Immutable/FSTArraySortedDictionary.m index fd3bfd7..ad1d68a 100644 --- a/Firestore/third_party/Immutable/FSTArraySortedDictionary.m +++ b/Firestore/third_party/Immutable/FSTArraySortedDictionary.m @@ -1,8 +1,8 @@ -#import "FSTArraySortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTArraySortedDictionary.h" -#import "FSTArraySortedDictionaryEnumerator.h" -#import "FSTAssert.h" -#import "FSTTreeSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTArraySortedDictionaryEnumerator.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/third_party/Immutable/FSTTreeSortedDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTArraySortedDictionaryEnumerator.m b/Firestore/third_party/Immutable/FSTArraySortedDictionaryEnumerator.m index e8fdfcc..9039f96 100644 --- a/Firestore/third_party/Immutable/FSTArraySortedDictionaryEnumerator.m +++ b/Firestore/third_party/Immutable/FSTArraySortedDictionaryEnumerator.m @@ -1,4 +1,4 @@ -#import "FSTArraySortedDictionaryEnumerator.h" +#import "Firestore/third_party/Immutable/FSTArraySortedDictionaryEnumerator.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTImmutableSortedDictionary.m b/Firestore/third_party/Immutable/FSTImmutableSortedDictionary.m index a858529..6e78961 100644 --- a/Firestore/third_party/Immutable/FSTImmutableSortedDictionary.m +++ b/Firestore/third_party/Immutable/FSTImmutableSortedDictionary.m @@ -1,8 +1,8 @@ -#import "FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" -#import "FSTArraySortedDictionary.h" -#import "FSTClasses.h" -#import "FSTTreeSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTArraySortedDictionary.h" +#import "Firestore/Source/Util/FSTClasses.h" +#import "Firestore/third_party/Immutable/FSTTreeSortedDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTImmutableSortedSet.m b/Firestore/third_party/Immutable/FSTImmutableSortedSet.m index a13a79e..a23068e 100644 --- a/Firestore/third_party/Immutable/FSTImmutableSortedSet.m +++ b/Firestore/third_party/Immutable/FSTImmutableSortedSet.m @@ -1,6 +1,6 @@ -#import "FSTImmutableSortedSet.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedSet.h" -#import "FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTLLRBEmptyNode.h b/Firestore/third_party/Immutable/FSTLLRBEmptyNode.h index 4c3c2af..13c3bf8 100644 --- a/Firestore/third_party/Immutable/FSTLLRBEmptyNode.h +++ b/Firestore/third_party/Immutable/FSTLLRBEmptyNode.h @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -#import "FSTLLRBNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBNode.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTLLRBEmptyNode.m b/Firestore/third_party/Immutable/FSTLLRBEmptyNode.m index ec49c2c..45d2652 100644 --- a/Firestore/third_party/Immutable/FSTLLRBEmptyNode.m +++ b/Firestore/third_party/Immutable/FSTLLRBEmptyNode.m @@ -1,6 +1,6 @@ -#import "FSTLLRBEmptyNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBEmptyNode.h" -#import "FSTLLRBValueNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBValueNode.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTLLRBValueNode.h b/Firestore/third_party/Immutable/FSTLLRBValueNode.h index 4a0873c..9a62378 100644 --- a/Firestore/third_party/Immutable/FSTLLRBValueNode.h +++ b/Firestore/third_party/Immutable/FSTLLRBValueNode.h @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -#import "FSTLLRBNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBNode.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTLLRBValueNode.m b/Firestore/third_party/Immutable/FSTLLRBValueNode.m index d048012..194a393 100644 --- a/Firestore/third_party/Immutable/FSTLLRBValueNode.m +++ b/Firestore/third_party/Immutable/FSTLLRBValueNode.m @@ -1,7 +1,7 @@ -#import "FSTLLRBValueNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBValueNode.h" -#import "FSTAssert.h" -#import "FSTLLRBEmptyNode.h" +#import "Firestore/Source/Util/FSTAssert.h" +#import "Firestore/third_party/Immutable/FSTLLRBEmptyNode.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTTreeSortedDictionary.h b/Firestore/third_party/Immutable/FSTTreeSortedDictionary.h index 6c26e5f..ca1a290 100644 --- a/Firestore/third_party/Immutable/FSTTreeSortedDictionary.h +++ b/Firestore/third_party/Immutable/FSTTreeSortedDictionary.h @@ -14,8 +14,8 @@ #import <Foundation/Foundation.h> -#import "FSTImmutableSortedDictionary.h" -#import "FSTLLRBNode.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTLLRBNode.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTTreeSortedDictionary.m b/Firestore/third_party/Immutable/FSTTreeSortedDictionary.m index 4059951..b3e691f 100644 --- a/Firestore/third_party/Immutable/FSTTreeSortedDictionary.m +++ b/Firestore/third_party/Immutable/FSTTreeSortedDictionary.m @@ -1,8 +1,8 @@ -#import "FSTTreeSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTTreeSortedDictionary.h" -#import "FSTLLRBEmptyNode.h" -#import "FSTLLRBValueNode.h" -#import "FSTTreeSortedDictionaryEnumerator.h" +#import "Firestore/third_party/Immutable/FSTLLRBEmptyNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBValueNode.h" +#import "Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.h b/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.h index ab82f00..d31d4c2 100644 --- a/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.h +++ b/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.h @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -#import "FSTTreeSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTTreeSortedDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.m b/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.m index bfdfba5..b413792 100644 --- a/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.m +++ b/Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.m @@ -1,4 +1,4 @@ -#import "FSTTreeSortedDictionaryEnumerator.h" +#import "Firestore/third_party/Immutable/FSTTreeSortedDictionaryEnumerator.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m b/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m index 68f2fc3..a799686 100644 --- a/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m +++ b/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m @@ -1,8 +1,8 @@ -#import "Immutable/FSTArraySortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTArraySortedDictionary.h" #import <XCTest/XCTest.h> -#import "Util/FSTAssert.h" +#import "Firestore/Source/Util/FSTAssert.h" @interface FSTArraySortedDictionary (Test) // Override methods to return subtype. diff --git a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.h b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.h index 7496173..85e0197 100644 --- a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.h +++ b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.h @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -#import "Immutable/FSTImmutableSortedDictionary.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.m b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.m index d402916..7def7cb 100644 --- a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.m +++ b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.m @@ -1,4 +1,4 @@ -#import "FSTImmutableSortedDictionary+Testing.h" +#import "Firestore/third_party/Immutable/Tests/FSTImmutableSortedDictionary+Testing.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.h b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.h index a0e25d7..0eb82cf 100644 --- a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.h +++ b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.h @@ -1,4 +1,4 @@ -#import "Immutable/FSTImmutableSortedSet.h" +#import "Firestore/third_party/Immutable/FSTImmutableSortedSet.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.m b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.m index d4d81e0..25ba56e 100644 --- a/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.m +++ b/Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.m @@ -1,4 +1,4 @@ -#import "FSTImmutableSortedSet+Testing.h" +#import "Firestore/third_party/Immutable/Tests/FSTImmutableSortedSet+Testing.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Firestore/third_party/Immutable/Tests/FSTLLRBValueNode+Test.h b/Firestore/third_party/Immutable/Tests/FSTLLRBValueNode+Test.h index 3b05647..768521a 100644 --- a/Firestore/third_party/Immutable/Tests/FSTLLRBValueNode+Test.h +++ b/Firestore/third_party/Immutable/Tests/FSTLLRBValueNode+Test.h @@ -1,4 +1,4 @@ -#import "Immutable/FSTLLRBValueNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBValueNode.h" #import <Foundation/Foundation.h> diff --git a/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m b/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m index 352ac4e..344efba 100644 --- a/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m +++ b/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m @@ -1,12 +1,12 @@ #import <XCTest/XCTest.h> -#import "Immutable/FSTLLRBEmptyNode.h" -#import "Immutable/FSTLLRBNode.h" -#import "Immutable/FSTLLRBValueNode.h" -#import "Immutable/FSTTreeSortedDictionary.h" -#import "Util/FSTAssert.h" +#import "Firestore/third_party/Immutable/FSTLLRBEmptyNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBNode.h" +#import "Firestore/third_party/Immutable/FSTLLRBValueNode.h" +#import "Firestore/third_party/Immutable/FSTTreeSortedDictionary.h" +#import "Firestore/Source/Util/FSTAssert.h" -#import "FSTLLRBValueNode+Test.h" +#import "Firestore/third_party/Immutable/Tests/FSTLLRBValueNode+Test.h" @interface FSTTreeSortedDictionary (Test) // Override methods to return subtype. |