dart-sdk/sdk/bin/dartanalyzer
ricow@google.com d0e8a0b8a6 Add dart-sdk argument when calling the dart based analyzer in the created sdk
I am not even sure why we need to pass in this argument, but the tool requires this or it will exit with "Usage: dartanalyzer: no Dart SDK found."

This is a fix so that we can get a release out, I will leave it to the analyzer people to figure out if this is needed after all.

R=kasperl@google.com

Review URL: https://codereview.chromium.org//273863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35889 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 08:18:48 +00:00

32 lines
945 B
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.
# Run dartanalyzer.dart on the Dart VM. This script assumes the Dart SDK's
# directory structure.
function follow_links() {
file="$1"
while [ -h "$file" ]; do
# On Mac OS, readlink -f doesn't work.
file="$(readlink "$file")"
done
echo "$file"
}
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
PROG_NAME="$(follow_links "$BASH_SOURCE")"
# Handle the case where dart-sdk/bin has been symlinked to.
BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
SDK_ARG="--dart-sdk=$SDK_DIR"
SNAPSHOT="$BIN_DIR/snapshots/dartanalyzer.dart.snapshot"
# We are running the snapshot in the built SDK.
DART="$BIN_DIR/dart"
exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"