2017-05-19 12:56:50 -06:00
|
|
|
#!/bin/bash -e
|
2017-05-19 11:45:42 -06:00
|
|
|
export target=${1-dev}
|
2014-12-24 14:28:48 -07:00
|
|
|
|
|
|
|
mkdir -p public/compiled
|
|
|
|
|
2017-04-29 12:57:19 -06:00
|
|
|
ts_apps="common chess ceval game tree"
|
2017-05-04 03:14:55 -06:00
|
|
|
apps="site chat2 challenge2 notify2 learn insight editor puzzle round2 analyse lobby tournament tournamentSchedule simul perfStat dasher"
|
2016-07-28 03:17:48 -06:00
|
|
|
|
2017-03-27 16:22:27 -06:00
|
|
|
build_ts() {
|
2017-05-19 11:45:42 -06:00
|
|
|
echo "build_ts" "$@"
|
2017-03-27 16:22:27 -06:00
|
|
|
cd ui/$1
|
2017-04-02 16:42:34 -06:00
|
|
|
rm -rf node_modules/types
|
2017-03-28 03:49:40 -06:00
|
|
|
rm -rf node_modules/common
|
|
|
|
rm -rf node_modules/chess
|
2017-03-27 16:22:27 -06:00
|
|
|
npm install --no-optional
|
|
|
|
npm run compile
|
|
|
|
cd -
|
|
|
|
}
|
|
|
|
|
2016-07-28 03:17:48 -06:00
|
|
|
build() {
|
2017-05-19 11:45:42 -06:00
|
|
|
echo "build" "$@"
|
2016-07-28 03:17:48 -06:00
|
|
|
app=$1
|
2014-12-24 14:28:48 -07:00
|
|
|
cd ui/$app
|
2017-04-07 14:58:20 -06:00
|
|
|
rm -rf node_modules/types
|
2016-12-12 16:00:44 -07:00
|
|
|
rm -rf node_modules/common
|
|
|
|
rm -rf node_modules/chess
|
2016-12-13 05:23:25 -07:00
|
|
|
rm -rf node_modules/game
|
2016-12-12 16:00:44 -07:00
|
|
|
rm -rf node_modules/tree
|
2016-12-15 04:46:59 -07:00
|
|
|
rm -rf node_modules/ceval
|
2016-01-06 04:05:21 -07:00
|
|
|
npm install --no-optional && gulp $target
|
2014-12-24 14:28:48 -07:00
|
|
|
cd -
|
2016-07-28 03:17:48 -06:00
|
|
|
}
|
|
|
|
|
2017-05-19 11:45:42 -06:00
|
|
|
if command -v parallel; then # parallel execution!
|
|
|
|
export -f build_ts build
|
2017-05-19 15:58:25 -06:00
|
|
|
parallel -j+2 --gnu --bar build_ts ::: $ts_apps
|
|
|
|
parallel -j+2 --gnu --bar build ::: $apps
|
2016-07-28 03:17:48 -06:00
|
|
|
else # sequential execution
|
2017-04-29 12:57:19 -06:00
|
|
|
for app in $ts_apps; do build_ts $app; done
|
2016-07-28 03:17:48 -06:00
|
|
|
for app in $apps; do build $app; done
|
|
|
|
fi
|