platform/upstream/flatbuffers.git
22 months ago[debian] Add constraint for cmake version sandbox/anyj0527/v22.11.23
Yongjoo Ahn [Mon, 19 Dec 2022 09:11:04 +0000 (18:11 +0900)]
[debian] Add constraint for cmake version

- Set minimun cmake version

Change-Id: I6d9d7c60ac1d6714c1f0bf767634f5d6d928fec3
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
22 months ago[Version] Change debian version number to v22.11.23 54/285454/1
Yongjoo Ahn [Fri, 2 Dec 2022 07:43:05 +0000 (16:43 +0900)]
[Version] Change debian version number to v22.11.23

- Upgrade the debian version

Change-Id: I113e75698c584b8ef8af620f2ec648088f70f50f
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
22 months ago[Version] Bump up to v22.11.23
Yongjoo Ahn [Fri, 2 Dec 2022 07:43:05 +0000 (16:43 +0900)]
[Version] Bump up to v22.11.23

- Upgrade the version wrt upstream v22.11.23

Change-Id: I113e75698c584b8ef8af620f2ec648088f70f50f
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
22 months ago[Python] Add flatbuffers python packaging
Gichan Jang [Fri, 14 May 2021 01:09:11 +0000 (10:09 +0900)]
[Python] Add flatbuffers python packaging

Add flatbuffers python packaging

Change-Id: Idb93e673facd7c8eb91dad731547fec13af68101
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
22 months agoBump to flatbuffers 2.0.0
Gichan Jang [Thu, 13 May 2021 03:47:29 +0000 (12:47 +0900)]
Bump to flatbuffers 2.0.0

Bump to flatbuffers 2.0.0

Change-Id: I5f229796cccfdb60cd15c29996aff57f75bc5cdb
Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
22 months ago[Dist/Debian] Include .pc file in the dev-kit package
Wook Song [Tue, 15 Sep 2020 07:54:01 +0000 (16:54 +0900)]
[Dist/Debian] Include .pc file in the dev-kit package

This patch revises the packaging files for Debian/Ubuntu to include .pc
file in the development kit package.

Change-Id: Ib94702ace3a970cfe5ab435c34795ac03296e02e
Signed-off-by: Wook Song <wook16.song@samsung.com>
22 months ago[Dist/Tizen] Revise the rpm spec file to include .pc in the dev package
Wook Song [Tue, 15 Sep 2020 07:48:57 +0000 (16:48 +0900)]
[Dist/Tizen] Revise the rpm spec file to include .pc in the dev package

This patch revises the rpm spec file to include the .pc file in the
dev-kit package.

Change-Id: I456b1fa494a38cd9cd1724863028a9b69ac7df4b
Signed-off-by: Wook Song <wook16.song@samsung.com>
22 months ago[PkgConfig] Add a template for .pc file generation
Wook Song [Tue, 15 Sep 2020 07:46:31 +0000 (16:46 +0900)]
[PkgConfig] Add a template for .pc file generation

This patch adds a template file to use .pc file generation.

Change-Id: Ia4841a6c4bcf3560e1156a606a85f0d2103ffebd
Signed-off-by: Wook Song <wook16.song@samsung.com>
22 months ago[Dist/Debian] Fix unmet dependency on libgcc-s1 in the PPA package
Wook Song [Tue, 15 Sep 2020 02:40:39 +0000 (11:40 +0900)]
[Dist/Debian] Fix unmet dependency on libgcc-s1 in the PPA package

Since PPA tries to use the latest gcc, the package released via PPA has
an issue related to the unmet dependency on libgcc-s1. To fix it, this
patch adds explicit build dependencies on gcc << 10.

Change-Id: If76cde33d9b6aaeb051894b55c22f256bddc9a36
Signed-off-by: Wook Song <wook16.song@samsung.com>
22 months agoBump to flatbuffers 1.12.0
Geunsik Lim [Mon, 3 Aug 2020 08:34:45 +0000 (17:34 +0900)]
Bump to flatbuffers 1.12.0

Change-Id: I228241b006edf9850e035a96b69fc6c305905280
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
22 months agoAdd -fno-lto for creating static library
Semun Lee [Fri, 17 Jul 2020 09:27:47 +0000 (18:27 +0900)]
Add -fno-lto for creating static library

When -flto option is used, static library doesn't contain
symbol names in it.
It may leads "undefined symbol" problem in some applications.

Change-Id: I3ab5f644b72e504d9390311e4ce945d9ac28527e
Signed-off-by: Semun Lee <semun.lee@samsung.com>
22 months ago[Dist/Debian] Initial debianization for v1.11.0
Wook Song [Wed, 12 Feb 2020 07:25:15 +0000 (16:25 +0900)]
[Dist/Debian] Initial debianization for v1.11.0

Initial debianization for v1.11.0.

Change-Id: Ie27a37855e782277c60908ebea9b363d296d34a3
Signed-off-by: Wook Song <wook16.song@samsung.com>
22 months agoRe-ported build-error workaround from 1.6.0
MyungJoo Ham [Fri, 27 Mar 2020 00:52:34 +0000 (09:52 +0900)]
Re-ported build-error workaround from 1.6.0

