Index: sdk/bin/dartanalyzer_java.bat |
diff --git a/sdk/bin/dartanalyzer_java.bat b/sdk/bin/dartanalyzer_java.bat |
index 490512446376baf4782c3a1b40c4cbb8fee2095b..86f47a8760a649234ba00fd8cbf52289c77afc5c 100644 |
--- a/sdk/bin/dartanalyzer_java.bat |
+++ b/sdk/bin/dartanalyzer_java.bat |
@@ -2,56 +2,26 @@ |
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 |
-set SCRIPT_DIR=%~dp0 |
-if %SCRIPT_DIR:~-1%==\ set SCRIPT_DIR=%SCRIPT_DIR:~0,-1% |
- |
-for %%I in ("%SCRIPT_DIR%\..") do set "DART_ANALYZER_HOME=%%~fI" |
-if %DART_ANALYZER_HOME:~-1%==\ set DART_ANALYZER_HOME=%DART_ANALYZER_HOME:~0,-1% |
- |
-set FOUND_BATCH=0 |
-set FOUND_SDK=0 |
-for %%a in (%*) do ( |
- if [%%a] == [--batch] set FOUND_BATCH=1 |
- if [%%a] == [-b] set FOUND_BATCH=1 |
- if [%%a] == [--dart-sdk] set FOUND_SDK=1 |
-) |
- |
-setlocal EnableDelayedExpansion |
-set DART_SDK="" |
-if [%FOUND_SDK%] == [0] ( |
- if exist "%DART_ANALYZER_HOME%\lib\core\core.dart" ( |
- set DART_SDK=--dart-sdk "%DART_ANALYZER_HOME%" |
- ) else ( |
- for /f %%i in ('echo %DART_ANALYZER_HOME%') do set DART_SDK_HOME=%%~dpi\dart-sdk |
- if exist "!DART_SDK_HOME!" ( |
- set DART_SDK=--dart-sdk !DART_SDK_HOME! |
- ) else ( |
- for /f %%j in ('call echo !DART_SDK_HOME!') do set DART_SDK_HOME=%%~dpj\dart-sdk |
- if exist "!DART_SDK_HOME!" ( |
- set DART_SDK=--dart-sdk !DART_SDK_HOME! |
- ) else ( |
- echo Couldn't find Dart SDK. Specify with --dart-sdk cmdline argument |
- ) |
- ) |
- ) |
-) |
-endlocal & set DART_SDK=%DART_SDK% & set DART_SDK_HOME=%DART_SDK_HOME% |
- |
-if exist "%DART_SDK_HOME%\util\dartanalyzer\dartanalyzer.jar" ( |
- set DART_ANALYZER_LIBS=%DART_SDK_HOME%\util\dartanalyzer |
-) else if exist "%DART_ANALYZER_HOME%\util\dartanalyzer\dartanalyzer.jar" ( |
- set DART_ANALYZER_LIBS=%DART_ANALYZER_HOME%\util\dartanalyzer |
-) else ( |
- echo Configuration problem. Couldn't find dartanalyzer.jar. |
- exit /b 1 |
-) |
- |
-setlocal EnableDelayedExpansion |
-set EXTRA_JVMARGS=-Xss2M |
-if [%FOUND_BATCH%] == [1] ( |
- set EXTRA_JVMARGS=!EXTRA_JVMARGS! -client |
-) |
-endlocal & set "EXTRA_JVMARGS=%EXTRA_JVMARGS%" |
- |
-java %EXTRA_JVMARGS% %DART_JVMARGS% -ea -jar "%DART_ANALYZER_LIBS%\dartanalyzer.jar" %DART_SDK% %* |
+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 "SDK_DIR=%SCRIPTPATH%\..\..\build\%DART_CONFIGURATION%\dart-sdk" |
+ |
+set "JAR_DIR=%SCRIPTPATH%\..\..\build\%DART_CONFIGURATION%\dartanalyzer" |
+ |
+set "JAR_FILE=%JAR_DIR%\dartanalyzer.jar" |
+ |
+java -jar "%JAR_FILE%" --dart-sdk "%SDK_DIR%" %arguments% |