OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 set -e |
| 3 # switch to the root directory of dev_compiler |
| 4 cd $( dirname "${BASH_SOURCE[0]}" )/.. |
| 5 |
| 6 output_dir=tmp/node |
| 7 [[ -d $output_dir ]] || mkdir -p $output_dir |
| 8 |
| 9 ddc_options=( |
| 10 --destructure-named-params |
| 11 --modules=node |
| 12 -o $output_dir |
| 13 ) |
| 14 node_harmony_options=( |
| 15 --harmony |
| 16 --harmony_destructuring |
| 17 --harmony_default_parameters |
| 18 ) |
| 19 function compile() { |
| 20 ./bin/dartdevc.dart "${ddc_options[@]}" $1 |
| 21 } |
| 22 function run() { |
| 23 NODE_PATH=$output_dir \ |
| 24 node "${node_harmony_options[@]}" -e \ |
| 25 "require('dart/_isolate_helper').startRootIsolate(require('$1').main, []);" |
| 26 } |
| 27 |
| 28 # TODO(ochafik): Add full language tests (in separate Travis env/matrix config). |
| 29 |
| 30 echo "Compiling SDK for node to $output_dir" |
| 31 ./tool/build_sdk.sh "${ddc_options[@]}" |
| 32 |
| 33 echo "Now compiling hello_dart_test" |
| 34 compile test/codegen/language/hello_dart_test.dart |
| 35 run hello_dart_test |
| 36 |
| 37 echo "Now compiling DeltaBlue" |
| 38 compile test/codegen/DeltaBlue.dart |
| 39 run DeltaBlue |
OLD | NEW |