Commit Graph
6 Commits
Author SHA1 Message Date
Gil 7a58eba2e5 Remove firebase/firestore from paths in Firestore/core (#5374)
* Manual Xcode project fixups

* Remove `firebase/firestore` from paths in Firestore/core

This renames all Firestore files under `Firestore/core` to remove the
interior `firebase/firestore` directory structure. This is motivated by
build failures under Windows where the filenames of intermediates were
too long.

Concretely:

  * `Firebase/core/src/firebase/firestore` becomes `Firebase/core/src`
  * `Firebase/core/test/firebase/firestore` becomes
    `Firebase/core/test/unit`

Moving the tests into a `unit` subdirectory aligns Firestore with the
directory structure in
[AddNewPod](https://github.com/firebase/firebase-ios-sdk/blob/master/AddNewPod.md),
modified for C++ (see discussion in #3224).
2020-04-20 14:57:34 -07:00
Konstantin Varlamov d0686d2f63 C++ migration: implement pretty-printing of Nanopb-generated messages (#4184)
Note: the output is indistinguishable from what is generated by the Objective-C library, with two exceptions:
* class names are different (due to using prefixes, e.g., `GCFS`);
* order in which map fields are outputted can be different (which I presume is to be expected).

I verified this by running integration tests and using simple diffing code to compare outputs: in the destructor of each `Message<T>` (if it's not moved-from), serialize the `Message` to bytes, create an Objective-C proto out of those bytes, convert both protos to their string form, compare the strings (ignoring minor differences in indentation, etc.). Out of 5.7K comparisons, there were just two cases of differences:
* one was in `SerializerTest.FailOnInvalidInputBytes`; since the input in question is invalid, this doesn't seem to require much attention;
* another one was due to differing floating point precision: C++ produces `1.79769e+308` while Objective-C produces `1.79769313486232e+308`. Added a TODO.

Example output:
```
2019-10-28 21:44:56.941749-0400 Firestore_Example_iOS[78883:2094242] 6.11.0 - [Firebase/Firestore][I-FST000001] WriteStream (7f903ca53d50) write request: <WriteRequest 0x70000991ef08>: {
    writes {
      update {
        name: "projects/varconst-11-a51fd/databases/(default)/documents/test-collection/u6QizHeYjqt8Xe61kBoi"
        fields {
          key: "key"
          value {
            string_value: "value"
          }
        }
      }
    }
    stream_token: "\031\020hB\002\201\364\265\265"
}
```
2019-11-07 19:37:28 -05:00
Gil e3531eb3c8 Always use the bytes type in nanopb instead of string (#1790)
* use_bytes_for_strings

* Regenerate nanopb sources
2018-09-07 12:14:36 -07:00
Gil e060e7f7c0 Use anonymous unions for oneofs in nanopb (#1789)
* Use anonymous unions for oneofs if they're the only one in a message.

* Regenerate nanopb sources
2018-09-07 11:41:09 -07:00
Gil 13d5c9ebae Enable malloc support in nanopb and mark up dynamic fields (#1788)
* Mark all dynamic and repeated fields as requiring malloc

* Remove nanopb options files

* Don't pass options-file to nanopb_cpp_generator

* Regenerate nanopb sources

No pb_callback_t fields remain

* Enable dynamic allocation support in the nanopb decoder
2018-09-07 11:32:32 -07:00
Gil 8e9f1781e6 Add a protoc plugin for nanopb (#1781)
* Initial nanopb_cpp_generator

* Use custom generator in build_protos.py
2018-09-07 11:19:52 -07:00