1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-05 01:28:39 +00:00
pdf2htmlEX/share/build_js.sh

28 lines
921 B
Bash
Raw Normal View History

2013-10-19 07:06:32 +00:00
#!/bin/sh
# Compile and optimize JS code
# Copyright 2013 Lu Wang <coolwanglu@gmail.com>
# To enable closure-compiler, you need to install and configure JAVA environment
# Read 3rdparty/closure-compiler/README for details
BASEDIR=$(dirname $0)
2013-10-30 07:50:07 +00:00
CLOSURE_COMPILER_DIR="$BASEDIR/../3rdparty/closure-compiler"
2013-10-22 07:03:07 +00:00
CLOSURE_COMPILER_JAR="$CLOSURE_COMPILER_DIR/compiler.jar"
INPUT="$BASEDIR/pdf2htmlEX.js"
2013-10-23 17:54:40 +00:00
OUTPUT_FN="pdf2htmlEX.min.js"
2013-10-30 07:50:07 +00:00
OUTPUT="$BASEDIR/$OUTPUT_FN"
2013-10-19 07:06:32 +00:00
2013-10-23 17:54:40 +00:00
(echo "Building $OUTPUT_FN with closure-compiler..." && \
2013-10-22 07:03:07 +00:00
java -jar "$CLOSURE_COMPILER_JAR" \
2013-10-21 02:25:11 +00:00
--compilation_level ADVANCED_OPTIMIZATIONS \
2013-10-22 13:32:02 +00:00
--warning_level VERBOSE \
2013-10-21 02:25:11 +00:00
--process_jquery_primitives \
2013-10-22 07:03:07 +00:00
--js "$INPUT" \
--js_output_file "$OUTPUT" && \
2013-10-20 07:11:07 +00:00
echo 'Done.') || \
(echo 'Failed. Read `3rdparty/closure-compiler/README` for more detail.' && \
2013-10-22 07:03:07 +00:00
echo 'Using the uncompressed version.' && \
cat "$INPUT" > "$OUTPUT")
2013-10-21 01:33:38 +00:00