Package: pdf2htmlex / 0.12+ds-1

use-system-yui-compressor-and-closure-compiler Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Description: Use system's yui-compressor and closure-compiler
Author: Johannes Schauer <j.schauer@email.de>
Forwarded: not-needed

--- a/share/build_js.sh
+++ b/share/build_js.sh
@@ -7,21 +7,15 @@
 
 
 BASEDIR=$(dirname $0)
-CLOSURE_COMPILER_DIR="$BASEDIR/../3rdparty/closure-compiler"
-CLOSURE_COMPILER_JAR="$CLOSURE_COMPILER_DIR/compiler.jar"
 INPUT="$BASEDIR/pdf2htmlEX.js"
 OUTPUT_FN="pdf2htmlEX.min.js"
 OUTPUT="$BASEDIR/$OUTPUT_FN"
 
-(echo "Building $OUTPUT_FN with closure-compiler..." && \
-    java -jar "$CLOSURE_COMPILER_JAR" \
-         --compilation_level ADVANCED_OPTIMIZATIONS \
-         --warning_level VERBOSE \
-         --output_wrapper "(function(){%output%})();" \
-         --js "$INPUT" \
-         --js_output_file "$OUTPUT" && \
-    echo 'Done.') || \
-(echo 'Failed. Read `3rdparty/closure-compiler/README` for more detail.' && \
-echo 'Using the uncompressed version.' && \
-cat "$INPUT" > "$OUTPUT")
-
+echo "Building $OUTPUT_FN with closure-compiler..."
+closure-compiler \
+     --compilation_level ADVANCED_OPTIMIZATIONS \
+     --warning_level VERBOSE \
+     --output_wrapper "(function(){%output%})();" \
+     --js "$INPUT" \
+     --js_output_file "$OUTPUT"
+echo 'Done.'
--- a/share/build_css.sh
+++ b/share/build_css.sh
@@ -4,21 +4,13 @@
 
 
 BASEDIR=$(dirname $0)
-YUI_DIR="$BASEDIR/../3rdparty/yuicompressor"
-YUI_JAR="$YUI_DIR/yuicompressor-2.4.8.jar"
 
 build () {
     INPUT="$BASEDIR/$1"
     OUTPUT="$BASEDIR/$2"
-    (echo "Building $OUTPUT with YUI Compressor" && \
-        java -jar "$YUI_JAR" \
-             --charset utf-8 \
-             -o "$OUTPUT" \
-             "$INPUT" && \
-        echo 'Done.') || \
-    (echo 'Failed. ' && \
-    echo 'Using the uncompressed version.' && \
-    cat "$INPUT" > "$OUTPUT")
+    echo "Building $OUTPUT with YUI Compressor"
+    yui-compressor --type css --charset utf-8 -o "$OUTPUT" "$INPUT"
+    echo 'Done.'
 }
 
 build "base.css" "base.min.css"