bigdl 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/src/bigdl
  10. }
  11. sync() {
  12. bold "bigdl sync"
  13. [ -d "./third_party/src/bigdl" ] || git clone --quiet --recursive https://github.com/intel-analytics/BigDL.git "./third_party/src/bigdl"
  14. pushd "./third_party/src/bigdl" > /dev/null
  15. git pull --quiet --prune
  16. git submodule sync --quiet
  17. git submodule update --quiet --init --recursive
  18. popd > /dev/null
  19. }
  20. schema() {
  21. bold "bigdl schema"
  22. [[ $(grep -U $'\x0D' ./src/bigdl-proto.js) ]] && crlf=1
  23. 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/src/bigdl/spark/dl/src/main/resources/serialization/bigdl.proto
  24. if [[ -n ${crlf} ]]; then
  25. unix2dos --quiet --newfile ./src/bigdl-proto.js ./src/bigdl-proto.js
  26. fi
  27. }
  28. while [ "$#" != 0 ]; do
  29. command="$1" && shift
  30. case "${command}" in
  31. "clean") clean;;
  32. "sync") sync;;
  33. "schema") schema;;
  34. esac
  35. done