mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Move version store to options.js and update the various JSON package files from there.
This commit is contained in:
parent
b34313833d
commit
1d0c6e09ba
4 changed files with 38 additions and 11 deletions
|
@ -30,6 +30,16 @@ then
|
||||||
mkdir ../dist/
|
mkdir ../dist/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f ../dist/paper-full.js ]
|
||||||
|
then
|
||||||
|
rm ../dist/paper-full.js
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f ../dist/paper-node.js ]
|
||||||
|
then
|
||||||
|
rm ../dist/paper-node.js
|
||||||
|
fi
|
||||||
|
|
||||||
./preprocess.sh $MODE ../src/paper.js "-i '../src/constants.js'" ../dist/paper-full.js
|
./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 '{ \"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
|
./preprocess.sh $MODE ../src/paper.js "-o '{ \"environment\": \"node\", \"legacy\": false }' -i '../src/constants.js'" ../dist/paper-node.js
|
||||||
|
|
|
@ -26,17 +26,14 @@
|
||||||
|
|
||||||
# Get the date from the git log:
|
# Get the date from the git log:
|
||||||
DATE=$(git log -1 --pretty=format:%ad)
|
DATE=$(git log -1 --pretty=format:%ad)
|
||||||
# Extract the paper.js version from package.json:
|
# Load __options from options.js and convert it to escaped JSON, to be passed on
|
||||||
VERSION=$(node -e "
|
# to prepro:
|
||||||
process.stdout.write(require('../package.json').version)
|
|
||||||
")
|
|
||||||
# Load and evaluate the __options from options.js, and convert it escaped json:
|
|
||||||
OPTIONS=$(printf '%q' $(node -e "
|
OPTIONS=$(printf '%q' $(node -e "
|
||||||
eval(require('fs').readFileSync('../src/options.js', 'utf8'));
|
eval(require('fs').readFileSync('../src/options.js', 'utf8'));
|
||||||
process.stdout.write(JSON.stringify(__options));
|
process.stdout.write(JSON.stringify(__options));
|
||||||
"))
|
"))
|
||||||
# Build the prepo.js command out of it, passing on version and date as defines:
|
# Build the prepo.js command out of it, passing on version and date as defines:
|
||||||
COMMAND="../node_modules/.bin/prepro -o $OPTIONS -o '{ \"version\": \"$VERSION\", \"date\": \"$DATE\", \"stats\": false }' $3 $2"
|
COMMAND="../node_modules/.bin/prepro -o $OPTIONS -o '{ \"date\": \"$DATE\", \"stats\": false }' $3 $2"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
commented)
|
commented)
|
||||||
|
|
|
@ -10,10 +10,23 @@
|
||||||
#
|
#
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
|
||||||
# Extract the paper.js version from package.json:
|
# Extract the paper.js version from options.js:
|
||||||
VERSION=$(node -e "
|
VERSION=$(printf '%q' $(node -e "
|
||||||
process.stdout.write(require('../package.json').version)
|
eval(require('fs').readFileSync('../src/options.js', 'utf8'));
|
||||||
")
|
process.stdout.write(__options.version);
|
||||||
|
"))
|
||||||
|
|
||||||
|
# Helper function that updates paper.js vesion in JSON files
|
||||||
|
function update_version()
|
||||||
|
{
|
||||||
|
node -e "
|
||||||
|
var data = require('$1');
|
||||||
|
data.version = '$VERSION';
|
||||||
|
require('fs').writeFile('$1',
|
||||||
|
JSON.stringify(data, null, ' ') + require('os').EOL);
|
||||||
|
"
|
||||||
|
}
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
PAPER_DIR=`PWD`
|
PAPER_DIR=`PWD`
|
||||||
cd ../paperjs.org
|
cd ../paperjs.org
|
||||||
|
@ -24,6 +37,10 @@ cd $PAPER_DIR/build
|
||||||
./dist.sh
|
./dist.sh
|
||||||
cd $PAPER_DIR
|
cd $PAPER_DIR
|
||||||
echo "Commiting Version"
|
echo "Commiting Version"
|
||||||
|
# Update versions
|
||||||
|
update_version 'package.json'
|
||||||
|
update_version 'bower.json'
|
||||||
|
update_version 'component.json'
|
||||||
# Add changed json configuration files
|
# Add changed json configuration files
|
||||||
git add -u package.json
|
git add -u package.json
|
||||||
git add -u bower.json
|
git add -u bower.json
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
var __options = {
|
var __options = {
|
||||||
parser: 'acorn',
|
parser: 'acorn',
|
||||||
version: 'dev',
|
version: '0.9.17',
|
||||||
environment: 'browser',
|
environment: 'browser',
|
||||||
legacy: true,
|
legacy: true,
|
||||||
stats: true,
|
stats: true,
|
||||||
|
@ -28,3 +28,6 @@ var __options = {
|
||||||
palette: true,
|
palette: true,
|
||||||
debug: false
|
debug: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (typeof window === 'object')
|
||||||
|
__options.version = 'dev';
|
||||||
|
|
Loading…
Reference in a new issue