mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
![Alexander Thomas](/assets/img/avatar_default.png)
This adds support for BabelJS to test.py's dart2js compiler configuration. When --babel is specified directly or through a named configuration, test.py will run an additional step after dart2js that post-processes the javascript output by running it through BabelJS with the specified Babel configuration. BabelJS is added to the DEPS in its standalone form. d8 is used to run BabelJS standalone to avoid adding a dependency on NodeJS. d8 can only write to stdout but not to files or stderr, which makes it necessary to change the test_runner to handle commands that expect their output to be piped to a file. Changes: * Add --babel option to test.py. * Add babel option to pkg/smith. * Switch IE11 builder to use babel transformation. * Fix option list comparison bugs in pkg/smith. * Change dart2js compiler configuration to generate files using the test name rather than just "out.js" (update test that relied on this). * Remove runtime_configuration dependency on test_suite. * Remove obsolete blocks adding --preview-dart-2 dart2js arguments. * Make dart2js' compiler configuration more like DDC's. * Remove createCommand method that is no longer used. * Remove support for "OtherResources" which was only used for dart:isolate tests on dart2js and DDC. * Skip co19_2 tests that are slow to transform with babel. * Simplify the timeout handling in the test runner with Future.timeout. Change-Id: I32e4917b2a57ecbe684538e40d744f0101c552a0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90402 Commit-Queue: Alexander Thomas <athom@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
30 lines
496 B
Bash
Executable file
30 lines
496 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Uploads a new version of d8 CIPD package
|
|
set -e
|
|
set -x
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: update.sh version"
|
|
exit 1
|
|
fi
|
|
|
|
version=$1
|
|
|
|
tmpdir=$(mktemp -d)
|
|
cleanup() {
|
|
rm -rf "$tmpdir"
|
|
}
|
|
trap cleanup EXIT HUP INT QUIT TERM PIPE
|
|
cd "$tmpdir"
|
|
|
|
for file in "babel.js" "babel.min.js" "LICENSE"
|
|
do
|
|
curl -o $file "https://unpkg.com/@babel/standalone@$version/$file"
|
|
done
|
|
|
|
cipd create \
|
|
-name dart/third_party/babel \
|
|
-in . \
|
|
-install-mode copy \
|
|
-tag version:$version
|