OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 # This file is used to execute the analyzer by running the jar file. | 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 | 7 # It is a simple wrapper enabling us to have simpler command lines in |
8 # the testing infrastructure. | 8 # the testing infrastructure. |
9 set -e | 9 set -e |
10 | 10 |
11 function follow_links() { | 11 function follow_links() { |
12 while [ -h "$1" ]; do | 12 while [ -h "$1" ]; do |
13 # On Mac OS, readlink -f doesn't work. | 13 # On Mac OS, readlink -f doesn't work. |
14 1="$(readlink "$1")" | 14 1="$(readlink "$1")" |
15 done | 15 done |
16 echo "$1" | 16 echo "$1" |
17 } | 17 } |
18 | 18 |
19 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. | 19 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. |
20 PROG_NAME="$(follow_links "$BASH_SOURCE")" | 20 PROG_NAME="$(follow_links "$BASH_SOURCE")" |
21 | 21 |
22 BIN_DIR="$(follow_links "$(cd "${PROG_NAME%/*}" ; pwd -P)")" | |
ricow1
2013/03/13 07:06:05
could we just use CUR_DIR below, it is the same as
devoncarew
2013/03/13 17:04:50
Done.
| |
23 | |
24 SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)" | |
25 | |
22 # Handle the case where the binary dir has been symlinked to. | 26 # Handle the case where the binary dir has been symlinked to. |
23 CUR_DIR="$(follow_links "$(cd "${PROG_NAME%/*}" ; pwd -P)")" | 27 CUR_DIR="$(follow_links "$(cd "${PROG_NAME%/*}" ; pwd -P)")" |
24 | 28 |
25 if [ -z "$DART_CONFIGURATION" ]; | 29 if [ -z "$DART_CONFIGURATION" ]; |
26 then | 30 then |
27 DART_CONFIGURATION="ReleaseIA32" | 31 DART_CONFIGURATION="ReleaseIA32" |
28 fi | 32 fi |
29 | 33 |
30 if [[ `uname` == 'Darwin' ]]; | 34 if [[ `uname` == 'Darwin' ]]; |
31 then | 35 then |
32 JAR_DIR="$CUR_DIR"/../../xcodebuild/$DART_CONFIGURATION/new_analyzer | 36 JAR_DIR="$CUR_DIR"/../../xcodebuild/$DART_CONFIGURATION/new_analyzer |
33 else | 37 else |
34 JAR_DIR="$CUR_DIR"/../../out/$DART_CONFIGURATION/new_analyzer | 38 JAR_DIR="$CUR_DIR"/../../out/$DART_CONFIGURATION/new_analyzer |
35 fi | 39 fi |
36 | 40 |
37 JAR_FILE="$JAR_DIR/new_analyzer.jar" | 41 JAR_FILE="$JAR_DIR/new_analyzer.jar" |
38 | 42 |
39 exec java -jar $JAR_FILE "$@" | 43 exec java -jar $JAR_FILE --dart-sdk "$SDK_DIR" "$@" |
OLD | NEW |