Update build scripts to new approach for publishing.

This commit is contained in:
Jürg Lehni 2013-06-26 19:42:04 -07:00
parent 44cd3d4ad8
commit 9bb6ec9ed7
2 changed files with 36 additions and 7 deletions

28
build/publish.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey
# http://lehni.org/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.
#
# All rights reserved.
echo "Building paper.js"
./build.sh
echo "Minifying paper.js"
./minify.sh
echo "Commiting Version"
# Add all changed files in dist
git add -u ../package.json
git add -u ../dist
# Extract the paper.js version from package.json:
VERSION=$(node -e "
process.stdout.write(require('../package.json').version)
")
# Commit
git commit -m "Update version to v$VERSION."
# Tag
git tag "v$VERSION"

View file

@ -21,17 +21,18 @@ BASE=../..
# Copy license over
cp $BASE/LICENSE.txt .
# Make library folder and copy paper.js there
mkdir lib
cp $BASE/dist/paper.js lib
cp $BASE/dist/paper-min.js lib
cp $BASE/dist/paper-core.js lib
cp $BASE/dist/paper-core-min.js lib
mkdir dist
cp $BASE/dist/paper-full.js dist
cp $BASE/dist/paper-full.min.js dist
cp $BASE/dist/paper-core.js dist
cp $BASE/dist/paper-core.min.js dist
# Also include stats sinsce some examples use it
mkdir lib
cp $BASE/lib/stats.js lib
# Copy examples over
cp -r $BASE/examples .
# Replace ../../dist/ with ../../lib/ in each example
find examples -type f -print0 | xargs -0 perl -i -pe 's/\.\.\/\.\.\/dist\//\.\.\/\.\.\/lib\//g'
# Replace dist/paper.js with dist/paper-full.js in each example
find examples -type f -print0 | xargs -0 perl -i -pe 's/dist\/paper\.js/dist\/paper-full\.js/g'
# Copy docs over
cp -r $BASE/dist/docs .
# Zip the whole thing