From 89e34a53c924c8e46b88d1695d2ebc2433e1155d Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Mon, 20 Jul 2015 00:36:34 -0700 Subject: [PATCH] first aproach to compilation --- build/build.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 build/build.sh diff --git a/build/build.sh b/build/build.sh new file mode 100755 index 00000000..7e2a1426 --- /dev/null +++ b/build/build.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +git rev-parse --short HEAD #make sure git in place + +cd `dirname "$0"` + +mkdir -p out +rm -rf out/* + +java -jar compiler.jar \ +--js_output_file out/app.js \ +--jscomp_off externsValidation \ +--compilation_level ADVANCED_OPTIMIZATIONS \ +--externs ../web/lib/jquery-2.1.0.min.js \ +--externs ../web/lib/numeric-1.2.6.js \ +--externs ../web/lib/diff_match_patch.js \ +../web/app/sketcher/canvas.js \ +../web/app/sketcher/io.js \ +../web/app/sketcher/history.js \ +../web/app/sketcher/shapes/arc.js \ +../web/app/sketcher/shapes/circle.js \ +../web/app/sketcher/shapes/segment.js \ +../web/app/sketcher/shapes/dim.js \ +../web/app/sketcher/helpers.js \ +../web/app/math/vector.js \ +../web/app/math/math.js \ +../web/app/math/qr.js \ +../web/app/math/matrix.js \ +../web/app/math/optim.js \ +../web/app/math/noptim.js \ +../web/app/math/lm.js \ +../web/app/sketcher/constr/constraints.js \ +../web/app/sketcher/constr/solver.js \ +../web/app/sketcher/parametric.js \ +../web/app/sketcher/fetchers.js \ +../web/app/engine.js \ +../web/app/sketcher/main2d.js \ +../web/app/ui.js \ +../web/app/math/graph.js \ +../web/app/app-init.js + +sed -n \ +'/<\!--\$\$\$javascript_start\$\$\$-->/{:a;N;/<\!--\$\$\$javascript_end\$\$\$-->/!ba;N;s|.*\n| |};p' \ + ../web/sketcher.html > out/sketcher.html + +echo >> out/sketcher.html +echo '" >> out/sketcher.html + +#now make it work inside out dir +ln -sf ../../web/lib/ out/lib +ln -sf ../../web/img/ out/img