Streamline build scripts and include minified version in dist.

This commit is contained in:
Jürg Lehni 2012-12-24 16:44:13 +01:00
parent 89b8864b13
commit 110cbbb73d
6 changed files with 42 additions and 13 deletions

View file

@ -17,9 +17,8 @@
# build.sh MODE
#
# MODE:
# commented Preprocessed but still formated and commented
# stripped Formated but without comments (default)
# compressed Uses UglifyJS to reduce file size
# commented Preprocessed, still formated and commented
# stripped Preprocessed, formated but without comments
if [ $# -eq 0 ]
then

View file

@ -15,6 +15,8 @@
echo "Building paper.js"
./build.sh
echo "Minifying paper.js"
./minify.sh
echo "Building docs"
./docs.sh
echo "Zipping paperjs.zip"

17
build/minify-lib.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
# Paper.js
#
# This file is part of Paper.js, a JavaScript Vector Graphics Library,
# based on Scriptographer.org and designed to be largely API compatible.
# http://scriptographer.org/
#
# Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
# http://lehni.org/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.
#
# All rights reserved.
uglifyjs ../lib/acorn.js -o ../lib/acorn-min.js -c -m -b ascii_only=true,beautify=false
uglifyjs ../lib/esprima.js -o ../lib/esprima-min.js -c -m -b ascii_only=true,beautify=false

16
build/minify.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
# Paper.js
#
# This file is part of Paper.js, a JavaScript Vector Graphics Library,
# based on Scriptographer.org and designed to be largely API compatible.
# http://scriptographer.org/
#
# Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
# http://lehni.org/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.
#
# All rights reserved.
uglifyjs ../dist/paper.js -o ../dist/paper-min.js -c unused=false -m -r "_$_,$_" -b ascii_only=true,beautify=false --comments /^!/

View file

@ -24,9 +24,8 @@
# preprocess.sh MODE SOURCE DEFINITIONS PREPRO_INCLUDE DESTINATION
#
# MODE:
# commented Preprocessed but still formated and commented
# stripped Formated but without comments
# compressed Uses UglifyJS to reduce file size
# commented Preprocessed, still formated and commented
# stripped Preprocessed, formated but without comments
VERSION=0.3
DATE=$(git log -1 --pretty=format:%ad)
@ -34,15 +33,10 @@ DATE=$(git log -1 --pretty=format:%ad)
COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\" }' -d '$3' -i '$4' $2"
case $1 in
stripped)
eval "$COMMAND -c" > $5
;;
commented)
eval $COMMAND > $5
;;
compressed)
eval $COMMAND > temp.js
uglifyjs temp.js -c unused=false -m -r "_$_,$_" -b ascii_only=true,beautify=false > $5
rm temp.js
stripped)
eval "$COMMAND -c" > $5
;;
esac

1
dist/.gitignore vendored
View file

@ -1,3 +1,4 @@
/paper-min.js
/paper-server.js
/serverdocs/
/paperjs.zip