15
15
16
16
#! /bin/bash
17
17
18
- echo -e " \nBuilding runtime tests..."
19
-
20
18
# to translate from relative dir
21
19
abs_dirname () {
22
20
echo " $( cd " $( dirname " $1 " ) " && pwd) /$( basename " $1 " ) "
23
21
}
24
22
23
+ LOCAL_COMPILER=$( dirname ..) /target/closure-compiler-1.0-SNAPSHOT.jar
24
+ echo $LOCAL_COMPILER
25
+ if [ ! -f " $LOCAL_COMPILER " ]; then
26
+ echo -e " \nCompiler JAR not built. Building...\n" && yarn build:fast
27
+ fi
28
+
29
+ echo -e " \nBuilding runtime tests..."
25
30
TEST_DIR=" test/com/google/javascript/jscomp/runtime_tests"
26
31
27
32
if [ -z $1 ]; then
@@ -49,15 +54,18 @@ compileRuntimeTests(){
49
54
<head>
50
55
<title>$TEST_NAME </title>
51
56
<script defer>
52
- $( google-closure-compiler \
53
- --language_in ES_NEXT \
54
- --language_out NO_TRANSPILE \
55
- --process_common_js_modules \
56
- --module_resolution NODE \
57
- --dependency_mode PRUNE \
58
- --js node_modules/google-closure-library/ \
59
- --js $ABS_PATH / \
60
- --entry_point $FILE )
57
+ $(
58
+ java -server -XX:+TieredCompilation \
59
+ -jar $LOCAL_COMPILER \
60
+ --language_in ES_NEXT \
61
+ --language_out NO_TRANSPILE \
62
+ --process_common_js_modules \
63
+ --module_resolution NODE \
64
+ --dependency_mode PRUNE \
65
+ --js node_modules/google-closure-library/ \
66
+ --js $ABS_PATH / \
67
+ --entry_point $FILE
68
+ )
61
69
</script>
62
70
</head>
63
71
</html>" > $TEST_LOC /build/$TEST_NAME .html
@@ -66,4 +74,6 @@ $(google-closure-compiler \
66
74
}
67
75
68
76
# build tests
69
- compileRuntimeTests $( find $ABS_PATH -type f -name ' *_test.js' )
77
+ time(
78
+ compileRuntimeTests $( find $ABS_PATH -type f -name ' *_test.js' )
79
+ )
0 commit comments