--- 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/12/18 16:35:11 1.7 @@ -1,5 +1,37 @@ #!/bin/sh -# 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 + +# Create a distribution that can run in any browser, without the source code. +# Once the daxe directory is on a web server, Daxe can be launched with a URL like +# http://localhost/daxe/daxe.html?config=config/loncapa_config.xml + + +# get dependencies and Daxe latest version from github +pub get +pub upgrade daxe + + +# compile LON-CAPA Daxe and copy resource files +pub build + + +# extract JSME if necessary +#if [ ! -d build/web/jsme ]; then +# echo "Extracting JSME..." +# unzip -q -d build/web 'JSME_2015-03-03_xsiframe.zip' 'JSME_2015-03-03_xsiframe/jsme/*' +# mv 'build/web/JSME_2015-03-03_xsiframe/jsme' build/web/ +# rmdir 'build/web/JSME_2015-03-03_xsiframe' +#fi + +# remove JSME (included in LON-CAPA) +rm -r build/web/jsme + +# remove LC_math_editor.min.js (included in LON-CAPA) +rm -r build/web/LC_math_editor.min.js + +# replace web/loncapa_daxe.html by daxe.html (which does not link to a dart file) +rm build/web/loncapa_daxe.html +cp daxe.html build/web/ + + +# rename build/web +mv build/web build/daxe