There was a build-error fix in flatbuffers-1.6.0, which
was in bash build script. They appear to lose it when
they abandoned the bash build script.

The following is the commit message of the workaround
of flatbuffers 1.6.0 mainline:

Work around flatbuffers flaky build

The flatbuffers build ocasionally fails with the following error:

/flatbuffers/flatbuffers-1.6.0/src/idl_parser.cpp
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:17:
error: 'MyGame' has not been declared
 using namespace MyGame::Sample;
                 ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:25:
error: 'Sample' is not a namespace-name
 using namespace MyGame::Sample;
                         ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:31:
error: expected namespace-name before ';' token
 using namespace MyGame::Sample;
                               ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp: In
function 'int main(int, const char**)':
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:25:3:
error: 'flatbuffers' has not been declared
   flatbuffers::FlatBufferBuilder builder;
   ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:28:26:
error: 'builder' was not declared in this scope
   auto weapon_one_name = builder.CreateString("Sword");
                          ^
...

Disabling the BUILD_TESTS target removes the flakiness and makes the
compilation faster.

Reviewed-on: http://gerrit.cloudera.org:8080/12886
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Tim Armstrong <tarmstrong@cloudera.com>
Change-Id: Ica8300d7edad7d10adad311cc22c18b8987b1f9b
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
22 months ago[Dist/Tizen] Add rpm spec and manifest files to support GBS
Parichay Kapoor [Fri, 15 Nov 2019 06:22:27 +0000 (15:22 +0900)]
[Dist/Tizen] Add rpm spec and manifest files to support GBS

