From: Mike Frysinger Date: Sat, 15 Mar 2014 19:18:53 +0000 (-0400) Subject: support minifying css files too X-Git-Tag: v2.3~2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9a46592dc6de6c201ecc8df284e40f779bd22274;p=chrome-ext%2Fweb-power-switch.git support minifying css files too --- diff --git a/Makefile b/Makefile index 70ee24a..5e88047 100644 --- 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 diff --git a/makedist.sh b/makedist.sh index 661f9f7..482baf8 100755 --- a/makedist.sh +++ b/makedist.sh @@ -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}"