]> git.wh0rd.org - chrome-ext/web-power-switch.git/commitdiff
support minifying css files too
authorMike Frysinger <vapier@gentoo.org>
Sat, 15 Mar 2014 19:18:53 +0000 (15:18 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 15 Mar 2014 19:18:53 +0000 (15:18 -0400)
Makefile
makedist.sh

index 70ee24a9d3f2f18388b81d5d81e8c4c4e02f9b56..5e8804718f2a4b3f8c0a036ace8699620c29083e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
 CLOSURE = closure-compiler --language_in ECMASCRIPT5
+YUICOMPRESSOR = yuicompressor
 
 all:
 
@@ -8,6 +9,15 @@ all:
 JS_FILES = $(shell grep '[.]js$$' manifest.files)
 js-min: $(JS_FILES:=.min)
 
-check: js-min
+%.css.min: %.css
+       $(YUICOMPRESSOR) $< > $@
 
-.PHONY: all clean check js-min
+CSS_FILES = $(shell grep '[.]css$$' manifest.files)
+css-min: $(CSS_FILES:=.min)
+
+check: css-min js-min
+
+dist:
+       ./makedist.sh
+
+.PHONY: all clean check css-min dist js-min
index 661f9f7c881747d61b71f61b909d13fae767b48b..482baf82e1e69cab97373da7bdddd4f2684fef45 100755 (executable)
@@ -32,10 +32,10 @@ while read line ; do
 done < <(sed 's:#.*::' manifest.files)
 cp Makefile manifest.files manifest.json "${P}/"
 
-make -C "${P}" -j js-min
+make -C "${P}" -j {css,js}-min
 while read line ; do
        mv "${line}.min" "${line}"
-done < <(find "${P}" -name '*.js')
+done < <(find "${P}" -name '*.js' -o -name '*.css')
 rm "${P}"/{manifest.files,Makefile}
 
 sed -i \
@@ -43,6 +43,7 @@ sed -i \
   "${P}/manifest.json"
 
 zip="${P}.zip"
+rm -f "${zip}"
 zip -r "${zip}" "${P}"
 rm -rf "${P}"
 du -b "${zip}"