| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #!/bin/bash
- set -e
- pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
- bold() {
- echo "$(tty -s && tput bold)$1$(tty -s && tput sgr0)"
- }
- clean() {
- bold "bigdl clean"
- rm -rf ./third_party/bigdl
- }
- sync() {
- bold "bigdl sync"
- mkdir -p "./third_party"
- if [ -d "./third_party/bigdl" ]; then
- git -C "./third_party/bigdl" pull --quiet --prune
- else
- git -C "./third_party" clone --quiet --recursive https://github.com/intel-analytics/BigDL.git bigdl
- fi
- git -C "./third_party/bigdl" submodule sync --quiet
- git -C "./third_party/bigdl" submodule update --quiet --init --recursive
- }
- schema() {
- bold "bigdl schema"
- [[ $(grep -U $'\x0D' ./src/bigdl-proto.js) ]] && crlf=1
- npx pbjs -t static-module -w closure --no-encode --no-delimited --no-comments --no-convert --no-verify --no-create --keep-case -r bigdl -o ./src/bigdl-proto.js ./third_party/bigdl/spark/dl/src/main/resources/serialization/bigdl.proto
- if [[ -n ${crlf} ]]; then
- unix2dos --quiet --newfile ./src/bigdl-proto.js ./src/bigdl-proto.js
- fi
- }
- while [ "$#" != 0 ]; do
- command="$1" && shift
- case "${command}" in
- "clean") clean;;
- "sync") sync;;
- "schema") schema;;
- esac
- done
|