Skip to content

Commit 76cc3fb

Browse files
committed
Edited to use local JAR for building runtime tests
1 parent 177ca3a commit 76cc3fb

File tree

3 files changed

+27
-29
lines changed

3 files changed

+27
-29
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
"jsdom": "^16.3.0"
1616
},
1717
"scripts": {
18+
"build": "mvn -DskipTests",
19+
"build:fast": "mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml",
1820
"build:runtime_tests": "./utils/runtime_tests_build.sh",
21+
"clean": "mvn clean",
1922
"run:jest": "jest --testRegex .*/utils/js/.* --verbose=true",
2023
"run:runtime_tests": "./utils/runtime_tests_run.sh",
21-
"runtime_tests": "npm run --silent build:runtime_tests && npm run --silent run:runtime_tests"
24+
"runtime_tests": "npm run --silent build:runtime_tests && npm run --silent run:runtime_tests",
25+
"test": "mvn test"
2226
}
2327
}

utils/build.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

utils/runtime_tests_build.sh

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515

1616
#!/bin/bash
1717

18-
echo -e "\nBuilding runtime tests..."
19-
2018
# to translate from relative dir
2119
abs_dirname() {
2220
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
2321
}
2422

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..."
2530
TEST_DIR="test/com/google/javascript/jscomp/runtime_tests"
2631

2732
if [ -z $1 ]; then
@@ -49,15 +54,18 @@ compileRuntimeTests(){
4954
<head>
5055
<title>$TEST_NAME</title>
5156
<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+
)
6169
</script>
6270
</head>
6371
</html>" > $TEST_LOC/build/$TEST_NAME.html
@@ -66,4 +74,6 @@ $(google-closure-compiler \
6674
}
6775

6876
# 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

Comments
 (0)