This PR provides tizen packages, flatbuffers and flatbuffers-devel.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
22 months agoFlatBuffers Version 22.11.23 (#7662)
Derek Bailey [Wed, 23 Nov 2022 19:32:19 +0000 (11:32 -0800)]
FlatBuffers Version 22.11.23 (#7662)

22 months agoFlatBuffers Version 22.11.22
Derek Bailey [Tue, 22 Nov 2022 22:40:01 +0000 (14:40 -0800)]
FlatBuffers Version 22.11.22

22 months agoAdd --go-module-name flag to support generating Go module compatible code (#7651)
Michael Le [Tue, 22 Nov 2022 22:28:01 +0000 (14:28 -0800)]
Add --go-module-name flag to support generating  Go module compatible code (#7651)

* Add --go-module-name flag to support generating code for go modules

* Rename echo example folder

* Grammar

* Update readme for go-echo example

* Update readme for go-echo example

* Re-enable go modules after test is done

22 months agoAdd key lookup support for tables in Go (#7644)
Michael Le [Tue, 22 Nov 2022 22:08:19 +0000 (14:08 -0800)]
Add key lookup support for tables in Go (#7644)

* Add support for key lookup for tables in Go

* Run clang format

* Run go fmt on tests

* Remove TODO in tests

* Update LookupByKey API

* Update LookupByKey API

* Don't use resolvePointer in expectEq

* Use generated getters instead of reading values directly from buffer

* Fix typo

Co-authored-by: Derek Bailey <derekbailey@google.com>
22 months agoFix go generator undefined Package name, also throwing exception (#7632)
Saman [Tue, 22 Nov 2022 21:21:25 +0000 (16:21 -0500)]
Fix go generator undefined Package name, also throwing exception (#7632)

* Fix go generator undefined Package, also throw exception in specific examples.

* Add test for go generator import problem

* Add new version of generated go file. Fix conflict.

* Add executable permission to generate_code.py script.

* Improve test quality, remove unwanted generated files, better naming

* Fix comments

* clang format

Co-authored-by: Derek Bailey <derekbailey@google.com>
22 months agoupdated method call (#7642)
TJKoury [Tue, 22 Nov 2022 21:01:32 +0000 (16:01 -0500)]
updated method call (#7642)

22 months agoFixed the BytesConsumed function, which was pointing slightly ahead. (#7657)
Alex Ames [Tue, 22 Nov 2022 20:11:14 +0000 (12:11 -0800)]
Fixed the BytesConsumed function, which was pointing slightly ahead. (#7657)

The BytesConsumed function uses the `cursor_` to determine how many
bytes have been consumed by the parser, in case the user of the Parser
object wants to step over the parsed flatbuffer that is embedded in some
larger string. However, the `cursor_` is always one token ahead, so that
it can determine how to consume it. It points at the token that is about
to be consumed, which is ahead of the last byte consumed.

For example, if you had a string containing these two json objects and
parsed them...

    "{\"key\":\"value\"},{\"key\":\"value\"}"

...then the `cursor_` would be pointing at the comma between the two
tables. If you were to hold a pointer to the beginning of the string and
add `BytesConsumed()` to it like so:

    const char* json = // ...
    parser.ParseJson(json);
    json += parser.BytesConsumed();

then the pointer would skip over the comma, which is not the expected
behavior. It should only consume the table itself.

The solution is simple: Just hold onto a previous cursor location and
use that for the `BytesConsumed()` call. The previous cursor location
just needs to be set to the cursor_ location each time the cursor_ is
about to be updated. This will result in `BytesConsumed()` returning
the correct number of bytes without the off-by-one-token error.

Co-authored-by: Derek Bailey <derekbailey@google.com>
22 months ago[C#] Fix collision of member if union name is "Value" (#7648)
tira-misu [Tue, 22 Nov 2022 20:00:13 +0000 (21:00 +0100)]
[C#] Fix collision of member if union name is "Value" (#7648)

* Fix C/C++ Create<Type>Direct with sorted vectors

If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".

* Changes due to code review

* Improve code readability

* Add generate of JSON schema to string to lib

* option indent_step is supported

* Remove unused variables

* Fix break in test

* Fix style to be consistent with rest of the code

* [TS] Fix reserved words as arguments (#6955)

* [TS] Fix generation of reserved words in object api (#7106)

* [TS] Fix generation of object api

* [TS] Fix MakeCamel -> ConvertCase

* [C#] Fix collision of field name and type name

* [TS] Add test for struct of struct of struct

* Update generated files

* Add missing files

* [TS] Fix query of null/undefined fields in object api

* [C#] Fix collision of member if enum name is "Value"

* Fix due to style guide

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoAdd support for using array of scalar as key field in Cpp (#7623)
Wen Sun [Fri, 18 Nov 2022 19:04:46 +0000 (11:04 -0800)]
Add support for using array of scalar as key field in Cpp (#7623)

* add support for using array of scalar as key field

* update cmakelist and test.cpp to include the tests

* update bazel rule

* address comments

* clang format

* delete comment

* delete comment

* address the rest of the commnets

* address comments

* update naming in test file

* format build file

* buildifier

* make keycomparelessthan call keycomparewithvalue

* update to use flatbuffer array instead of raw pointer

* clang

* format

* revert format

* revert format

* update

* run generate_code.py

* run code generator

* revert changes by generate_code.py

* fist run make flatc and then run generate_code.py

Co-authored-by: Wen Sun <sunwen@google.com>
23 months agoFix schema to binary test, when build and run from all directories. specially when...
Saman [Fri, 18 Nov 2022 04:24:48 +0000 (23:24 -0500)]
Fix schema to binary test, when build and run from all directories. specially when add to other projects. (#7650)

23 months agoPut documentation to bfbs if it is not empty (#7649)
tira-misu [Thu, 17 Nov 2022 23:55:42 +0000 (00:55 +0100)]
Put documentation to bfbs if it is not empty (#7649)

* Fix C/C++ Create<Type>Direct with sorted vectors

If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".

* Changes due to code review

* Improve code readability

* Add generate of JSON schema to string to lib

* option indent_step is supported

* Remove unused variables

* Fix break in test

* Fix style to be consistent with rest of the code

* [TS] Fix reserved words as arguments (#6955)

* [TS] Fix generation of reserved words in object api (#7106)

* [TS] Fix generation of object api

* [TS] Fix MakeCamel -> ConvertCase

* [C#] Fix collision of field name and type name

* [TS] Add test for struct of struct of struct

* Update generated files

* Add missing files

* [TS] Fix query of null/undefined fields in object api

* Put documentation to bfbs if it is not empty

* Fix monster test bfbs reference files

* Fix generated monster test files

Why they are different when generating it with linux and windows executable?

23 months agoAdd _deps/ to gitignore
Derek Bailey [Sun, 13 Nov 2022 20:00:07 +0000 (12:00 -0800)]
Add _deps/ to gitignore

23 months ago[Go] Fix GenNativeUnionUnPack for imported union type. (#7579)
Gh0u1L5 [Sun, 13 Nov 2022 19:52:02 +0000 (03:52 +0800)]
[Go] Fix GenNativeUnionUnPack for imported union type. (#7579)

* Fix GenNativeUnionUnPack for imported union type.

* Update test results.

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoFix import problem in dart generated files. (fixes #7609). (#7621)
Saman [Sun, 13 Nov 2022 19:21:57 +0000 (14:21 -0500)]
Fix import problem in dart generated files. (fixes #7609). (#7621)

* Fix import problem in dart generated files. (fixes #7609).

* Fix naming.

* Fix minor changes in generated files.

* Add some tests. Fix minor problems.

* Fix minor format problem plus import alias issue.

* Minor fix in dart code generator, remove java from examples

* remove java and go generated files

* Fix dart tests.

* Fix spell problem.

* Remove excessive tests :))

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months ago[swift] fix broken swift test build (#7633) (#7634)
mr-swifter [Fri, 11 Nov 2022 17:36:47 +0000 (20:36 +0300)]
[swift] fix broken swift test build (#7633) (#7634)

* [swift] fix broken swift test build (#7633)

* [swift] fix unused variable (#7633)

* [swift] update generated code (#7633)

* [swift] add binary & json test for nan, inf, -inf for swift (#7633)

* [swift] use just '.infinity' instead of '+.infinity' (#7633)

* [swift] remove commented code (#7633)

Co-authored-by: Derek Bailey <derekbailey@google.com>
Co-authored-by: mustiikhalil <26250654+mustiikhalil@users.noreply.github.com>
23 months agoFixes #7345 to add the option to minify enums (#7566)
RishabhDeep Singh [Fri, 11 Nov 2022 04:47:28 +0000 (10:17 +0530)]
Fixes #7345 to add the option to minify enums (#7566)

* Added cpp minified enums

* Update generated files

* remove initializer and fix comma

* Fix .gitignore

* Fix comma

* Add tests for cpp minify enums

23 months ago[C++] Minireflect: Add option to indent when converting table to string (#7602)
M. Şamil Ateşoğlu [Fri, 11 Nov 2022 02:57:29 +0000 (05:57 +0300)]
[C++] Minireflect: Add option to indent when converting table to string (#7602)

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoAdd comparison operator to python objects under --gen-compare option (#7610)
Alex-Ratcliffe [Fri, 11 Nov 2022 02:47:53 +0000 (13:47 +1100)]
Add comparison operator to python objects under --gen-compare option (#7610)

* Add comparison operator to python code generator

* Missing semi-colon

* Regenerate test examples

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months ago[CMake]: only warn when the working directory in a git worktree (#7562)
Rudi Heitbaum [Fri, 11 Nov 2022 02:21:38 +0000 (13:21 +1100)]
[CMake]: only warn when the working directory in a git worktree (#7562)

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoTemporary fix for SLSA generators (#7636)
laurentsimon [Fri, 11 Nov 2022 02:09:01 +0000 (18:09 -0800)]
Temporary fix for SLSA generators (#7636)

* Temporary fix for SLSA generators

Sigstore made a breaking change as part of their recent GA announcement. We need a temporary fix to avoid builder failure (see slsa-framework/slsa-github-generator#1163)

/cc @asraa

* Update build.yml

23 months agoUses swift build command directly in the CI (#7635)
mustiikhalil [Thu, 10 Nov 2022 22:16:42 +0000 (23:16 +0100)]
Uses swift build command directly in the CI (#7635)

23 months agoFix handling of +/-inf defaults in TS/rust/go/dart codegen (#7588)
James Kuszmaul [Tue, 8 Nov 2022 18:59:46 +0000 (10:59 -0800)]
Fix handling of +/-inf defaults in TS/rust/go/dart codegen (#7588)

+/-inf were not being handled, and so invalid typescript was being
generated when a float/double had an infinite default value. NaN was
being handled correctly.

Co-authored-by: Derek Bailey <derekbailey@google.com>
Co-authored-by: Casper <casperneo@uchicago.edu>
23 months agoAdd support for parsing proto map fields (#7613)
Michael Le [Tue, 8 Nov 2022 18:51:24 +0000 (10:51 -0800)]
Add support for parsing proto map fields (#7613)

* Add support for proto 3 map to fbs gen

* Run clang-format

* Update proto golden test

* Rename variables

* Remove iostream

* Remove iostream

* Run clang format

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoFix help output for --gen-includes (#7611)
Ben Beasley [Tue, 8 Nov 2022 18:16:17 +0000 (13:16 -0500)]
Fix help output for --gen-includes (#7611)

Fixes the --help output documenting the deprecated --gen-includes
option, in which the option name contained a typo (--gen-inclues).

23 months agoFix missing spaces in flatc help text (#7612)
Ben Beasley [Tue, 8 Nov 2022 17:59:48 +0000 (12:59 -0500)]
Fix missing spaces in flatc help text (#7612)

* Fix error in --json-nested-bytes help text

Correct “bytesin” to “bytes in”

* Fix missing space in --no-leak-private-annotation help text

23 months agoFix: arduino platform build (#7625)
刘帅 [Tue, 8 Nov 2022 17:53:53 +0000 (01:53 +0800)]
Fix: arduino platform build (#7625)

23 months agoFix current official name of macOS (#7627)
Valeriy Van [Tue, 8 Nov 2022 17:49:27 +0000 (19:49 +0200)]
Fix current official name of macOS (#7627)

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoAdd missing #include <algorithm> for std::min/std::max uses, and #include <limits...
Even Rouault [Tue, 8 Nov 2022 17:36:35 +0000 (18:36 +0100)]
Add missing #include <algorithm> for std::min/std::max uses, and #include <limits> for std::numeric_limits<> (#7624)

23 months agoBump Rust version to 22.10.26 before publication (#7622)
Casper [Thu, 3 Nov 2022 16:24:00 +0000 (12:24 -0400)]
Bump Rust version to 22.10.26 before publication (#7622)

23 months agoAdded option to not requires an EoF token when parsing JSON (#7620)
Alex Ames [Thu, 3 Nov 2022 15:57:46 +0000 (08:57 -0700)]
Added option to not requires an EoF token when parsing JSON (#7620)

Previously when parsing a JSON representation of a Flatbuffer, the
parser required that the input string contain one and only one root
table. This change adds a flag that removes that requirement, so that
if a Flatbuffer table is embedded in some larger string the parser will
simply stop parsing once it reaches the end of the root table, and does
not validate that it has reached the end of the string.

This change also adds a BytesConsumed function, which returns the number
of bytes the parser consumed. This is useful if the table embedded in
some larger string that is being parsed, and that outer parser needs to
know how many bytes the table was so that it can step over it.

23 months agopython: object generation prefix and suffix (#7565)
inaryart [Sat, 29 Oct 2022 00:37:27 +0000 (08:37 +0800)]
python: object generation prefix and suffix (#7565)

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoAdd CreateSharedString to python builder (#7608)
Michael Le [Sat, 29 Oct 2022 00:28:35 +0000 (17:28 -0700)]
Add CreateSharedString to python builder (#7608)

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoAdd check for presence of realpath to CMakeLists.txt to support more platforms (...
Alejandro Ramallo [Sat, 29 Oct 2022 00:23:36 +0000 (20:23 -0400)]
Add check for presence of realpath to CMakeLists.txt to support more platforms (#7603)

* add automatic check for realpath in CMakeLists

* added win32 check

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoUpdate DartTest.sh golden files (#7606)
Michael Le [Sat, 29 Oct 2022 00:15:14 +0000 (17:15 -0700)]
Update DartTest.sh golden files (#7606)

23 months ago[TS] Add support for fixed length arrays on Typescript (#5864) (#7021) (#7581)
Bulent Vural [Sat, 29 Oct 2022 00:00:24 +0000 (03:00 +0300)]
[TS] Add support for fixed length arrays on Typescript (#5864) (#7021) (#7581)

* [TS] Add support for fixed length arrays on Typescript (#5864) (#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
* Formatting & readability fixes on idl_gen_ts.cpp

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
* Added array_test_complex.bfbs

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
* TS arrays_test_complex: Remove bfbs and use  fbs directly

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
23 months ago`build.yml`: Fix missing 'v' in version
Derek Bailey [Thu, 27 Oct 2022 23:14:26 +0000 (16:14 -0700)]
`build.yml`: Fix missing 'v' in version

23 months ago`build.yml` Update to Kotlin Wrapper 1.0.5
Derek Bailey [Thu, 27 Oct 2022 20:55:41 +0000 (13:55 -0700)]
`build.yml` Update to Kotlin Wrapper 1.0.5

23 months ago`release.yml` Use env var for passphrase
Derek Bailey [Thu, 27 Oct 2022 05:50:05 +0000 (22:50 -0700)]
`release.yml` Use env var for passphrase

23 months ago`release.yml` Add GPG key for Maven
Derek Bailey [Thu, 27 Oct 2022 05:37:11 +0000 (22:37 -0700)]
`release.yml` Add GPG key for Maven

23 months ago`release.yml`: Add Maven Steps
Derek Bailey [Thu, 27 Oct 2022 05:27:20 +0000 (22:27 -0700)]
`release.yml`: Add Maven Steps

23 months ago`release_yml` Use new dotnet version
Derek Bailey [Thu, 27 Oct 2022 00:15:51 +0000 (17:15 -0700)]
`release_yml` Use new dotnet version

23 months ago`release.yml` Use NuGet Key directly
Derek Bailey [Thu, 27 Oct 2022 00:05:08 +0000 (17:05 -0700)]
`release.yml` Use NuGet Key directly

23 months ago`release.yml` Changed Push to follow examples
Derek Bailey [Thu, 27 Oct 2022 00:01:11 +0000 (17:01 -0700)]
`release.yml` Changed Push to follow examples

23 months ago`release.yml` Fix nuget push command
Derek Bailey [Wed, 26 Oct 2022 23:41:17 +0000 (16:41 -0700)]
`release.yml` Fix nuget push command

23 months ago`release.yml` Add Nuget support
Derek Bailey [Wed, 26 Oct 2022 23:36:35 +0000 (16:36 -0700)]
`release.yml` Add Nuget support

23 months agoFlatBuffers Version 22.10.26 (#7607)
Derek Bailey [Wed, 26 Oct 2022 23:02:38 +0000 (16:02 -0700)]
FlatBuffers Version 22.10.26 (#7607)

23 months ago`setup.py`: Define version directly
Derek Bailey [Wed, 26 Oct 2022 22:31:02 +0000 (15:31 -0700)]
`setup.py`: Define version directly

Define the version directly instead of loading from an environment variable and writing to a file.

23 months ago`release.yml`: Switch to `python` directory
Derek Bailey [Wed, 26 Oct 2022 22:29:02 +0000 (15:29 -0700)]
`release.yml`: Switch to `python` directory

23 months ago`release.yml`: Add publishing to PyPi
Derek Bailey [Wed, 26 Oct 2022 22:17:21 +0000 (15:17 -0700)]
`release.yml`: Add publishing to PyPi

23 months ago[Python] Fixed the issue with nested unions relying on InitFromBuf. (#7576)
Joshua Smith [Wed, 26 Oct 2022 21:56:52 +0000 (22:56 +0100)]
[Python] Fixed the issue with nested unions relying on InitFromBuf. (#7576)

* feat: Fixed the issue with nested unions relying on InitFromBuf.
Problem: Issue #7569
Nested Unions were broken with the introduction of parsing buffers with an initial encoding offset.

Fix:
Revert the InitFromBuf method to the previous version and introduction of InitFromPackedBuf that allows
users to read types from packed buffers applying the offset automatically.

Test:
Added in TestNestedUnionTables to test the encoding and decoding ability using a nested table with a
union field.

* fix: Uncommented generate code command

23 months agorelease.yml: Typo
Derek Bailey [Wed, 26 Oct 2022 07:40:43 +0000 (00:40 -0700)]
release.yml: Typo

23 months agorelease.yml: Remove `npm ci`
Derek Bailey [Wed, 26 Oct 2022 07:35:11 +0000 (00:35 -0700)]
release.yml: Remove `npm ci`

This command [was suggested](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry) in the github docs, but not in our release steps.

23 months agoCreate release.yml (#7605)
Derek Bailey [Wed, 26 Oct 2022 07:30:16 +0000 (00:30 -0700)]
Create release.yml (#7605)

Create a new `release.yml` for defining automatic publishing to package managers on releases.

Adds the NPM publishing steps as it is the most straightforward.

23 months agoFlatBuffers Version 22.10.25 (#7604)
Derek Bailey [Wed, 26 Oct 2022 07:03:49 +0000 (00:03 -0700)]
FlatBuffers Version 22.10.25 (#7604)

23 months ago[vector] Allow to iterate with mutables (#7586)
ArnaudD-FR [Fri, 21 Oct 2022 19:10:18 +0000 (21:10 +0200)]
[vector] Allow to iterate with mutables (#7586)

Co-authored-by: ArnaudD-FR <arnaud.desmier@gmail.com>
Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months ago[Nim] Bfbs Nim Generator (#7534)
Dan Lapid [Fri, 21 Oct 2022 18:30:04 +0000 (21:30 +0300)]
[Nim] Bfbs Nim Generator (#7534)

* Bfbs Nim Generator

* Remove commented out tests

* add missing line to idl.h

* Commit python reflection changes

* Commit python reflection changes and move tests

* Remove default string addition

* Move tests to python file

* Fix element size check when element is table

* remove whitespace changes

* add element_type docs and commit further to namer and remove kkeep

* Bfbs Nim Generator

* Remove commented out tests

* add missing line to idl.h

* Commit python reflection changes

* Commit python reflection changes and move tests

* Remove default string addition

* Move tests to python file

* Fix element size check when element is table

* remove whitespace changes

* add element_type docs and commit further to namer and remove kkeep

* remove unused variables

* added tests to ci

* added tests to ci

* fixes

* Added reflection type Field, Variable to namer

* Moved reflection namer impl to bfbsnamer

* Remove whitespace at end of line

* Added nim to generated code

* Revert whitespace removal

Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoMake type conversions explicit. (#7595)
Dominic Battre [Fri, 21 Oct 2022 16:09:28 +0000 (18:09 +0200)]
Make type conversions explicit. (#7595)

As Java does not support unsigned integer types, the value types
are "rounded up" (an uint32 is represented as a long) but persisted
correctly (an uint32 is persisted as 4 bytes).

This CL makes a cast operation explicit so that the compiler
does not throw warning messages.

Co-authored-by: Dominic Battre <battre@chromium.org>
Co-authored-by: Derek Bailey <derekbailey@google.com>
23 months agoFix LongEnum definitions (#7596)
Dominic Battre [Fri, 21 Oct 2022 01:15:00 +0000 (03:15 +0200)]
Fix LongEnum definitions (#7596)

The MyGame/Example/LongEnum.java class did not compile because
Java expects an "L" suffix for literals of type long.

This CL fixes the code generation to include such a suffix.

Co-authored-by: Dominic Battre <battre@chromium.org>
2 years agoRust fix compilation for no_std targets #2 (#7553)
Dan Lapid [Wed, 19 Oct 2022 13:14:41 +0000 (16:14 +0300)]
Rust fix compilation for no_std targets #2 (#7553)

* Fix nightly no_std

* Fix nightly no_std

2 years agoUpdate Rust version (#7574)
Casper [Tue, 18 Oct 2022 20:37:12 +0000 (16:37 -0400)]
Update Rust version (#7574)

Co-authored-by: Casper Neo <cneo@google.com>
2 years agotests/test.cpp contains a couple of tests that are only executed (#7571)
Dominic Battre [Tue, 18 Oct 2022 19:37:06 +0000 (21:37 +0200)]
tests/test.cpp contains a couple of tests that are only executed (#7571)

on a subset of platforms. The test calls are guarded via #ifndef
FLATBUFFERS_NO_FILE_TEST.

Embedders of flatbuffers that rely on -Werror,-Wunused-function
compiler flags (like chromium) complain about the exsitence of these
tests in the anonymous namespace.

This CL guards the test definitions as well (not just the test
calls).

Co-authored-by: Dominic Battre <battre@chromium.org>
Co-authored-by: Derek Bailey <derekbailey@google.com>
2 years agoFix #7580 by documenting union schema evolution rules (#7585)
Casper [Mon, 17 Oct 2022 21:49:28 +0000 (17:49 -0400)]
Fix #7580 by documenting union schema evolution rules (#7585)

Co-authored-by: Casper Neo <cneo@google.com>
2 years agoTurn on clippy for Rust and fix lints for non-generated code (#7575)
Casper [Tue, 11 Oct 2022 01:26:35 +0000 (21:26 -0400)]
Turn on clippy for Rust and fix lints for non-generated code (#7575)

Co-authored-by: Casper Neo <cneo@google.com>
2 years agoUpdate documentation to mention enum value attributes (#7570)
Piotr Dziwiński [Sat, 8 Oct 2022 23:52:38 +0000 (12:52 +1300)]
Update documentation to mention enum value attributes (#7570)

2 years agoAdd support for metadata attributes for enum values (#7567) (#7568)
Piotr Dziwiński [Fri, 7 Oct 2022 00:18:00 +0000 (13:18 +1300)]
Add support for metadata attributes for enum values (#7567) (#7568)

* Add support for metadata attributes for enum values (#7567)

* Fix path lookup in flatc test

* Try a fix for Windows paths

* Convert path to string to fix Windows error

2 years agoFlatBuffers Version 22.9.29 (#7557)
Derek Bailey [Fri, 30 Sep 2022 05:12:07 +0000 (22:12 -0700)]
FlatBuffers Version 22.9.29 (#7557)

2 years ago[TS] Make strict compliant and improve typings (#7549)
Björn Harrtell [Thu, 29 Sep 2022 22:03:35 +0000 (00:03 +0200)]
[TS] Make strict compliant and improve typings (#7549)

* [TS] Make strict compliant and improve typings

* clang-format

* Code gen harmonize

Co-authored-by: Derek Bailey <derekbailey@google.com>
2 years agoRust soundness fixes (#7518)
Raphael Taylor-Davies [Thu, 29 Sep 2022 13:58:49 +0000 (14:58 +0100)]
Rust soundness fixes (#7518)

* Rust soundness fixes

* Second pass

* Make init_from_table unsafe

* Remove SafeSliceAccess

* Clippy

* Remove create_vector_of_strings

* More clippy

* Remove deprecated root type accessors

* More soundness fixes

* Fix EndianScalar for bool

* Add TriviallyTransmutable

* Add debug assertions

* Review comments

* Review feedback

2 years agoMoves swift package to root of repository so it can be used directly … (#7548)
mustiikhalil [Tue, 27 Sep 2022 21:32:05 +0000 (23:32 +0200)]
Moves swift package to root of repository so it can be used directly … (#7548)

* Moves swift package to root of repository so it can be used directly from the main repo

Fixing paths for swift directory

* Update swift readme

2 years agoFlatBuffers Version 22.9.24 (#7547)
Derek Bailey [Tue, 27 Sep 2022 18:55:25 +0000 (11:55 -0700)]
FlatBuffers Version 22.9.24 (#7547)

2 years agoEmit internal enums when swift_implementation_only (#7545)
Mark Pauley [Sat, 24 Sep 2022 18:15:39 +0000 (11:15 -0700)]
Emit internal enums when swift_implementation_only (#7545)

- Copy the same pattern as structs and tables
- Fixes google#7542

2 years ago[Python] Python fixed size array (#7529)
Joshua Smith [Thu, 22 Sep 2022 18:08:09 +0000 (19:08 +0100)]
[Python] Python fixed size array (#7529)

* feat: Added support for fixed sized arrays to python

Problem:
We encountered that using fixed arrays from C++ to python that python would
not read those arrays correctly due to no size information being encoded in the byte
array itself.

Fix:
Encode the sizes within the generated python file during code generation.
Specfically we add GetArrayAsNumpy to the python version of table, which takes as input
the length of the vector. When generating the python message files we include this length
from the VectorType().fixed_length.

* fix: added digit support for camel case to snake case conversion

Problem:
When including a number in the message name we would encounter cases where SnakeCase would
not add the appropirate breaks. e.g. Int32Stamped -> int_32stamped rather than int_32_stamped.

Fix:
To fix this we can add the condition that we check if the current character is not lower and
not a digit, that we check if the previous character was a lower or digit. If it was a lower
or digit then we add the break.

* fix: Array support for structures

Problem:
The python generated code for handling non-struct and struct vectors
and arrays was inconsistent. The calls to populate the obj api was
creating incorrect code.

Solution:
To fix this the VectorOfStruct and VectorOfNonStruct was rewritten
to handle array cases and bring the two methods in line which each
other.

Testing:
PythonTesting.sh now correctly runs and generates the code for
array_test.fbs.
Minor modifications were done on the test to use the new index
accessor for struct arrays and the script correctly sources the
location of the python code.

* chore: clang format changes

* Added code generated by scripts/generate_code. Modified GetArrayOfNonStruct slightly
to allow for function overloading allowing the user to get a single element of an array
or the whole array.

* Added new_line parameter to OffsetPrefix to allow optional new lines to be added.
This allows us to use the GenIndents method that automatically adds new lines instead.

* Reupload of generated code from the scripts/generate_code.py

* Removed new line in GetVectorAsNumpy.

* Updated Array lengths to use Length methods where possible. Added fallthrough for GenTypePointer. Added digit check to CamelToSnake method. Added and modified tests for ToSnakeCase and CamelToSnake.

* Added range check on the getter methods for vector and array types. Renamed == as is for python

2 years agoUpgrade grpc to 1.49.0 and make sure it builds (#7538)
Yun Peng [Wed, 21 Sep 2022 19:53:03 +0000 (21:53 +0200)]
Upgrade grpc to 1.49.0 and make sure it builds (#7538)

Co-authored-by: Derek Bailey <derekbailey@google.com>
2 years ago[C++] Rare bad buffer content alignment if sizeof(T) != alignof(T) (#7520)
Denis Blank [Wed, 21 Sep 2022 18:05:05 +0000 (20:05 +0200)]
[C++] Rare bad buffer content alignment if sizeof(T) != alignof(T) (#7520)

* [C++] Add a failing unit test for #7516 (Rare bad buffer content alignment if sizeof(T) != alignof(T))

* [C++] Fix final buffer alignment when using an array of structs
* A struct can have an arbitrary size and therefore sizeof(struct) == alignof(struct)
  does not hold anymore as for value primitives.
* This patch fixes this by introducing alignment parameters to various
  CreateVector*/StartVector calls.
* Closes #7516

2 years agoFix conform (#7532)
Dorochi [Thu, 15 Sep 2022 04:45:40 +0000 (12:45 +0800)]
Fix conform (#7532)

* Fix conform;
Make sure the command fails when tail fields are removed;

* Fix last commit according to dbaileychess' comment

2 years agoUnPackTo disable merge by default (#7527)
Derek Bailey [Wed, 14 Sep 2022 05:00:01 +0000 (22:00 -0700)]
UnPackTo disable merge by default (#7527)

* UnPackTo disable merge by default

* avoid double free in test

* remove merge parameter

* remove shrink to fit

2 years ago[TS/JS] Move TS tests to dedicated folder and deps upgrade (#7508)
Björn Harrtell [Tue, 13 Sep 2022 03:03:23 +0000 (05:03 +0200)]
[TS/JS] Move TS tests to dedicated folder and deps upgrade (#7508)

* Move TS tests to dedicated folder and deps upgrade

* Attempt to fix generate_code

* Fix dir on CI

* Add js extension

* Fix missing extension

* Harmonize with test gen

* Unexplained code gen change

* Restore yarn.lock

* Naive attempt to fix bazel stuff

* Pin @bazel/typescript to 5.2.0

* Attempt to fix bazel

* More tweak

* Upgrade deps

* Tweak?

* Fix path

* Fix test package

Co-authored-by: Derek Bailey <derekbailey@google.com>
2 years agoBump junit from 4.13 to 4.13.1 in /java (#7526)
dependabot[bot] [Mon, 12 Sep 2022 02:56:51 +0000 (19:56 -0700)]
Bump junit from 4.13 to 4.13.1 in /java (#7526)

Bumps [junit](https://github.com/junit-team/junit4) from 4.13 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.13...r4.13.1)

---
updated-dependencies:
- dependency-name: junit:junit
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years agoReplace `bash JavaTest.sh` with `mvn test` (#7500)
Nick [Mon, 12 Sep 2022 00:46:46 +0000 (19:46 -0500)]
Replace `bash JavaTest.sh` with `mvn test` (#7500)

* Start of mvn-ification of the test

* move to right locations

* Update the IO done in the test to read from resources / write to temp folders

* Add github workflow attempt to mvn test it instead of JavaTest.sh

* Pin the Kotlin benchmark's symlink for /java to the right location

* Inline equality assertions and format JavaTest.java

* fix android gradle source directory

Co-authored-by: Derek Bailey <derekbailey@google.com>
2 years agoenabled cpp17 tests in CI (#7524)
Derek Bailey [Sun, 11 Sep 2022 23:08:07 +0000 (16:08 -0700)]
enabled cpp17 tests in CI (#7524)

2 years agoprevent force_align attribute on enums (#7523)
Derek Bailey [Sat, 10 Sep 2022 20:41:58 +0000 (13:41 -0700)]
prevent force_align attribute on enums (#7523)

2 years agoremove travis config (#7522)
Derek Bailey [Sat, 10 Sep 2022 19:36:51 +0000 (12:36 -0700)]
remove travis config (#7522)

* remove travis config

* remove more travis and appveyor stuff

* remove appveyor specific things

2 years ago[Java][Flexbuffers] Add API to add nullables into the buffer. (#7521)
Paulo Pinheiro [Sat, 10 Sep 2022 16:13:01 +0000 (18:13 +0200)]
[Java][Flexbuffers] Add API to add nullables into the buffer. (#7521)

Fix #7517

2 years agoInstall BuildFlatBuffers.cmake (#7519)
Derek Bailey [Sat, 10 Sep 2022 07:30:47 +0000 (00:30 -0700)]
Install BuildFlatBuffers.cmake (#7519)

2 years agoMoves all of the swift test code into tests/swift (#7509)
mustiikhalil [Sat, 10 Sep 2022 05:35:42 +0000 (07:35 +0200)]
Moves all of the swift test code into tests/swift (#7509)

Fixes failing tests by regenerating test cases

2 years agoUpdated Readme
Derek Bailey [Sat, 3 Sep 2022 15:05:36 +0000 (08:05 -0700)]
Updated Readme

Added links to runtime packages for variety of languages.