Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit c416826

Browse files
author
John Messerly
committed
tweak build_sdk to display color unified diffs, and move diff to after the build succeeds
when debugging js_codegen errors, this makes it a lot easier to see the stack trace. [email protected] Review URL: https://codereview.chromium.org/1153313005
1 parent 9239017 commit c416826

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

tool/build_sdk.sh

+12-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@ dart -c bin/devc.dart --no-source-maps --sdk-check --force-compile -l warning \
1717
--dart-sdk test/generated_sdk -o lib/runtime/ dart:core \
1818
> test/generated_sdk/sdk_errors.txt || true
1919

20-
if ! diff tool/sdk_expected_errors.txt test/generated_sdk/sdk_errors.txt ; then
21-
echo
22-
echo 'SDK errors have changed. To update expectations, run:'
23-
echo '$ cp test/generated_sdk/sdk_errors.txt tool/sdk_expected_errors.txt'
24-
exit 1
25-
fi
26-
2720
if [[ ! -f lib/runtime/dart/core.js ]] ; then
2821
echo 'core.js not found, assuming build failed.'
2922
echo './tool/build_sdk.sh can be run to reproduce this.'
3023
exit 1
3124
fi
25+
26+
DIFF_ARGS="-u tool/sdk_expected_errors.txt test/generated_sdk/sdk_errors.txt"
27+
28+
if ! (diff $DIFF_ARGS > /dev/null) ; then
29+
diff $DIFF_ARGS |\
30+
sed -e "s/^\(+.*\)/\1/" |\
31+
sed -e "s/^\(-.*\)/\1/"
32+
echo
33+
echo 'SDK errors have changed. To update expectations, run:'
34+
echo '$ cp test/generated_sdk/sdk_errors.txt tool/sdk_expected_errors.txt'
35+
exit 1
36+
fi

0 commit comments

Comments
 (0)