diff options
Diffstat (limited to 'thrift-compile.sh')
-rwxr-xr-x | thrift-compile.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/thrift-compile.sh b/thrift-compile.sh index c47cc86..8eef59b 100755 --- a/thrift-compile.sh +++ b/thrift-compile.sh @@ -1,7 +1,8 @@ #!/bin/bash -if ! thrift --version | grep -q "0\.9\.3"; then - echo -n "Warning! You should be using Thrift 0.9.3, but you have $(thrift --version), do you still want to continue? [y/N]: " +WANT_VER="0.17.0" +if ! thrift --version | grep -qF "$WANT_VER"; then + echo -n "Warning! You should be using Thrift $WANT_VER, but you have $(thrift --version), do you still want to continue? [y/N]: " read choice if [ "x${choice:0:1}" != "xy" ]; then echo "Aborting!" @@ -18,8 +19,8 @@ if thrift --gen java src/main/thrift/bwlp.thrift; then bn=$(basename "$file") if [ -e "src/main/java/org/openslx/bwlp/thrift/iface/$bn" ]; then diff -q \ - <(sed -r 's/_(i|iter|elem|list|map|key|val)[0-9]+/\1x/g;/@Generated/d' "$file") \ - <(sed -r 's/_(i|iter|elem|list|map|key|val)[0-9]+/\1x/g;/@Generated/d' "src/main/java/org/openslx/bwlp/thrift/iface/$bn") + <(sed -r 's/_(i|iter|elem|list|map|key|val)[0-9]+/\1x/g;/Autogenerated by|@Generated|@Override/d' "$file") \ + <(sed -r 's/_(i|iter|elem|list|map|key|val)[0-9]+/\1x/g;/Autogenerated by|@Generated|@Override/d' "src/main/java/org/openslx/bwlp/thrift/iface/$bn") ret=$? [ "$ret" = 0 ] && continue fi @@ -30,6 +31,7 @@ if thrift --gen java src/main/thrift/bwlp.thrift; then bn=$(basename "$file") [ -e "gen-java/org/openslx/bwlp/thrift/iface/$bn" ] || git rm "$file" done + [ -e gen-java ] && rm -r gen-java fi echo "All done!" |