Commit Graph

480 Commits

Author SHA1 Message Date
Stewart Miles ef53aebf9e Expand local file path to allow users to fix ndk-build
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
2015-11-13 08:49:00 -08:00
Stewart Miles 4f96603e12 Pass job server arguments (-jX) to make.
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
2015-11-12 18:25:24 -08:00
rw 3232727ace Python: Improve Builder user interface.
+ 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.
2015-11-11 19:43:53 -08:00
rw 2dfff15a9d Improve Builder user interface.
+ 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.
2015-11-11 17:08:16 -08:00
Wouter van Oortmerssen 3f1c4b41f6 Merge pull request #339 from chobie/net-add-bytebuffer-property-to-table
(C#) Add ByteBuffer property to Table
2015-11-11 10:07:51 -08:00
Shuhei Taunma b98f526b8a (C#) Add ByteBuffer property to Table 2015-11-10 14:32:31 +09:00
Wouter van Oortmerssen 9dc5d378b1 Updated supported languages in the docs.
Change-Id: I607f5f33b609c47fe32342f5e9d066f61f5546cd
2015-11-09 17:25:17 -08:00
Wouter van Oortmerssen b0b39543de Merge pull request #311 from chobie/dont-hide-function-parameter-vs2015
Don't hide function parameter
2015-11-09 09:22:30 -08:00
Shuhei Tanuma 721d21923e Don't hide function parameter 2015-11-07 11:36:32 +09:00
Wouter van Oortmerssen 3f79e05585 Added new documentation links.
Change-Id: Ib5234a97a863be08c3bb0f9329204bc3a7effccb
2015-11-06 09:51:19 -08:00
Wouter van Oortmerssen 4d7810424c Allow structs to be parsed in JSON with out of order fields.
Also simplified the code and made it faster.

Change-Id: I1d83b1165a4a9a4380d1bfb5538769c012d2d367
Tested: on Linux.
2015-10-28 17:54:11 -07:00
Wouter van Oortmerssen 2107a7d514 Fixed assert in flatc converting to text.
Change-Id: Idac375b22aa9beaba162084cc3396f5536a4e721
Tested: on Linux.
2015-10-28 17:50:06 -07:00
Wouter van Oortmerssen 40b03519c1 Updated Xcode project for v7 2015-10-28 12:07:28 -07:00
Wouter van Oortmerssen d236dea13d Improved C++ asserts for nesting and not finishing buffers.
Change-Id: I82a392bd262b13e978df748bc54b7ac43aec1e15
Tested: on Linux.
2015-10-28 11:57:16 -07:00
Stewart Miles ed88f7de96 Improved build rule generation for Android flatbuffer headers.
* 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
2015-10-22 13:16:45 -07:00
Robert 07478a6700 Merge pull request #204 from layzerar/fix_struct_comment
fix comment generation of struct
2015-10-20 13:25:53 -07:00
Wouter van Oortmerssen 48ff729477 Added assert for referring to 0 offsets.
Change-Id: I7c04d934bfacd4aeaa2ba476b934dd3a62d4fc0e
Tested: on Linux.
2015-10-20 09:36:35 -07:00
Wouter van Oortmerssen 7c60937806 Added -M flatc flag to the documentation.
Change-Id: Ie19af91ec5bf0b65297cba58c124bceaa58fd73e
2015-10-19 17:05:42 -07:00
Wouter van Oortmerssen ace304513f Fixes for JS generator in Xcode 2015-10-19 16:05:39 -07:00
Wouter van Oortmerssen 1917e577a2 Fixes for JS generator in VS 2015-10-19 15:55:28 -07:00
Wouter van Oortmerssen 9c9fce96c7 Vector of structs were not being verified correctly.
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.
2015-10-19 14:11:13 -07:00
Wouter van Oortmerssen 525130765a Merge pull request #257 from evanw/javascript
Add support for JavaScript code generation with Google Closure Compiler type annotations
2015-10-19 12:49:16 -07:00
Wouter van Oortmerssen d890ef9e20 Merge pull request #298 from evolutional/master
Ported some of the python fuzz tests to C#
2015-10-19 11:11:05 -07:00
Wouter van Oortmerssen 9f69d79430 Merge pull request #296 from prideout/master
Fix minor typos in the Python documentation.
2015-10-19 10:40:16 -07:00
evolutional 9d66af6efc Ported some of the python fuzz tests to C#
* Refactored the test runner to use attribute based test discovery
* Ported value and vtable/object fuzzing tests from python to C#
2015-10-18 17:08:39 -04:00
Philip Rideout 8f1729f7df Fix minor typos in the Python documentation. 2015-10-17 17:48:06 -07:00
Evan Wallace 4bef5e89c4 Add UTF-8 support to the JavaScript API
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.
2015-10-14 23:07:40 -07:00
Evan Wallace 79222bf100 Update monster_test_generated.js baseline after rebase 2015-10-14 23:06:58 -07:00
Evan Wallace c3bfefca57 change DataView to bit twiddling for JavaScript 2015-10-14 21:15:57 -07:00
Evan Wallace 00fd394d23 remove unnecessary return 2015-10-14 21:15:57 -07:00
Evan Wallace e1e8d53df6 Add low-level fuzzer, fix 64-bit issue it found 2015-10-14 21:15:57 -07:00
Evan Wallace 57a6dd472f Add a test for JavaScript UTF-8 <=> UTF-16 conversion
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.
2015-10-14 21:15:57 -07:00
Evan Wallace 224e33ed09 Add support for JavaScript code generation
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.
2015-10-14 21:15:57 -07:00
Wouter van Oortmerssen 94680f5483 Added support for imports and many other .proto features.
Change-Id: I6600021b7ec8c486794349511232c3e604421c5b
Tested: on Linux.
2015-10-13 14:01:55 -07:00
Robert b4db88808f Merge pull request #286 from tguo-aa/fix-278
Add self.assertNotNested() in CreateString
2015-10-08 00:23:26 -07:00
tguo-aa d9db48257b Add self.assertNotNested() in CreateString
And also add a test case.
If you try to nest CreateString you will get a clear exception.
2015-09-29 08:34:10 +08:00
Wouter van Oortmerssen e1e1bced08 Fixed LoadFile on Windows 2015-09-28 16:24:34 -07:00
Wouter van Oortmerssen b56add9520 Improved documentation with links to videos, articles and who uses it.
Change-Id: I62de6b7008e397a5043d47f014a7acd83ee64740
2015-09-28 10:49:01 -07:00
Wouter van Oortmerssen 2abe24b9dd Made .proto parsing understand nested declarations.
Bug: 24401812
Change-Id: I196a03b8c5ef0bcd3c26178239c764e40ca1950d
Tested: on Linux.
2015-09-28 09:48:41 -07:00
Wouter van Oortmerssen a35c32e30f Merge pull request #282 from google/fix-277
Fix 32bit-system integer overflow (test only)
2015-09-25 14:54:50 -07:00
Robert 781c39c708 Fix 32bit-system integer overflow (test only)
For #277
2015-09-25 13:57:17 -07:00
Wouter van Oortmerssen ff9e539cc5 Merge pull request #280 from alexames/master
Removed call to pop_back on std::string.
2015-09-25 10:38:50 -07:00
Wouter van Oortmerssen feb4816610 Fixed .proto translation making scalars into required fields.
Change-Id: If414d156b4e9bc7fead5f131823b2c419cdc4e2c
Tested: on Linux.
2015-09-25 09:21:31 -07:00
Alex Ames 703b790939 Removed call to pop_back on std::string.
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.
2015-09-24 14:19:32 -07:00
Wouter van Oortmerssen 811a5c3389 Merge pull request #274 from cogumbreiro/master
Fix an out-of bounds read when the element is bigger than the buffer.
2015-09-23 12:37:45 -07:00
Robert 2736711d67 Merge pull request #275 from brunoqc/patch-1
Remove duplicate Go test
2015-09-21 15:13:24 -07:00
Bruno Bigras edb3b9c307 Remove duplicate Go test 2015-09-21 17:51:16 -04:00
Tiago Cogumbreiro 477fedccd4 Fix an out-of bounds read when the element is bigger than the buffer.
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.
2015-09-18 20:38:47 -05:00
Björn Reimer 5de28c74f9 serialize boolean in JSON to "true/false" instead of "0/1"
Change-Id: I90cf519c00eaf9ccd9fcab8035a91b9205587c3b
2015-09-16 10:31:38 -07:00
Wouter van Oortmerssen 44261ccdf1 Merge pull request #271 from vijairaj/scoped-enums
Implemented option --scoped-enum for C++ generator
2015-09-16 10:14:49 -07:00