local-source-file-path does not expand to correct file paths in
some circumstances so some users override it. Therefore
flatbuffers_header_build_rules has been modified to generate rules
that expand LOCAL_SRC_FILES values with flatbuffers_header_build_rules.
Also, this overrides local-source-file-path to allow nest projects
to build when NDK_OUT is set.
Tested:
Verified a dependent project continues to build.
Bug: 25673744
Change-Id: Ic90186fe96d6e4533f9f3b7ca9ef78084de08a7e
When $(MAKE) is expanded via a macro "make" doesn't know whether
$(MAKE) refers to an instance of the make app and therefore doesn't
pass job server arguments down. This change adds the + prefix to the
command in the receipe in order to indicate $(MAKE) is another instance of
make.
Tested:
Verified flatc builds in parallel from Android builds.
Change-Id: I9f2f4f9680b818fdda7420a75a8bfa995b4644db
+ Add state to the Builder object to track if we are inside a table,
and if we are finished building the buffer.
+ Use this data to check that a buffer is being built correctly.
+ Raise an exception if a buffer is not being built correctly.
+ Test that the exceptions happen as expected.
Based on d236dea.
+ Add state to the Builder object to track if we are inside a table,
and if we are finished building the buffer.
+ Use this data to check that a buffer is being built correctly.
+ Panic if a buffer is not being built correctly.
+ Test that the panics happen as expected.
Based on d236dea13d.
* Added the ability to create a build target for generated headers.
* Made it possible for generated header targets to depend upon each
other or arbitrary build targets.
Tested:
Verified some pretty complex libraries with numerous flatbuffer schema
dependencies build using this macro on Linux with the NDK.
Bug: 25188384
Change-Id: I846855a50808e58c34cdf7086e93e7ea0df69e0d
Because they are represented as `const T *` in the Vector template,
the sizeof(const T *) was accidentally used instead of sizeof(T).
Change-Id: Ib4dc73e1d21396ba2e30c84e5e229c4147204bb1
Tested: on Linux.
This adds an optional argument to generated getters for string fields to
specify the encoding type and overloads the createString() function. It's
now possible to use either JavaScript UTF-16 string objects or C-style
UTF-8 byte arrays (Uint8Array) for string data.
JavaScript uses UTF-16 but FlatBuffers uses UTF-8. This commit tests the code
that does the conversion between the two encodings. The last entry in the array
is tricky because each code point actually requires two UTF-16 code units,
unlike the other examples. The current JSON output of flatc actually handles
this case incorrectly (it generates invalid JSON with UTF-8 code units). The
generated JavaScript code passes these tests fine, however.
This adds a JavaScript language target. The generated JavaScript uses Google
Closure Compiler type annotations and can be compiled using the advanced
compilation mode, which performs type checking and optimizations such as
inlining and dead code elimination. The generated JavaScript also exports all
generated symbols for use with Node.js and RequireJS. This export behavior
can be turned off with the --no-js-exports flag for use with Google Closure
Compiler.
The pop_back function was added to strings in C++11 and it appears not
all compilers we target support it. The call to pop_back has been
replaced with a call to erase.
Tested on Linux. All unit tests pass.
Ensure the size of the buffer being checked is bigger than the element
of the buffer being checked. The buffer can be triggered when, for
example, the buffer is of length zero and we are checking for:
Verify<uoffset_t>(buf_)
The condition above should fail.