OLD | NEW |
1 @echo off | 1 @echo off |
2 rem Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 rem Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
3 rem for details. All rights reserved. Use of this source code is governed by a | 3 rem for details. All rights reserved. Use of this source code is governed by a |
4 rem BSD-style license that can be found in the LICENSE file. | 4 rem BSD-style license that can be found in the LICENSE file. |
| 5 rem |
5 | 6 |
6 set SCRIPT_DIR=%~dp0 | 7 rem This file is used to execute the analyzer by running the jar file. |
7 if %SCRIPT_DIR:~-1%==\ set SCRIPT_DIR=%SCRIPT_DIR:~0,-1% | 8 rem It is a simple wrapper enabling us to have simpler command lines in |
| 9 rem the testing infrastructure. |
8 | 10 |
9 for %%I in ("%SCRIPT_DIR%\..") do set "DART_ANALYZER_HOME=%%~fI" | 11 set SCRIPTPATH=%~dp0 |
10 if %DART_ANALYZER_HOME:~-1%==\ set DART_ANALYZER_HOME=%DART_ANALYZER_HOME:~0,-1% | |
11 | 12 |
12 set FOUND_BATCH=0 | 13 rem Does the path have a trailing slash? If so, remove it. |
13 set FOUND_SDK=0 | 14 if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1% |
14 for %%a in (%*) do ( | |
15 if [%%a] == [--batch] set FOUND_BATCH=1 | |
16 if [%%a] == [-b] set FOUND_BATCH=1 | |
17 if [%%a] == [--dart-sdk] set FOUND_SDK=1 | |
18 ) | |
19 | 15 |
20 setlocal EnableDelayedExpansion | 16 rem DART_CONFIGURATION defaults to ReleaseIA32 |
21 set DART_SDK="" | 17 if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseIA32 |
22 if [%FOUND_SDK%] == [0] ( | |
23 if exist "%DART_ANALYZER_HOME%\lib\core\core.dart" ( | |
24 set DART_SDK=--dart-sdk "%DART_ANALYZER_HOME%" | |
25 ) else ( | |
26 for /f %%i in ('echo %DART_ANALYZER_HOME%') do set DART_SDK_HOME=%%~dpi\dart
-sdk | |
27 if exist "!DART_SDK_HOME!" ( | |
28 set DART_SDK=--dart-sdk !DART_SDK_HOME! | |
29 ) else ( | |
30 for /f %%j in ('call echo !DART_SDK_HOME!') do set DART_SDK_HOME=%%~dpj\da
rt-sdk | |
31 if exist "!DART_SDK_HOME!" ( | |
32 set DART_SDK=--dart-sdk !DART_SDK_HOME! | |
33 ) else ( | |
34 echo Couldn't find Dart SDK. Specify with --dart-sdk cmdline argument | |
35 ) | |
36 ) | |
37 ) | |
38 ) | |
39 endlocal & set DART_SDK=%DART_SDK% & set DART_SDK_HOME=%DART_SDK_HOME% | |
40 | 18 |
41 if exist "%DART_SDK_HOME%\util\dartanalyzer\dartanalyzer.jar" ( | 19 set arguments=%* |
42 set DART_ANALYZER_LIBS=%DART_SDK_HOME%\util\dartanalyzer | |
43 ) else if exist "%DART_ANALYZER_HOME%\util\dartanalyzer\dartanalyzer.jar" ( | |
44 set DART_ANALYZER_LIBS=%DART_ANALYZER_HOME%\util\dartanalyzer | |
45 ) else ( | |
46 echo Configuration problem. Couldn't find dartanalyzer.jar. | |
47 exit /b 1 | |
48 ) | |
49 | 20 |
50 setlocal EnableDelayedExpansion | 21 set "SDK_DIR=%SCRIPTPATH%\..\..\build\%DART_CONFIGURATION%\dart-sdk" |
51 set EXTRA_JVMARGS=-Xss2M | |
52 if [%FOUND_BATCH%] == [1] ( | |
53 set EXTRA_JVMARGS=!EXTRA_JVMARGS! -client | |
54 ) | |
55 endlocal & set "EXTRA_JVMARGS=%EXTRA_JVMARGS%" | |
56 | 22 |
57 java %EXTRA_JVMARGS% %DART_JVMARGS% -ea -jar "%DART_ANALYZER_LIBS%\dartanalyzer.
jar" %DART_SDK% %* | 23 set "JAR_DIR=%SCRIPTPATH%\..\..\build\%DART_CONFIGURATION%\dartanalyzer" |
| 24 |
| 25 set "JAR_FILE=%JAR_DIR%\dartanalyzer.jar" |
| 26 |
| 27 java -jar "%JAR_FILE%" --dart-sdk "%SDK_DIR%" %arguments% |
OLD | NEW |