
com.google.javascript.jscomp.js.build_runtime.sh Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of closure-compiler-unshaded Show documentation
Show all versions of closure-compiler-unshaded Show documentation
Closure Compiler is a JavaScript optimizing compiler. It parses your
JavaScript, analyzes it, removes dead code and rewrites and minimizes
what's left. It also checks syntax, variable references, and types, and
warns about common JavaScript pitfalls. It is used in many of Google's
JavaScript apps, including Gmail, Google Web Search, Google Maps, and
Google Docs.
#!/bin/sh
# Assembles the es6_runtime.js file from the inputs.
help() {
cat <&2
Usage: build_runtime.sh [OPTIONS]
Options:
--compiler=PATH/TO.JAR
--js_output_file=FILENAME
EOF
exit $1
}
dir="$(dirname $0)"
compiler="$dir/../../../../../../build/compiler.jar"
output=/dev/stdout
while [ $# -gt 0 ]; do
arg=$1
shift
case "$arg" in
(--*=*) set -- "${arg#*=}" "$@"; arg=${arg%%=*} ;;
esac
case "$arg" in
(--help) help 0 ;;
(--compiler) compiler=$1; shift ;;
(--js_output_file) output=$1; shift ;;
(*) echo "Unknown option: $arg" >&2; help 1 ;;
esac
done
{
cat license.js
echo -e '\n// GENERATED FILE. DO NOT EDIT. REBUILD WITH build_runtime.sh.\n'
java -jar $compiler "${args[@]}" \
--formatting=PRETTY_PRINT \
--noinject_libraries \
--compilation_level=WHITESPACE_ONLY \
--preserve_type_annotations \
--language_in=ES6_STRICT \
--language_out=ES5_STRICT \
--js="$dir/es6/runtime.js" \
--js="$dir/es6/object.js" \
| sed 's/ *$//g'
echo
} >| $output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy