Skip to content

Commit

Permalink
Better version management/compile script. Prepare examples folder str…
Browse files Browse the repository at this point in the history
…ucture
  • Loading branch information
TriBlade9 committed Nov 26, 2014
1 parent 5628d70 commit 5fe9292
Show file tree
Hide file tree
Showing 15 changed files with 1,125 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*~
test/
*.geany
30 changes: 26 additions & 4 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
cd src

#Prepare directories
rm -rf ../dist
mkdir ../dist
browserify CEWBS.js -o ../dist/CEWBS.js
sed -i -e 's/var CEWBS/var CEWBS = window.CEWBS/g' ../dist/CEWBS.js
uglifyjs ../dist/CEWBS.js -c -o ../dist/CEWBS.min.js
cp CEWBS.js ../dist/CEWBS-commonjs.js

##BROWSERIFY##
#Build browserified edition with the version number
browserify CEWBS.js -o ../dist/CEWBS-$1-debug.js

#Set browserified debug edition's global variable
sed -i -e 's/var CEWBS/var CEWBS = window.CEWBS/g' ../dist/CEWBS-$1-debug.js
#Set browserified edition's version
sed -i -e "s/%VERSION%/$1/g" ../dist/CEWBS-$1-debug.js

#Build browserified, minified verison
uglifyjs ../dist/CEWBS-$1-debug.js -c -o ../dist/CEWBS-$1.js

##COMMONJS##
#Copy and set version number for CommonJS edition
cp CEWBS.js ../dist/CEWBS-$1-commonjs.js
sed -i -e "s/%VERSION%/$1/g" ../dist/CEWBS-$1-commonjs.js

#Copy meshers folder for CommonJS edition
cp -rf meshers ../dist/meshers

##FINALISE##
#Finally copy new version to examples folder.
cp ../dist/CEWBS-$1.js ../examples/lib/CEWBS.js

1 change: 1 addition & 0 deletions dist/CEWBS-commonjs.js → dist/CEWBS-0.2-commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var meshers = {
}

var CEWBS = {};
CEWBS.version = '0.2';

CEWBS.VoxelMesh = function(name, scene) {
BABYLON.Mesh.call(this, name, scene);
Expand Down
1 change: 1 addition & 0 deletions dist/CEWBS.js → dist/CEWBS-0.2-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var meshers = {
}

var CEWBS = window.CEWBS = {};
CEWBS.version = '0.2';

CEWBS.VoxelMesh = function(name, scene) {
BABYLON.Mesh.call(this, name, scene);
Expand Down
1 change: 1 addition & 0 deletions dist/CEWBS-0.2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5fe9292

Please sign in to comment.