Streamline build scripts.

This commit is contained in:
Jürg Lehni 2013-02-28 17:41:02 -08:00
parent 1a37bb7252
commit 55cc668cc2
3 changed files with 7 additions and 7 deletions

View file

@ -30,5 +30,5 @@ then
mkdir ../dist/
fi
./preprocess.sh $MODE ../src/paper.js '{ "browser": true, "parser": "acorn" }' ../src/constants.js ../dist/paper.js
#./preprocess.sh $MODE ../src/paper.js '{ "server": true }' ../src/constants.js ../dist/paper-server.js
./preprocess.sh $MODE ../src/paper.js "-d '{ \"browser\": true }' -i '../src/constants.js'" ../dist/paper.js
#./preprocess.sh $MODE ../src/paper.js "-d '{ \"server\": true }' -i '../src/constants.js'" ../dist/paper-server.js

View file

@ -30,5 +30,5 @@ cd ..
if [ $MODE = "docs" ]
then
# Build paper.js library for documentation
./preprocess.sh stripped ../src/paper.js '{ "browser": true, "parser": "acorn" }' ../src/constants.js ../dist/docs/resources/js/paper.js
./preprocess.sh stripped ../src/paper.js "-d '{ \"browser\": true }' -i '../src/constants.js'" ../dist/docs/resources/js/paper.js
fi

View file

@ -18,7 +18,7 @@
# are preserved or stripped and whitespaces are compressed.
#
# Usage:
# preprocess.sh MODE SOURCE DEFINITIONS PREPRO_INCLUDE DESTINATION
# preprocess.sh MODE SOURCE ARGUMENTS DESTINATION
#
# MODE:
# commented Preprocessed, still formated and commented
@ -27,13 +27,13 @@
VERSION=0.3
DATE=$(git log -1 --pretty=format:%ad)
COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\" }' -d '$3' -i '$4' $2"
COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\", \"parser\": \"acorn\", \"svg\": true }' $3 $2"
case $1 in
commented)
eval $COMMAND > $5
eval $COMMAND > $4
;;
stripped)
eval "$COMMAND -c" > $5
eval "$COMMAND -c" > $4
;;
esac