diff options
author | Dan Field <dfield@gmail.com> | 2018-05-18 14:06:15 -0400 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-05-18 11:06:15 -0700 |
commit | 88912640d08bab0588c5804d2990173006b57207 (patch) | |
tree | 5d451dd37682d66d40b85e4c3eeadd78e1a2a385 /samples/dart_sample.sh | |
parent | c43a0beff0ab4e1d5c5fe5044dfb30f24974eaff (diff) | |
download | flatbuffers-88912640d08bab0588c5804d2990173006b57207.tar.gz flatbuffers-88912640d08bab0588c5804d2990173006b57207.tar.bz2 flatbuffers-88912640d08bab0588c5804d2990173006b57207.zip |
Add [Dart] support (#4676)
* Add [Dart] support
* fix enum vectors
* Allow for opt out of string interning
* fix comment style, make interning opt in
* remove Offset<T>, prefer int
* avoid creating unnecessary vtable objects
* start work on tests - do not generate builder if struct has 0 fields - add int64
* support reading structs properly
* correctly handle reading vectors of structs, dartfmt
* support structs, fix unnecessary prepares
* fix bool customizations
* undo unintentional removal of file
* docs updates, complete tutorial, bug fix for codegen
* more documentation
* Update docs, add to doxygen file
* update package structure, add samples script/code
* rearrange sample
* Tests
* Add readme for pub
* cleanup package for pub
* update docs for renamed file
* remove custom matcher, use `closeTo` instead
* remove unintentional file
* remove unintended file checkin
* use auto, move method, cleanup
* refactor to ObjectBuilders, add Builders
* Update tests, examples
* Add files missing from previous commit
* documentation and example updates
* Update LICENSE, make dartanalyzer happy, fix minor bugs, get rid of duplicate files, publish script
* fix sample for slightly different schema
* Update pubspec.yaml
Diffstat (limited to 'samples/dart_sample.sh')
-rwxr-xr-x | samples/dart_sample.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/samples/dart_sample.sh b/samples/dart_sample.sh new file mode 100755 index 00000000..56160666 --- /dev/null +++ b/samples/dart_sample.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright 2018 Dan Field. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Note: This script runs on Mac and Linux. It requires `Node.js` to be installed +# and `flatc` to be built (using `cmake` in the root directory). + +sampledir=$(cd $(dirname $BASH_SOURCE) && pwd) +rootdir=$(cd $sampledir/.. && pwd) +currentdir=$(pwd) + +if [[ "$sampledir" != "$currentdir" ]]; then + echo Error: This script must be run from inside the $sampledir directory. + echo You executed it from the $currentdir directory. + exit 1 +fi + +cd ../dart/example + +# Run `flatc`. Note: This requires you to compile using `cmake` from the +# root `/flatbuffers` directory. +if [ -e ../../flatc ]; then + ../../flatc --dart ../../samples/monster.fbs +elif [ -e ../../Debug/flatc ]; then + ../../Debug/flatc --dart ../../samples/monster.fbs +else + echo 'flatc' could not be found. Make sure to build FlatBuffers from the \ + $rootdir directory. + exit 1 +fi + +echo Running the Dart sample. + +# Execute the sample. +dart example.dart + +# Cleanup temporary files. +git checkout monster_my_game.sample_generated.dart + +cd ../../samples |