mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:57:43 +00:00
eedbf0ccfc
R=scheglov@google.com Review URL: https://codereview.chromium.org//22577003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25923 260f80e4-7a28-3924-810f-c04153c831b5
68 lines
1.7 KiB
Bash
Executable file
68 lines
1.7 KiB
Bash
Executable file
#!/bin/bash
|
|
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
# This file is used to execute the analyzer by running the jar file.
|
|
# It is a simple wrapper enabling us to have simpler command lines in
|
|
# the testing infrastructure.
|
|
set -e
|
|
|
|
function follow_links() {
|
|
while [ -h "$1" ]; do
|
|
# On Mac OS, readlink -f doesn't work.
|
|
1="$(readlink "$1")"
|
|
done
|
|
echo "$1"
|
|
}
|
|
|
|
FOUND_BATCH=0
|
|
for ARG in "$@"
|
|
do
|
|
case $ARG in
|
|
-batch|--batch)
|
|
FOUND_BATCH=1
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
|
|
PROG_NAME="$(follow_links "$BASH_SOURCE")"
|
|
|
|
# Handle the case where the binary dir has been symlinked to.
|
|
CUR_DIR="$(follow_links "$(cd "${PROG_NAME%/*}" ; pwd -P)")"
|
|
|
|
SDK_DIR="$(cd "${CUR_DIR}/.." ; pwd -P)"
|
|
|
|
if [ -z "$DART_CONFIGURATION" ];
|
|
then
|
|
DART_CONFIGURATION="ReleaseIA32"
|
|
fi
|
|
|
|
if [ `uname` == 'Darwin' ];
|
|
then
|
|
JAR_DIR="$CUR_DIR"/../../xcodebuild/$DART_CONFIGURATION/dartanalyzer
|
|
else
|
|
JAR_DIR="$CUR_DIR"/../../out/$DART_CONFIGURATION/dartanalyzer
|
|
fi
|
|
|
|
JAR_FILE="$JAR_DIR/dartanalyzer.jar"
|
|
|
|
EXTRA_JVMARGS="-Xss2M "
|
|
OS=`uname | tr "[A-Z]" "[a-z]"`
|
|
if [ "$OS" == "darwin" ] ; then
|
|
# Bump up the heap on Mac VMs, some of which default to 128M or less.
|
|
EXTRA_JVMARGS+=" -Xmx256M -client "
|
|
else
|
|
# On other architectures
|
|
# -batch invocations will do better with a server vm
|
|
# invocations for analyzing a single file do better with a client vm
|
|
if [ $FOUND_BATCH -eq 0 ] ; then
|
|
EXTRA_JVMARGS+=" -client "
|
|
fi
|
|
fi
|
|
|
|
exec java $EXTRA_JVMARGS -jar $JAR_FILE --dart-sdk "$SDK_DIR" "$@"
|