| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library runtime_configuration; | 5 library runtime_configuration; |
| 6 | 6 |
| 7 import 'dart:io' show Directory, File; | 7 import 'dart:io' show Directory, File; |
| 8 | 8 |
| 9 import 'compiler_configuration.dart' show CommandArtifact; | 9 import 'compiler_configuration.dart' show CommandArtifact; |
| 10 | 10 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 CommandBuilder commandBuilder, | 273 CommandBuilder commandBuilder, |
| 274 CommandArtifact artifact, | 274 CommandArtifact artifact, |
| 275 List<String> arguments, | 275 List<String> arguments, |
| 276 Map<String, String> environmentOverrides) { | 276 Map<String, String> environmentOverrides) { |
| 277 String script = artifact.filename; | 277 String script = artifact.filename; |
| 278 String type = artifact.mimeType; | 278 String type = artifact.mimeType; |
| 279 if (script != null && type != 'application/dart-precompiled') { | 279 if (script != null && type != 'application/dart-precompiled') { |
| 280 throw "dart_precompiled cannot run files of type '$type'."; | 280 throw "dart_precompiled cannot run files of type '$type'."; |
| 281 } | 281 } |
| 282 | 282 |
| 283 var args = new List(); | |
| 284 args.addAll(arguments); | |
| 285 for (var i = 0; i < args.length; i++) { | |
| 286 if (args[i].endsWith(".dart")) { | |
| 287 args[i] = "${artifact.filename}/out.aotsnapshot"; | |
| 288 } | |
| 289 } | |
| 290 | |
| 291 return <Command>[ | 283 return <Command>[ |
| 292 commandBuilder.getVmCommand(suite.dartPrecompiledBinaryFileName, | 284 commandBuilder.getVmCommand(suite.dartPrecompiledBinaryFileName, |
| 293 args, environmentOverrides) | 285 arguments, environmentOverrides) |
| 294 ]; | 286 ]; |
| 295 } | 287 } |
| 296 } | 288 } |
| 297 | 289 |
| 298 class DartPrecompiledAdbRuntimeConfiguration | 290 class DartPrecompiledAdbRuntimeConfiguration |
| 299 extends DartVmRuntimeConfiguration { | 291 extends DartVmRuntimeConfiguration { |
| 300 final bool useBlobs; | 292 final bool useBlobs; |
| 301 DartPrecompiledAdbRuntimeConfiguration({bool useBlobs}) : useBlobs = useBlobs; | 293 DartPrecompiledAdbRuntimeConfiguration({bool useBlobs}) : useBlobs = useBlobs; |
| 302 | 294 |
| 303 List<Command> computeRuntimeCommands( | 295 List<Command> computeRuntimeCommands( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { | 356 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 365 List<Command> computeRuntimeCommands( | 357 List<Command> computeRuntimeCommands( |
| 366 TestSuite suite, | 358 TestSuite suite, |
| 367 CommandBuilder commandBuilder, | 359 CommandBuilder commandBuilder, |
| 368 CommandArtifact artifact, | 360 CommandArtifact artifact, |
| 369 List<String> arguments, | 361 List<String> arguments, |
| 370 Map<String, String> environmentOverrides) { | 362 Map<String, String> environmentOverrides) { |
| 371 throw "Unimplemented runtime '$runtimeType'"; | 363 throw "Unimplemented runtime '$runtimeType'"; |
| 372 } | 364 } |
| 373 } | 365 } |
| OLD | NEW |