paper.js/build/build.sh

43 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
2011-06-25 16:34:59 -04:00
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
2011-03-06 19:50:44 -05:00
#
2014-01-03 19:47:16 -05:00
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
2011-03-06 19:50:44 -05:00
#
2011-07-01 06:17:45 -04:00
# Distributed under the MIT license. See LICENSE file for details.
#
# All rights reserved.
2011-03-06 19:50:44 -05:00
# Usage:
# build.sh MODE
#
# MODE:
# commented Preprocessed, still formated and commented
# stripped Preprocessed, formated but without comments
if [ $# -eq 0 ]
then
MODE="stripped"
else
MODE=$1
fi
# Create the dist folder if it does not exist yet.
if [ ! -d ../dist/ ]
then
mkdir ../dist/
fi
./preprocess.sh $MODE ../src/paper.js "-i '../src/constants.js'" ../dist/paper-full.js
./preprocess.sh $MODE ../src/paper.js "-o '{ \"paperScript\": false, \"palette\": false }' -i '../src/constants.js'" ../dist/paper-core.js
./preprocess.sh $MODE ../src/paper.js "-o '{ \"environment\": \"node\", \"legacy\": false }' -i '../src/constants.js'" ../dist/paper-node.js
# Remove the existing file and copy paper-full.js to paper.js now
if [ -f ../dist/paper.js ]
then
rm ../dist/paper.js
fi
cp ../dist/paper-full.js ../dist/paper.js