OLD | NEW |
1 @echo off | 1 @echo off |
2 REM Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 REM Copyright (c) 2012, 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 | 5 |
6 set SCRIPTPATH=%~dp0 | 6 setlocal |
| 7 rem Handle the case where dart-sdk/bin has been symlinked to. |
| 8 set DIR_NAME_WITH_SLASH=%~dp0 |
| 9 set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%% |
| 10 call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR |
| 11 rem Get rid of surrounding quotes. |
| 12 for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi |
7 | 13 |
8 REM Does the path have a trailing slash? If so, remove it. | 14 rem Get absolute full name for SDK_DIR. |
9 if %SCRIPTPATH:~-1%== set SCRIPTPATH=%SCRIPTPATH:~0,-1% | 15 for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi |
10 | 16 |
11 set arguments=%* | 17 set DART2JS=%SDK_DIR%lib\_internal\compiler\implementation\dart2js.dart |
12 set SCRIPTNAME="%SCRIPTPATH%..\lib\_internal\compiler\implementation\dart2js.dar
t" | 18 set DART=%BIN_DIR%\dart |
13 set SNAPSHOTNAME="%SCRIPTPATH%dart2js.snapshot" | 19 set SNAPSHOT=%DART2JS%.snapshot |
14 if exist %SNAPSHOTNAME% set SCRIPTNAME=%SNAPSHOTNAME% | |
15 | 20 |
16 "%SCRIPTPATH%dart" --heap_growth_rate=512 %SCRIPTNAME% %arguments% | 21 set EXTRA_OPTIONS= |
| 22 set EXTRA_VM_OPTIONS= |
| 23 |
| 24 if _%DART2JS_DEVELOPER_MODE%_ == _1_ ( |
| 25 set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked |
| 26 ) |
| 27 |
| 28 if exist "%SNAPSHOT%" ( |
| 29 echo Using snapshot "%SNAPSHOT%" >&2 |
| 30 set DART2JS=%SNAPSHOT% |
| 31 ) |
| 32 |
| 33 rem See comments regarding options below in dart2js shell script. |
| 34 set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512 |
| 35 |
| 36 "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %* |
| 37 endlocal |
| 38 |
| 39 exit /b %errorlevel% |
| 40 |
| 41 :follow_links |
| 42 setlocal |
| 43 for %%i in (%1) do set result=%%~fi |
| 44 set current= |
| 45 for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^ |
| 46 ^| find "> %~n1 ["') do ( |
| 47 set current=%%i |
| 48 ) |
| 49 if not "%current%"=="" call :follow_links "%current%", result |
| 50 endlocal & set %~2=%result% |
| 51 goto :eof |
| 52 |
| 53 :end |
OLD | NEW |