bigdl 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. set -e
  3. pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
  4. bold() {
  5. echo "$(tty -s && tput bold)$1$(tty -s && tput sgr0)"
  6. }
  7. clean() {
  8. bold "bigdl clean"
  9. rm -rf ./third_party/bigdl
  10. }
  11. sync() {
  12. bold "bigdl sync"
  13. mkdir -p "./third_party"
  14. if [ -d "./third_party/bigdl" ]; then
  15. git -C "./third_party/bigdl" pull --quiet --prune
  16. else
  17. git -C "./third_party" clone --quiet --recursive https://github.com/intel-analytics/BigDL.git bigdl
  18. fi
  19. git -C "./third_party/bigdl" submodule sync --quiet
  20. git -C "./third_party/bigdl" submodule update --quiet --init --recursive
  21. }
  22. schema() {
  23. bold "bigdl schema"
  24. [[ $(grep -U $'\x0D' ./src/bigdl-proto.js) ]] && crlf=1
  25. 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
  26. if [[ -n ${crlf} ]]; then
  27. unix2dos --quiet --newfile ./src/bigdl-proto.js ./src/bigdl-proto.js
  28. fi
  29. }
  30. while [ "$#" != 0 ]; do
  31. command="$1" && shift
  32. case "${command}" in
  33. "clean") clean;;
  34. "sync") sync;;
  35. "schema") schema;;
  36. esac
  37. done