Skip to content

Commit 110cbbb

Browse files
committed
Streamline build scripts and include minified version in dist.
1 parent 89b8864 commit 110cbbb

6 files changed

Lines changed: 42 additions & 13 deletions

File tree

build/build.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
# build.sh MODE
1818
#
1919
# MODE:
20-
# commented Preprocessed but still formated and commented
21-
# stripped Formated but without comments (default)
22-
# compressed Uses UglifyJS to reduce file size
20+
# commented Preprocessed, still formated and commented
21+
# stripped Preprocessed, formated but without comments
2322

2423
if [ $# -eq 0 ]
2524
then

build/dist.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
echo "Building paper.js"
1717
./build.sh
18+
echo "Minifying paper.js"
19+
./minify.sh
1820
echo "Building docs"
1921
./docs.sh
2022
echo "Zipping paperjs.zip"

build/minify-lib.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
# Paper.js
4+
#
5+
# This file is part of Paper.js, a JavaScript Vector Graphics Library,
6+
# based on Scriptographer.org and designed to be largely API compatible.
7+
# http://scriptographer.org/
8+
#
9+
# Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
10+
# http://lehni.org/ & http://jonathanpuckey.com/
11+
#
12+
# Distributed under the MIT license. See LICENSE file for details.
13+
#
14+
# All rights reserved.
15+
16+
uglifyjs ../lib/acorn.js -o ../lib/acorn-min.js -c -m -b ascii_only=true,beautify=false
17+
uglifyjs ../lib/esprima.js -o ../lib/esprima-min.js -c -m -b ascii_only=true,beautify=false

build/minify.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# Paper.js
4+
#
5+
# This file is part of Paper.js, a JavaScript Vector Graphics Library,
6+
# based on Scriptographer.org and designed to be largely API compatible.
7+
# http://scriptographer.org/
8+
#
9+
# Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
10+
# http://lehni.org/ & http://jonathanpuckey.com/
11+
#
12+
# Distributed under the MIT license. See LICENSE file for details.
13+
#
14+
# All rights reserved.
15+
16+
uglifyjs ../dist/paper.js -o ../dist/paper-min.js -c unused=false -m -r "_$_,$_" -b ascii_only=true,beautify=false --comments /^!/

build/preprocess.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,19 @@
2424
# preprocess.sh MODE SOURCE DEFINITIONS PREPRO_INCLUDE DESTINATION
2525
#
2626
# MODE:
27-
# commented Preprocessed but still formated and commented
28-
# stripped Formated but without comments
29-
# compressed Uses UglifyJS to reduce file size
27+
# commented Preprocessed, still formated and commented
28+
# stripped Preprocessed, formated but without comments
3029

3130
VERSION=0.3
3231
DATE=$(git log -1 --pretty=format:%ad)
3332

3433
COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\" }' -d '$3' -i '$4' $2"
3534

3635
case $1 in
37-
stripped)
38-
eval "$COMMAND -c" > $5
39-
;;
4036
commented)
4137
eval $COMMAND > $5
4238
;;
43-
compressed)
44-
eval $COMMAND > temp.js
45-
uglifyjs temp.js -c unused=false -m -r "_$_,$_" -b ascii_only=true,beautify=false > $5
46-
rm temp.js
39+
stripped)
40+
eval "$COMMAND -c" > $5
4741
;;
4842
esac

dist/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/paper-min.js
12
/paper-server.js
23
/serverdocs/
34
/paperjs.zip

0 commit comments

Comments
 (0)