| OLD | NEW |
| 1 #!/bin/bash --posix | 1 #!/bin/bash --posix |
| 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 set -e | 6 set -e |
| 7 | 7 |
| 8 # Setting SCRIPT_DIR this way is ugly, but is needed to handle the case where | 8 # Setting SCRIPT_DIR this way is ugly, but is needed to handle the case where |
| 9 # dart-sdk/bin has been symlinked to. On MacOS, readlink doesn't work | 9 # dart-sdk/bin has been symlinked to. On MacOS, readlink -f doesn't work with |
| 10 # with this case. | 10 # this case. |
| 11 SCRIPT_DIR="$(cd "${0%/*}" ; pwd -P)" | 11 SCRIPT=`readlink "$0" || echo "$0"` |
| 12 SCRIPT_DIR="$(cd "${SCRIPT%/*}" ; pwd -P)" |
| 12 DART_ANALYZER_HOME="$(cd "${SCRIPT_DIR%/*}" ; pwd -P)" | 13 DART_ANALYZER_HOME="$(cd "${SCRIPT_DIR%/*}" ; pwd -P)" |
| 13 | 14 |
| 14 FOUND_BATCH=0 | 15 FOUND_BATCH=0 |
| 15 FOUND_SDK=0 | 16 FOUND_SDK=0 |
| 16 for ARG in "$@" | 17 for ARG in "$@" |
| 17 do | 18 do |
| 18 case $ARG in | 19 case $ARG in |
| 19 -batch|--batch) | 20 -batch|--batch) |
| 20 FOUND_BATCH=1 | 21 FOUND_BATCH=1 |
| 21 ;; | 22 ;; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 # On other architectures | 71 # On other architectures |
| 71 # -batch invocations will do better with a server vm | 72 # -batch invocations will do better with a server vm |
| 72 # invocations for analyzing a single file do better with a client vm | 73 # invocations for analyzing a single file do better with a client vm |
| 73 if [ $FOUND_BATCH -eq 0 ] ; then | 74 if [ $FOUND_BATCH -eq 0 ] ; then |
| 74 EXTRA_JVMARGS+=" -client " | 75 EXTRA_JVMARGS+=" -client " |
| 75 fi | 76 fi |
| 76 fi | 77 fi |
| 77 | 78 |
| 78 exec java $EXTRA_JVMARGS $DART_JVMARGS -ea -jar \ | 79 exec java $EXTRA_JVMARGS $DART_JVMARGS -ea -jar \ |
| 79 "$DART_ANALYZER_LIBS/dartanalyzer.jar" "${DART_SDK[@]}" $@ | 80 "$DART_ANALYZER_LIBS/dartanalyzer.jar" "${DART_SDK[@]}" $@ |
| OLD | NEW |