Create "binaries" for calling the new analyzer.

This make the testing script look much nicer, and it allows for easier calling the analyzer instead of using java -jar
Review URL: https://codereview.chromium.org//12335133

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19882 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
ricow@google.com 2013-03-12 17:42:15 +00:00
parent 4924f73340
commit bf56eebc86
2 changed files with 64 additions and 0 deletions

39
sdk/bin/analyzer Executable file
View file

@ -0,0 +1,39 @@
#!/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"
}
# 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)")"
if [ -z "$DART_CONFIGURATION" ];
then
DART_CONFIGURATION="ReleaseIA32"
fi
if [[ `uname` == 'Darwin' ]];
then
JAR_DIR="$CUR_DIR"/../../xcodebuild/$DART_CONFIGURATION/new_analyzer
else
JAR_DIR="$CUR_DIR"/../../out/$DART_CONFIGURATION/new_analyzer
fi
JAR_FILE="$JAR_DIR/new_analyzer.jar"
exec java -jar $JAR_FILE "$@"

25
sdk/bin/analyzer.bat Normal file
View file

@ -0,0 +1,25 @@
@echo off
rem Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
rem for details. All rights reserved. Use of this source code is governed by a
rem BSD-style license that can be found in the LICENSE file.
rem
rem This file is used to execute the analyzer by running the jar file.
rem It is a simple wrapper enabling us to have simpler command lines in
rem the testing infrastructure.
set SCRIPTPATH=%~dp0
rem Does the path have a trailing slash? If so, remove it.
if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%
rem DART_CONFIGURATION defaults to ReleaseIA32
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseIA32
set arguments=%*
set "JAR_DIR=%SCRIPTPATH%\..\..\build\%DART_CONFIGURATION%\new_analyzer"
set "JAR_FILE=%JAR_DIR%\new_analyzer.jar"
java -jar %JAR_FILE% %arguments%"