From: David Humphrey Date: Sat, 19 Feb 2011 23:01:48 +0000 (-0500) Subject: Review fixes. X-Git-Tag: v0.4~45^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=845e02c36d6b0ac4adfc9f74f61e8256aed0d8f9;p=popcorn-js.git Review fixes. --- diff --git a/Makefile b/Makefile index e63e97f..7420743 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ PLUGINS_DIR = ${PREFIX}/plugins RHINO ?= java -jar ${BUILD_DIR}/js.jar CLOSURE_COMPILER = ${BUILD_DIR}/google-compiler-20100917.jar +compile = @@${MINJAR} $(1) \ + --compilation_level SIMPLE_OPTIMIZATIONS \ + --js_output_file $(2) # minify MINJAR ?= java -jar ${CLOSURE_COMPILER} @@ -22,13 +25,14 @@ POPCORN_MIN = ${DIST_DIR}/popcorn.min.js PLUGINS_DIST = ${DIST_DIR}/popcorn.plugins.js PLUGINS_MIN = ${DIST_DIR}/popcorn.plugins.min.js -# popcorn + plugins -POPCORN_COMPLETE_DIST = ${DIST_DIR/popcorn-complete.js -POPCORN_COMPLETE_MIN = ${DIST_DIR}/popcorn-complete.min.js - # Grab all popcorn..js files from plugins dir PLUGINS_SRC := $(filter-out %unit.js, $(shell find ${PLUGINS_DIR} -name 'popcorn.*.js' -print)) +# popcorn + plugins +POPCORN_COMPLETE_LIST := --js ${POPCORN_SRC} $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done) +POPCORN_COMPLETE_DIST = ${DIST_DIR}/popcorn-complete.js +POPCORN_COMPLETE_MIN = ${DIST_DIR}/popcorn-complete.min.js + all: lint popcorn plugins min complete @@echo "Popcorn build complete." @@ -42,32 +46,29 @@ ${POPCORN_DIST}: ${POPCORN_SRC} | ${DIST_DIR} @@echo "Building" ${POPCORN_DIST} @@cp ${POPCORN_SRC} ${POPCORN_DIST} -min: ${POPCORN_MIN} ${PLUGINS_MIN} +min: ${POPCORN_MIN} ${PLUGINS_MIN} ${POPCORN_COMPLETE_MIN} ${POPCORN_MIN}: ${POPCORN_DIST} @@echo "Building" ${POPCORN_MIN} - @@${MINJAR} --js ${POPCORN_DIST} \ - --compilation_level SIMPLE_OPTIMIZATIONS \ - --js_output_file ${POPCORN_MIN} + $(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN}) + +${POPCORN_COMPLETE_MIN}: ${POPCORN_SRC} ${PLUGINS_SRC} ${DIST_DIR} + @@echo "Building" ${POPCORN_COMPLETE_MIN} + @@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN}) plugins: ${PLUGINS_DIST} ${PLUGINS_MIN}: ${PLUGINS_DIST} @@echo "Building" ${PLUGINS_MIN} - @@${MINJAR} $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done) \ - --compilation_level SIMPLE_OPTIMIZATIONS \ - --js_output_file ${PLUGINS_MIN} + $(call compile, $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done), ${PLUGINS_MIN}) ${PLUGINS_DIST}: ${PLUGINS_SRC} ${DIST_DIR} @@echo "Building ${PLUGINS_DIST}" @@cat ${PLUGINS_SRC} > ${PLUGINS_DIST} -complete: ${DIST_DIR} +complete: ${POPCORN_SRC} ${PLUGINS_SRC} ${DIST_DIR} @@echo "Building popcorn + plugins" - @@${MINJAR} --js ${POPCORN_SRC} \ - $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done) \ - --compilation_level SIMPLE_OPTIMIZATIONS \ - --js_output_file ${POPCORN_COMPLETE_MIN} + @@cat ${POPCORN_SRC} ${PLUGINS_SRC} > ${POPCORN_COMPLETE_DIST} lint: ${POPCORN_DIST} @@echo "Checking Popcorn against JSLint..."