Commit Graph
16 Commits
Author SHA1 Message Date
Nick Cooke ec8ca54b3e [Infra] Use full paths when importing public Core header (#13288) 2024-07-16 14:04:48 -04:00
cherylEnkidu 3de44b7ab7 Move Timestamp class from Firestore to Firebase Core (#13221) 2024-07-12 16:19:35 -04:00
Denver Coneybeare 5fba1e7738 Firestore: Increase clock skew tolerance in FIRServerTimestampTests.mm (#12190) 2023-12-13 01:05:14 +00:00
wu-hui 8ed02e9418 Add new firestore-nightly workflow (#12180) 2023-12-08 07:27:30 -05:00
Gil 77f92cd2c6 Stop using built-in CMake Framework support (#5316)
* Fix previously unknown warnings

These become visible once flags are handled uniformly across all
Firestore targets in an upcoming build change.

* Stop using built-in CMake Framework support

CMake has built-in support for building Framework bundles (briefly:
bundles of libraries, associated headers, and resources) but this
doesn't work well for our needs.

1. In CMake 3.5.1 (our earliest supported CMake version) it doesn't copy
headers properly at build time.

2. Even up to CMake 3.15.5, CMake doesn't handle link-line multiplicity
correctly. CMake passes the static library location within the framework
and this seems to cause the linker to mishandle Objective-C metaclass
information resulting in duplicate symbols. Building with `-framework`
flags works correctly.

Previously we partially worked around the latter problem by building
some frameworks as shared instead of static frameworks, but this is
problematic because this mode of operation isn't actually intended and
is unsupported as far as the rest of Firebase is concerned. This turned
out to be fragile though and while refactoring libraries this workaround
broke.

Rather than piling on additional workarounds, this change converts the
frameworks to simple library targets and emulates framework imports
through include paths.

Additionally, this starts refactoring our cmake helper functions to make
them more like built-in functions. This makes it possible to freely use
different CMake features that were made difficult by trying to wrap
everything up in a single CMake command.

* style.sh generated changes

* Review feedback

* More review feedback
2020-04-14 08:40:33 -07:00
Konstantin Varlamov a294e8c112 Remove extraneous imports (#3402)
Remove several imports that appear to be unused.
2019-07-21 17:16:04 -04:00
Brian Chen a2f0cf9678 Throw last failed attempt's error in failed transactions (#3287) 2019-07-09 11:34:55 -07:00
Sebastian Schmidt 6db6cc7909 Store the coerced base value in the BaseMutation (#3292) 2019-07-03 08:45:31 -07:00
Gil 9c95d61304 Update project and fix warnings (#2531)
* Update Firestore project to Xcode 10.1 defaults

* Fix NSUInteger in format strings warning

* Fix implicit conversion warning in FSTLevelDB

* Fix BOOL/bool mismatch

* Fix erroneous comparison

This failure shows up on 32-bit targets. I have no idea why this
succeeds on 64-bit targets.

* Fix incorrect type inference with explicit cast

clang is inferring the type of the key in these maps is `NSString *` and
then complaining that `FIRFieldValue *` doesn't match that type, despite
the underlying method taking `NSDictionary<id, id>`. Explicitly casting
to `id` prevents the warning.

* Remove reliance on representation in FSTFieldValue tests

On *some* platforms [NSNumber numberWithChar:1] ends up with a "c"
(signed char) objcType, but apparently on 32-bit platforms this ends up
as "i" (signed int). Rather than relying on this working properly just
test that [NSNumber numberWithBool:] does the right thing.

* Fix field_value_test on 32-bit targets

When sizeof(void*) is 4 the test failed :-(.

* Rephrase testWritesWithLargeNumbersFail in terms of fixed size types

The prior definition only worked on LP64. Switching to LLONG_MAX would
have also fixed this, but Firestore's data model is independent of C's
data model, so rewriting this in terms of fixed size types more closely
models what's actually an invalid value.

* Fix implicit retain self warnings
2019-03-12 15:58:52 -07:00
Michael Lehenbauer a43709f18e Port flaky test fix from web. (#2332)
Port flaky test fix from web.

Port of https://github.com/firebase/firebase-js-sdk/pull/1511
2019-02-01 15:02:12 -08:00
Paul Beusterien 7c53489e03 Travis to Xcode 10.1 and clang-format to 8.0.0 (tags/google/stable/2018-08-24) (#2222)
* Travis to Xcode 10.1
* Update to clang-format 8
* Update clang-format homebrew link
* Work around space in filename style.sh issue
2019-01-02 09:27:31 -08:00
Michael Lehenbauer b88f95c44f Reformat using 'clang-format version 7.0.0 (tags/google/stable/2018-04-24)' (#1681)
This is the version of clang-format that travis is currently using.
2018-08-13 14:18:02 -07:00
Michael Lehenbauer 8409f21830 Backport array contains / transform improvements from Web. (#1242) 2018-05-08 15:33:10 -07:00
Gil a25d054874 Replace the SnapshotOptions object with the behavior enum. (#1109)
Instead of calling

  `get(field, SnapshotOptions.serverTimestampBehavior(.estimate))`

call

  `get(field, serverTimestampBehavior: .estimate)`
2018-04-16 13:50:11 -07:00
Konstantin Varlamov a17740e914 Add a flag to control whether DocumentSnapshots return Dates or Timestamps for timestamp fields (#831)
* add a new property `timestampsInSnapshotsEnabled` to `FirestoreSettings`, `false` by default;
* add a verbose warning message urging users to opt into the new behavior;
* set `timestampsInSnapshotsEnabled` to true in the integration tests to reduce the verbose console
spam during the test run and make sure the flag won't break anything once it's flipped.
2018-03-30 14:50:15 -04:00
Gil 729b8d176c Move all Firestore Objective-C to Objective-C++ (#734)
* Move all Firestore files to Objective-C++
* Update project file references
* Don't use module imports from Objective-C++
* Use extern "C" for C-accessible globals
* Work around more stringent type checking in Objective-C++
  * NSMutableDictionary ivars aren't implicitly casted to NSDictionary
  * FSTMaybeDocument callback can't be passed a function that accepts
    FSTDocument
  * NSComparisonResult can't be multiplied by -1 without casting
* Add a #include <inttypes.h> where needed
* Avoid using C++ keywords as variables
* Remove #if __cplusplus guards
2018-01-31 11:23:55 -08:00