Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #import('dart:io'); | 5 #import('dart:io'); |
| 6 #import('dart:uri'); | 6 #import('dart:uri'); |
| 7 | 7 |
| 8 #import('../../lib/compiler/implementation/util/uri_extras.dart'); | 8 #import('../../lib/compiler/implementation/util/uri_extras.dart'); |
| 9 #import('../../lib/compiler/implementation/filenames.dart'); | 9 #import('../../lib/compiler/implementation/filenames.dart'); |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 print('${name}PathWin = $pathWin'); | 91 print('${name}PathWin = $pathWin'); |
| 92 | 92 |
| 93 // Tell the VM to grow the heap more aggressively. This should only | 93 // Tell the VM to grow the heap more aggressively. This should only |
| 94 // be necessary temporarily until the VM is better at detecting how | 94 // be necessary temporarily until the VM is better at detecting how |
| 95 // applications use memory. | 95 // applications use memory. |
| 96 // TODO(ahe): Remove this option. | 96 // TODO(ahe): Remove this option. |
| 97 options = ' --heap_growth_rate=32$options'; | 97 options = ' --heap_growth_rate=32$options'; |
| 98 | 98 |
| 99 return [ | 99 return [ |
| 100 ''' | 100 ''' |
| 101 #!/bin/sh | 101 #!/bin/sh |
|
ahe
2012/09/28 03:47:30
This should be /bin/bash as the script relies on b
dgrove
2012/09/28 15:48:17
Done.
| |
| 102 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 102 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 103 # for details. All rights reserved. Use of this source code is governed by a | 103 # for details. All rights reserved. Use of this source code is governed by a |
| 104 # BSD-style license that can be found in the LICENSE file. | 104 # BSD-style license that can be found in the LICENSE file. |
| 105 | 105 |
| 106 BIN_DIR=`dirname \$0` | 106 # Setting BIN_DIR this way is ugly, but is needed to handle the case where |
| 107 # dart-sdk/bin has been symlinked to. On MacOS, readlink doesn't work | |
| 108 # with this case. | |
| 109 BIN_DIR=`cd "\$(dirname "\$0")"; pwd -P` | |
|
ahe
2012/09/28 03:47:30
I've been reading up on the Bash manual (http://ww
dgrove
2012/09/28 15:48:17
This seems like a good (but even uglier) alternati
| |
| 110 | |
| 107 unset COLORS | 111 unset COLORS |
| 108 if test -t 1; then | 112 if test -t 1; then |
| 109 # Stdout is a terminal. | 113 # Stdout is a terminal. |
| 110 if test 8 -le `tput colors`; then | 114 if test 8 -le `tput colors`; then |
| 111 # Stdout has at least 8 colors, so enable colors. | 115 # Stdout has at least 8 colors, so enable colors. |
| 112 COLORS="--enable-diagnostic-colors" | 116 COLORS="--enable-diagnostic-colors" |
| 113 fi | 117 fi |
| 114 fi | 118 fi |
| 115 exec \$BIN_DIR/dart$options \$BIN_DIR/$path \$COLORS "\$@" | 119 exec \$BIN_DIR/dart$options \$BIN_DIR/$path \$COLORS "\$@" |
|
ahe
2012/09/28 03:47:30
To handle spaces, this should be:
exec "\$BIN_DIR
dgrove
2012/09/28 15:48:17
Done.
| |
| 116 ''', | 120 ''', |
| 117 ''' | 121 ''' |
| 118 @echo off | 122 @echo off |
| 119 REM Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 123 REM Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 120 REM for details. All rights reserved. Use of this source code is governed by a | 124 REM for details. All rights reserved. Use of this source code is governed by a |
| 121 REM BSD-style license that can be found in the LICENSE file. | 125 REM BSD-style license that can be found in the LICENSE file. |
| 122 | 126 |
| 123 set SCRIPTPATH=%~dp0 | 127 set SCRIPTPATH=%~dp0 |
| 124 | 128 |
| 125 REM Does the path have a trailing slash? If so, remove it. | 129 REM Does the path have a trailing slash? If so, remove it. |
| 126 if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1% | 130 if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1% |
| 127 | 131 |
| 128 set arguments=%* | 132 set arguments=%* |
| 129 | 133 |
| 130 "%SCRIPTPATH%\dart.exe"$options "%SCRIPTPATH%$pathWin" %arguments% | 134 "%SCRIPTPATH%\dart.exe"$options "%SCRIPTPATH%$pathWin" %arguments% |
| 131 '''.replaceAll('\n', '\r\n')]; | 135 '''.replaceAll('\n', '\r\n')]; |
| 132 } | 136 } |
| OLD | NEW |