| 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 '../../sdk/lib/_internal/compiler/implementation/util/uri_extras.dart'; |
| 9 #import('../../lib/compiler/implementation/filenames.dart'); | 9 import '../../sdk/lib/_internal/compiler/implementation/filenames.dart'; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 List<String> arguments = new Options().arguments; | 12 List<String> arguments = new Options().arguments; |
| 13 Uri cwd = getCurrentDirectory(); | 13 Uri cwd = getCurrentDirectory(); |
| 14 String productDir = appendSlash(nativeToUriPath(arguments[0])); | 14 String productDir = appendSlash(nativeToUriPath(arguments[0])); |
| 15 String dartVmPath = nativeToUriPath(arguments[1]); | 15 String dartVmPath = nativeToUriPath(arguments[1]); |
| 16 String productionName = nativeToUriPath(arguments[2]); | 16 String productionName = nativeToUriPath(arguments[2]); |
| 17 String developerName = nativeToUriPath(arguments[3]); | 17 String developerName = nativeToUriPath(arguments[3]); |
| 18 String dartdocName = nativeToUriPath(arguments[4]); | 18 String dartdocName = nativeToUriPath(arguments[4]); |
| 19 String dartDir = appendSlash(nativeToUriPath(arguments[5])); | 19 String dartDir = appendSlash(nativeToUriPath(arguments[5])); |
| 20 | 20 |
| 21 Uri dartUri = cwd.resolve(dartDir); | 21 Uri dartUri = cwd.resolve(dartDir); |
| 22 Uri productUri = cwd.resolve(productDir); | 22 Uri productUri = cwd.resolve(productDir); |
| 23 | 23 |
| 24 Uri dartVmUri = productUri.resolve(dartVmPath); | 24 Uri dartVmUri = productUri.resolve(dartVmPath); |
| 25 Uri productionUri = productUri.resolve(arguments[2]); | 25 Uri productionUri = productUri.resolve(arguments[2]); |
| 26 Uri developerUri = productUri.resolve(arguments[3]); | 26 Uri developerUri = productUri.resolve(arguments[3]); |
| 27 Uri dartdocUri = productUri.resolve(arguments[4]); | 27 Uri dartdocUri = productUri.resolve(arguments[4]); |
| 28 | 28 |
| 29 List<String> productionScript = buildScript( | 29 List<String> productionScript = buildScript( |
| 30 'dart2js-production', | 30 'dart2js-production', |
| 31 dartUri, dartVmUri, | 31 dartUri, dartVmUri, |
| 32 'lib/compiler/implementation/dart2js.dart', ''); | 32 'sdk/lib/_internal/compiler/implementation/dart2js.dart', ''); |
| 33 writeScript(productionUri, productionScript); | 33 writeScript(productionUri, productionScript); |
| 34 | 34 |
| 35 List<String> developerScript = buildScript( | 35 List<String> developerScript = buildScript( |
| 36 'dart2js-developer', | 36 'dart2js-developer', |
| 37 dartUri, dartVmUri, | 37 dartUri, dartVmUri, |
| 38 'lib/compiler/implementation/dart2js.dart', ' --enable_checked_mode'); | 38 'sdk/lib/_internal/compiler/implementation/dart2js.dart', |
| 39 ' --enable_checked_mode'); |
| 39 writeScript(developerUri, developerScript); | 40 writeScript(developerUri, developerScript); |
| 40 | 41 |
| 41 List<String> dartdocScript = buildScript( | 42 List<String> dartdocScript = buildScript( |
| 42 'dartdoc', | 43 'dartdoc', |
| 43 dartUri, dartVmUri, | 44 dartUri, dartVmUri, |
| 44 'pkg/dartdoc/bin/dartdoc.dart', ''); | 45 'sdk/lib/_internal/dartdoc/bin/dartdoc.dart', ''); |
| 45 writeScript(dartdocUri, dartdocScript); | 46 writeScript(dartdocUri, dartdocScript); |
| 46 } | 47 } |
| 47 | 48 |
| 48 writeScript(Uri uri, List<String> scripts) { | 49 writeScript(Uri uri, List<String> scripts) { |
| 49 String unixScript = scripts[0]; | 50 String unixScript = scripts[0]; |
| 50 String batFile = scripts[1]; | 51 String batFile = scripts[1]; |
| 51 var f = new File(uriPathToNative(uri.path)); | 52 var f = new File(uriPathToNative(uri.path)); |
| 52 var stream = f.openSync(FileMode.WRITE); | 53 var stream = f.openSync(FileMode.WRITE); |
| 53 try { | 54 try { |
| 54 stream.writeStringSync(unixScript); | 55 stream.writeStringSync(unixScript); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 REM Does the path have a trailing slash? If so, remove it. | 142 REM Does the path have a trailing slash? If so, remove it. |
| 142 if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1% | 143 if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1% |
| 143 | 144 |
| 144 set arguments=%* | 145 set arguments=%* |
| 145 set SNAPSHOTNAME=%SCRIPTPATH%dart2js.snapshot | 146 set SNAPSHOTNAME=%SCRIPTPATH%dart2js.snapshot |
| 146 if exist %SNAPSHOTNAME% set SNAPSHOT=--use_script_snapshot=%SNAPSHOTNAME% | 147 if exist %SNAPSHOTNAME% set SNAPSHOT=--use_script_snapshot=%SNAPSHOTNAME% |
| 147 | 148 |
| 148 "%SCRIPTPATH%\dart.exe"$options %SNAPSHOT% "%SCRIPTPATH%$pathWin" %arguments% | 149 "%SCRIPTPATH%\dart.exe"$options %SNAPSHOT% "%SCRIPTPATH%$pathWin" %arguments% |
| 149 '''.replaceAll('\n', '\r\n')]; | 150 '''.replaceAll('\n', '\r\n')]; |
| 150 } | 151 } |
| OLD | NEW |