antlr: Use relative path in ANTLR script. (#4324)
authorMathias Preiner <mathias.preiner@gmail.com>
Fri, 17 Apr 2020 05:50:05 +0000 (22:50 -0700)
committerGitHub <noreply@github.com>
Fri, 17 Apr 2020 05:50:05 +0000 (22:50 -0700)
This will fix the CI caching issues we sometimes encountered on GH actions.

contrib/get-antlr-3.4

index bc75e833976459fdec26ab2b1edc7cb53b133826..45dc8658334e137e80ef2091159c2c0fc485cd6c 100755 (executable)
@@ -34,8 +34,8 @@ webget \
 mkdir -p "$ANTLR_HOME_DIR/bin"
 tee "$ANTLR_HOME_DIR/bin/antlr3" <<EOF
 #!/usr/bin/env bash
-export CLASSPATH=$INSTALL_DIR/share/java/antlr-3.4-complete.jar:\$CLASSPATH
-exec java org.antlr.Tool "\$@"
+JAR_FILE="\$(find "\$(dirname "\$0")/../" -name antlr-3.4-complete.jar)"
+exec java -cp "\$JAR_FILE" org.antlr.Tool "\$@"
 EOF
 chmod a+x "$ANTLR_HOME_DIR/bin/antlr3"
 install_bin "$ANTLR_HOME_DIR/bin/antlr3"