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
This commit is contained in:
ricow@google.com 2014-05-08 08:18:48 +00:00
parent 93abca2595
commit d0e8a0b8a6
2 changed files with 13 additions and 2 deletions

View file

@ -20,9 +20,12 @@ 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" "$@"
exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"

View file

@ -14,7 +14,15 @@ for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\dartanalyzer.dart.snapshot
"%DART%" "%SNAPSHOT%" %*
rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
rem Remove trailing backslash if there is one
if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
set SDK_ARG=--dart-sdk=%SDK_DIR%
"%DART%" "%SNAPSHOT%" "%SDK_ARG%" %*
endlocal