Advertisement
cooperlees

Untitled

Oct 4th, 2019
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # This assumes a working thrift compiler + go environment
  4. # MAC: brew install golang thrift
  5.  
  6. THIS_DIR="$(dirname "$(realpath "$0")")"
  7. OPENR_THRIFT="$THIS_DIR/openr_thrift"
  8. SRC_DIR="$(dirname "$(dirname "$(realpath "$0")")")"
  9. THRIFT_DIR="$SRC_DIR/terragraph-e2e/e2e/if"
  10.  
  11. echo "REPO Base: $SRC_DIR"
  12. echo "Thrift Base: $THRIFT_DIR"
  13.  
  14. if [ "$GOPATH" == "" ];
  15. then
  16.     echo "I have no GOPATH set. Make it so ..."
  17.     exit 69
  18. fi
  19.  
  20. echo "-- Thrift Build --"
  21.  
  22. for thrift_file in "$THRIFT_DIR"/*.thrift
  23. do
  24.     echo "-> Thrift generating go stubs for $thrift_file"
  25.     thrift -r -I "$OPENR_THRIFT" --gen go "$thrift_file"
  26.  
  27. done
  28.  
  29. mv -v gen-go/* "$GOPATH/src"
  30. rmdir gen-go
  31.  
  32. # echo "Building sample_client.go"
  33. go build "$THIS_DIR"/sample_client.go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement