[javac][wrapper] specify which infer binary to use

Summary:
The previous version
- assumed that `infer` was in `PATH`
- would pick any old `infer` in `PATH` and not necessarily the right version

Reviewed By: mbouaziz

Differential Revision: D5433624

fbshipit-source-id: a59be3d
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent e828b0bf8a
commit 4d7742fd68

@ -2,6 +2,8 @@
# This is a wrapper for javac # This is a wrapper for javac
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -z "$INFER_OLD_PATH" ]; then if [ -z "$INFER_OLD_PATH" ]; then
echo '$INFER_OLD_PATH with a copy of $PATH not provided.' > /dev/stderr echo '$INFER_OLD_PATH with a copy of $PATH not provided.' > /dev/stderr
exit 1 exit 1
@ -10,7 +12,8 @@ fi
HOST_COMPILER=(`PATH="$INFER_OLD_PATH" which javac`) HOST_COMPILER=(`PATH="$INFER_OLD_PATH" which javac`)
COMPILER_ARGS=("$@") COMPILER_ARGS=("$@")
HOST_COMPILER_COMMAND=("$HOST_COMPILER" "${COMPILER_ARGS[@]}") HOST_COMPILER_COMMAND=("$HOST_COMPILER" "${COMPILER_ARGS[@]}")
FRONTEND_COMMAND=("infer" "capture" "--continue" "--" "javac" "${COMPILER_ARGS[@]}") FRONTEND_COMMAND=("$SCRIPT_DIR/../../bin/infer" "capture" "--continue"
"--" "javac" "${COMPILER_ARGS[@]}")
if [[ "$*" == *-version* ]]; then if [[ "$*" == *-version* ]]; then
exec "${HOST_COMPILER_COMMAND[@]}" exec "${HOST_COMPILER_COMMAND[@]}"

Loading…
Cancel
Save