Commit Graph

22 Commits

Author SHA1 Message Date
Björn Harrtell 760c657551
[TS/JS] New gen TS code gen (#6302)
* TS/ES6 modules spike iteration 1

* Initial modularized dasherized output

* Remove obsoleted parts and namespace wrapping

* Use _flatbuffers_ prefix

* First part of imports logic

* Second part of imports logic

* Fix TS/JS code removal mixup

* Alias imported symbols if same name from different namespaces and some fixes

* Use star import for bare imports

* Fix messed up string concat

* var to const and remove not needed semi

* Remove some cases of ns prefixing

* Add missing space

* Cleanups

* Completed initial import tracking logic

* Compilable output

* Adjust TypeScriptTest and dependents to work

* Use local flatbuffers package for tests

* Refactor away use of any

* Remove obsolete imported_fileset and reexport_map

* Still need any and fix JavaScriptTest.sh

* Fix test runs out of the box

* Temp add generated files

* TypeScriptTest replaces JavaScriptTest and cleanups

* Also remove reference to JavaScriptTest in TestAll.sh

* Remove old generated ts/js files

* Remove use of --js in generate_code scripts

* idl_gen_js_ts to idl_gen_ts and removal of js gen

* Remove obsoleted options

* Fix obsolete ts test detection

* Tweak ts compilation be as strict as possible

* Remove jsdoc type annotation generation

* Generated test ts files

* Fix search and replace messup

* Regenerated ts test output

* Use CharToLower

* Use normal for loop

* Rework namespacedir

* Revert "Rework namespacedir"

This reverts commit 6f4eb0104ceeb86011bb076ebca901138c48e068.

* Revert "Use normal for loop"

This reverts commit 676b2135bfaa1853dfbb06c92b5c16a0d81bb13a.

* Revert "Use CharToLower"

This reverts commit 2d08648d0d72d0af201fad80d54cdc76412b35e9.

* Again do rework but correct

* Avoid runtime cast

* Fix test runs

* Also add npm install to get tsc

* Bump node test versions

* for range to std for loop

* Clang format

* Missed one clang format

* Move accessor to later

* Attempt to make windows version of TypeScriptTest

* Want to see the output

* Try to get newer node at appveyor

* Style changes
2021-01-19 12:51:13 -08:00
Wouter van Oortmerssen 2046bffa40
Moved various language tests from AppVeyor to GitHub Actions (#6300) 2020-12-03 11:26:27 -08:00
Björn Harrtell 94873e595c
[JS/TS] Modernize TypeScript / JavaScript flatbuffers support (#6095) 2020-09-17 12:21:14 -07:00
Derek Bailey db2aa9b4ec
[C#] Cleaned up .NET testing script for Mono (#6016)
* Cleaned up .NET testing script for Mono

Cleaned up the .NET testing script to make it a little better. It
purposefully doesn't delete the .NET installer and SDk after running the
script, so that they can be used in subsequent invocations. This greatly
speeds up the script.

The downloaded files are ignored by git by default. They can be
explicitly cleaned up by runnning the clean script (clean.sh).

* Trying using older Version indicator

* Remove lins to monsterdata and reference it directly.

* Updated appveryor script to remove copying of files no longer needed

* Continue to update appveyor script to work. Disabled CS0169 in ByteBufferTest
2020-08-17 13:10:10 -07:00
Olivier Le Doeuff d9fecc3327
[CMake] : Add precompiled header support with FLATBUFFERS_ENABLE_PCH (#5827)
* [CMake] : Add precompiled header support with FLATBUFFERS_ENABLE_PCH

FLATBUFFERS_ENABLE_PCH enable precompile headers support for 'flatbuffers' and 'flatc'. Default if OFF.
You need to set it to ON to make it work. 'cmake -DFLATBUFFERS_ENABLE_PCH=ON ..'
This will only work if CMake version is >= 3.16, because target_precompile_headers is used.
If CMake doesn't have target_precompile_headers, then nothing will happen.
This can speed up compilation time.
Precompiled header file for 'flatbuffers' is 'pch.h'
Precompiled header file for 'flatc' is 'flatc_pch.h'

* Enable FLATBUFFERS_ENABLE_PCH for VC 2017 and VS2019 builds

* [CMake]: Fix error in FLATBUFFERS_ENABLE_PCH description

* Add a function add_pch_to_target to avoid copy and pasting the same code like add_fsanitize_to_target
Move pch.h and flatc_pch.h from include/flatbuffers to include/flatbuffers/pch
Make flatc_pch.h depends on pch.h since it extend it
2020-03-27 08:35:44 -07:00
mugisoba 173e10fdf1
[C#] support Json Serialization (#5752)
* support json serialization

* fix invalid json format.
* string must be written with double quotes.
* remove commma after the last object member.

* fix indent

* Revert "fix invalid json format."

This reverts commit d6820ed50c.

* quated string value.

* add cs-gen-json-serializer flag.

* fix preprocessor indent

* ENABLE_JSON_SERIALIZATION -> ENABLE_JSON_SERIALIZATION_TEST

* share TestBuffer method

* remove ENABLE_JSON_SERIALIZATION

* remove duplicated test data

* [windows] add nuget restore and copy test data.

* [docker mono] share msbuild settings with windows. add nuget restore and copy test data.

* add some note for json api.
2020-02-10 17:43:36 -08:00
Dan Field f2a1272303 Use VS 2017 and 2019 on CI, fix cast issue in dart_idl (#5740)
* vs2019

* another attempt

* syntax

* fewer

* fix dart
2020-01-27 10:03:00 -08:00
Vladimir Glavnyy 44bf719883 Add flatc '--cpp_std' switch (#5656)
* Add flatc '--cpp_std' switch and sandbox for C++17 code generator

- Added 'flac --cpp_std legacy' for compatibility with old compilers (VS2010);
- Added experimental switch 'flac --cpp_std c++17' for future development;
- Added C++17 sandbox test_cpp17.cpp;
- C++ code generator generates enums with explicit underlying type to avoid problems with the forward and backward schema compatibility;
- Adjusted CMakeLists.txt, CI and generate code scripts to support of introduced '--cpp_std';

* Fix --cpp_std values: c++0x, c++11, c++17

* Add 'cpp::CppStandard' enum

* Add testing engine into test_cpp17

* Rebase to upstream/master

* Set default '--cpp-std C++0x'

* Fix code generation (--cpp_std C++11) in CMakeLists.txt

- Fix dependency declaration of grpctest target

* Revert --cpp-std for the tests from explicit C++11 to flatc default value (C++0x)
2019-12-23 12:13:48 -08:00
Eric Erhardt 0cdacdfb35 Remove byte* property in ByteBufferAllocator (#5191)
* Remove byte* property in ByteBufferAllocator.

This allows consumers to read/write into native memory, but without
having to always pin the managed `byte[]` when working with managed
memory. This allows for users to not need to Dispose() ByteBuffers
when they are using the default ByteArrayAllocator class.

Instead, we use `Span<byte> GetSpan()` methods to get access to the
underlying memory buffer.

Fix #5181

* Add a set of benchmark tests.

* Add ReadOnly spans.

This allows consumers to use ReadOnlyMemory<byte> as the backing storage
for ByteBuffers, which is useful in read-only scenarios.

* Run tests using ENABLE_SPAN_T in appveyor.

* Fix FlatBuffers.Test.csproj to work on older MSBuild versions.

* Change the test script to test UNSAFE_BYTEBUFFER

* Address PR feedback.

Remove IDisposable from ByteBuffer.

* Respond to PR feedback.
2019-02-21 23:36:55 +01:00
Wouter van Oortmerssen 78c50e340b Fix AppVeyor script not including CMake dir
Change-Id: I737a74dd4d31ca6d1559958f4c76e61e1f0a2c64
2019-02-14 16:21:07 -08:00
Vladimir Glavnyy 3f388ec747 Repair MSVC-CRT leakage detector and enable this detection with Appveyor-CI (#5105) 2019-01-24 13:30:11 -08:00
Vladimir Glavnyy dd288f71f3 Add `NaN` and `Inf` defaults to the C++ generated code. (#5102)
* Add `NaN` and `Inf` defaults to the C++ generated code.

* Refactoring: add FloatConstantGenerator

* Refactoring-2:

- remove isnan checking for all float/double values
- add most probable implementation of virtual methods of FloatConstantGenerator

* Add conditional (FLATBUFFERS_NAN_DEFAULTS) isnan checking
2019-01-07 10:04:44 -08:00
Frank Benkstein efbb11e093 CI check generate code (#4998)
* call reflection code generation from tests

This simplifies instructions to contributors so they don't forget to update
reflection code.

* add error handling to generate_code scripts

Let them propagate their errors instead of swallowing them so they show
up when called in CI.

* apply editorconfig to shell scripts

* use ordered map in dart codegen

Using an unordered map in the codegen can lead to spurious diffs in the
generated dart code.

* add CI check for generate_code being run

* update reflection_generated.h

* disable diff-check for monster_test.bfbs

Work around #5008.
2018-10-22 15:41:12 -07:00
Robert 02a7807dd8
Add Rust to Appveyor config. (#4928) 2018-09-12 11:44:51 -07:00
Uilian Ries 1f03becd24 Conan build packages on CI (#4590) (#4594)
* Build Conan package on Travis CI (#4590)

- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on OSX (#4590)

- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on Windows (#4590)

- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package
- Only build Conan package when release (tag)

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Reduce Conan CI support to simple scripts (#4590)

- Removed msvc 10 x86_64 workaround
- Updated conan remote address
- Added Bincrafters' package tools

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add fPIC option on Conan recipe (#4590)

- Add fPIC as optional. It works on Linux and OSX
- Update recipe metadata: author, homepage, license
- Checking for flatc and flathash on Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on CI (#4590)

- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update Conan username (#4590)

- Use google as default username

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update OSX version on CI (#4590)

- Use latest OSX 9.3 version to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
2018-08-16 12:17:52 -07:00
Wouter van Oortmerssen 1f0bd12851 Disabled numpy test in appveyor due to timeout.
It pulls in a LOT of dependencies, this will need to be done better.

Change-Id: Ib27effead194f6836facca01e9454a6037ad837a
2017-08-24 13:46:46 -07:00
Kevin Rose 3282a84e30 [Python] (scalar) vector reading speedup via numpy (#4390)
* Add numpy accessor to python flatbuffers scalar vectors

* Update python tests to test numpy vector accessor

* Update appveyor CI to run Python tests, save generated code as artifact

* Update example generated python code

* Add numpy info to python usage docs

* Update test schema and python tests w/ multi-byte vector

* did not mean to push profiling code

* adding float64 numpy tests
2017-08-01 08:34:00 -07:00
Wouter van Oortmerssen 22743ca45a Fixed --keep-prefix functionality.
Changing to keep include prefixes had two side effects: the main
file being parsed wasn't filtered out anymore, and include directory
paths would be added to the path in the include statement.

Also moved the include_test*.fbs files to sub directories so we
can actually test the handling of -I etc.

tested: on Linux.

Change-Id: Ibae095cea7ab0cccbac15cfb5171719f6b5cad8c
2017-05-24 16:26:57 -07:00
Wouter van Oortmerssen 0c80b3a7cc Added VS 2015 test to AppVeyor CI.
Change-Id: I354c13fbe6f159058fbeff47100ef357e99c6cd5
2017-04-24 10:06:55 -07:00
Kamil Rojewski 808b44f87a TS tests fixes (#4265)
* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes
2017-04-21 09:29:42 -07:00
Wouter van Oortmerssen 2a7a44be33 Improving AppVeyor CI with other languages.
Change-Id: Iff630905b5f90814c5f728e3c0e10f7fcd67c7fe
2016-12-12 18:02:13 -08:00
Wouter van Oortmerssen f624065eaa Added AppVeyor CI.
Change-Id: I01cf630026e25382b585785b471bad21153338f6
2016-07-27 18:38:27 -07:00