replace yui-compressor with a JS based solution, MKWS-337
authorWolfram Schneider <wosch@indexdata.dk>
Thu, 13 Nov 2014 16:47:41 +0000 (16:47 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Thu, 13 Nov 2014 16:47:41 +0000 (16:47 +0000)
doc/mkws-developer.markdown
src/Makefile
test/bin/yui-compressor [deleted file]
test/package.json

index 3832c54..d944a6e 100644 (file)
@@ -22,7 +22,7 @@ If you are building the widget set, you will need the following Debian
 packages (or their equivalents on your operating system):
 
        $ sudo apt-get install curl git make unzip apache2 \
-           pandoc yui-compressor libbsd-resource-perl
+           pandoc libbsd-resource-perl
 
 You also need Node.js, but unfortunately the `node-js` package is not
 available for Debian wheezy. You can either get it from
index bed0fb1..6524a0f 100644 (file)
@@ -14,6 +14,7 @@ PP2_URL = http://git.indexdata.com/?p=pazpar2.git;a=blob_plain;f=js/${PP2_FILE};
 
 VERSION = $(shell tr -d '\012' < VERSION)
 HANDLEBARS = ../test/node_modules/.bin/handlebars
+UGLIFYJS = ../test/node_modules/.bin/uglifyjs
 
 COMPONENTS = mkws-handlebars.js \
        mkws-core.js \
@@ -58,7 +59,7 @@ $(DEST)/mkws-complete.js: Makefile $(INSTALLED_DOWNLOADABLE) $(DEST)/mkws.js
        mv -f $@.tmp $@
 
 %.min.js: %.js
-       yui-compressor $? > $@.tmp
+       ${UGLIFYJS} $? > $@.tmp
        mv -f $@.tmp $@
 
 $(DEST)/${HANDLEBARS_FILE}:
@@ -89,9 +90,6 @@ $(DEST)/VERSION: VERSION
        chmod 444 $@
 
 release: $(INSTALLED_RELEASABLE)
-       @if ! which yui-compressor >/dev/null; then \
-               echo "*** please install the yui-compressor program"; exit 1; \
-       fi
        if [ -f ${DEST}/releases/mkws-$(VERSION).js ]; then \
                echo "*** There is already a release $(VERSION)"; \
        else \
@@ -114,7 +112,7 @@ mkws-templates.js: templates/*.handlebars
 
 # Checks that the JavaScript can be parsed
 syntax-check: $(DEST)/mkws.js
-       yui-compressor $(DEST)/mkws.js >/dev/null
+       ${UGLIFYJS} $(DEST)/mkws.js >/dev/null
 
 # Emits a list of <script> elements to include in HTML applications
 html-includes:
diff --git a/test/bin/yui-compressor b/test/bin/yui-compressor
deleted file mode 100755 (executable)
index c55de67..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# 
-# yui-compressor - dummy wrapper for missing java tool yui-compressor
-
-cat <<EOF >&2
-==>  Warning: the real program yui-compressor does not exists <==
-     will use cat(1) instead! 
-EOF
-
-cat "$@"
-
index c0aca1c..5c29d2d 100644 (file)
@@ -18,7 +18,8 @@
         "jasmine-reporters": "<= 0.4.1",
         "jasmine-node": "*",
         "phantomjs": "*",
-        "handlebars": "= 2.0.0"
+        "handlebars": "= 2.0.0",
+        "uglify-js": "> 2.0.0"
     },
     "repository": {
         "type": "git",