--- modules/damieng/graphical_editor/loncapa_daxe/build.sh 2015/04/17 15:35:06 1.1 +++ modules/damieng/graphical_editor/loncapa_daxe/build.sh 2015/09/14 15:58:57 1.4 @@ -1,5 +1,43 @@ #!/bin/sh + +# Create a distribution that can run in any browser, without the source code. +# Once the dist directory is on a web server, Daxe can be launched with a URL like +# http://localhost/dist/daxe.html?config=config/loncapa_config.xml + +# reset the dist directory + +rm -rf dist +mkdir dist + + +# get Daxe latest version from github + +pub upgrade daxe + + +# compile LON-CAPA Daxe + # NOTE: dart2js is in dart-sdk/bin, which should be on the PATH -dart2js --minify --out=loncapa_daxe.min.dart.js web/loncapa_daxe.dart -dart2js --output-type=dart --minify --out=loncapa_daxe.min.dart web/loncapa_daxe.dart -rm *.js.map *.deps +dart2js --minify --out=dist/loncapa_daxe.min.js web/loncapa_daxe.dart +rm dist/*.js.map dist/*.deps + + +# copy Daxe resource files + +mkdir -p dist/packages/daxe +# note the / at the end of the paths, it copies only the contents +rsync -a packages/daxe/ dist/packages/daxe/ --exclude CVS --exclude '*.dart' --exclude packages --exclude src + + +# copy LON-CAPA Daxe files + +cp daxe.html dist/ + +rsync -a web/ dist/ --exclude CVS --exclude '*.dart' --exclude packages --exclude tests --exclude nodes --exclude '*.html' --exclude 'XHTML_config.xml' --exclude 'xhtml1-strict.xsd' --exclude 'jsme' + + +# extract JSME + +unzip -d dist 'JSME_2015-03-03_xsiframe.zip' +mv 'dist/JSME_2015-03-03_xsiframe/jsme' dist/ +rm -r 'dist/JSME_2015-03-03_xsiframe'