edaf069dba
- Force import order in all sdk files + simplify module builders - Stub a node_test.sh with hello world + DeltaBlue (to be expanded to language tests in a followup change) - Use global_ from dart:_runtime in html lib - Better export for symbols that node chokes upon: throw, const, void, implements, export... (define as throw_ locally, with proper local resolution, then export as throw). - Cleanup node module builder BUG= R=jmesserly@google.com Review URL: https://codereview.chromium.org/1633003002 .
40 lines
942 B
Bash
Executable File
40 lines
942 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
# switch to the root directory of dev_compiler
|
|
cd $( dirname "${BASH_SOURCE[0]}" )/..
|
|
|
|
output_dir=tmp/node
|
|
[[ -d $output_dir ]] || mkdir -p $output_dir
|
|
|
|
ddc_options=(
|
|
--destructure-named-params
|
|
--modules=node
|
|
-o $output_dir
|
|
)
|
|
node_harmony_options=(
|
|
--harmony
|
|
--harmony_destructuring
|
|
--harmony_default_parameters
|
|
)
|
|
function compile() {
|
|
./bin/dartdevc.dart "${ddc_options[@]}" $1
|
|
}
|
|
function run() {
|
|
NODE_PATH=$output_dir \
|
|
node "${node_harmony_options[@]}" -e \
|
|
"require('dart/_isolate_helper').startRootIsolate(require('$1').main, []);"
|
|
}
|
|
|
|
# TODO(ochafik): Add full language tests (in separate Travis env/matrix config).
|
|
|
|
echo "Compiling SDK for node to $output_dir"
|
|
./tool/build_sdk.sh "${ddc_options[@]}"
|
|
|
|
echo "Now compiling hello_dart_test"
|
|
compile test/codegen/language/hello_dart_test.dart
|
|
run hello_dart_test
|
|
|
|
echo "Now compiling DeltaBlue"
|
|
compile test/codegen/DeltaBlue.dart
|
|
run DeltaBlue
|