Remove sed from post-build code, due to portability issues between GNU and BSD versions.

Follow up to ba43d37394 which apparently
didn't fix the problem completly on Mac OS X.
This commit is contained in:
awgy 2011-02-12 03:35:41 +01:00 committed by Anton M
parent 3548ffaee2
commit 2862f589db
2 changed files with 10 additions and 2 deletions

View File

@ -9,6 +9,7 @@ DIST_DIR = ${PREFIX}/dist
JS_ENGINE ?= `which node nodejs` JS_ENGINE ?= `which node nodejs`
COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
BASE_FILES = ${SRC_DIR}/core.js\ BASE_FILES = ${SRC_DIR}/core.js\
${SRC_DIR}/support.js\ ${SRC_DIR}/support.js\
@ -106,8 +107,8 @@ ${JQ_MIN}: jquery
@@if test ! -z ${JS_ENGINE}; then \ @@if test ! -z ${JS_ENGINE}; then \
echo "Minifying jQuery" ${JQ_MIN}; \ echo "Minifying jQuery" ${JQ_MIN}; \
${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \ ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
sed '$ s#^\( \*/\)\(.\+\)#\1\n\2;#' ${JQ_MIN}.tmp > ${JQ_MIN}; \ ${POST_COMPILER} ${JQ_MIN}.tmp > ${JQ_MIN}; \
rm -rf ${JQ_MIN}.tmp; \ rm -f ${JQ_MIN}.tmp; \
else \ else \
echo "You must have NodeJS installed in order to minify jQuery."; \ echo "You must have NodeJS installed in order to minify jQuery."; \
fi fi

7
build/post-compile.js Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env node
var print = require("sys").print,
src = require("fs").readFileSync(process.argv[2], "utf8");
// Previously done in sed but reimplemented here due to portability issues
print(src.replace(/^(\s*\*\/)(.+)/m, "$1\n$2;"));