mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
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:
parent
4924f73340
commit
bf56eebc86
39
sdk/bin/analyzer
Executable file
39
sdk/bin/analyzer
Executable 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
25
sdk/bin/analyzer.bat
Normal 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%"
|
Loading…
Reference in a new issue