OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. |
| 5 |
| 6 # This file is used to execute the analyzer by running the jar file |
| 7 # It is a simple wrapper enabling us to have simpler command lines in |
| 8 # the testing infrastructure. |
| 9 # This file is copied to the output of the analyzer under bin/ by the |
| 10 # build scripts. |
| 11 set -e |
| 12 |
| 13 function follow_links() { |
| 14 while [ -h "$1" ]; do |
| 15 # On Mac OS, readlink -f doesn't work. |
| 16 1="$(readlink "$1")" |
| 17 done |
| 18 echo "$1" |
| 19 } |
| 20 |
| 21 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. |
| 22 PROG_NAME="$(follow_links "$BASH_SOURCE")" |
| 23 |
| 24 # Handle the case where the binary dir has been symlinked to. |
| 25 BIN_DIR="$(follow_links "$(cd "${PROG_NAME%/*}" ; pwd -P)")" |
| 26 |
| 27 # The jar file is placed one directory up from the bin directory. |
| 28 JAR_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)" |
| 29 |
| 30 JAR_FILE="$JAR_DIR/new_analyzer.jar" |
| 31 |
| 32 exec java -jar $JAR_FILE |
OLD | NEW |