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 compiler_configuration; | 5 library compiler_configuration; |
6 | 6 |
7 import 'dart:io' show Platform; | 7 import 'dart:io' show Platform; |
8 | 8 |
9 import 'runtime_configuration.dart' show RuntimeConfiguration; | 9 import 'runtime_configuration.dart' show RuntimeConfiguration; |
10 | 10 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 | 298 |
299 List<String> extractArguments(List<String> globalArguments, | 299 List<String> extractArguments(List<String> globalArguments, |
300 String previousOutput) { | 300 String previousOutput) { |
301 return _argumentsFunction(globalArguments, previousOutput); | 301 return _argumentsFunction(globalArguments, previousOutput); |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 class ComposedCompilerConfiguration extends CompilerConfiguration { | 305 class ComposedCompilerConfiguration extends CompilerConfiguration { |
306 final List<PipelineCommand> pipelineCommands; | 306 final List<PipelineCommand> pipelineCommands; |
| 307 final bool isPrecompiler; |
307 | 308 |
308 ComposedCompilerConfiguration(this.pipelineCommands) | 309 ComposedCompilerConfiguration(this.pipelineCommands, {this.isPrecompiler: fals
e}) |
309 : super._subclass(); | 310 : super._subclass(); |
310 | 311 |
311 CommandArtifact computeCompilationArtifact( | 312 CommandArtifact computeCompilationArtifact( |
312 String buildDir, | 313 String buildDir, |
313 String tempDir, | 314 String tempDir, |
314 CommandBuilder commandBuilder, | 315 CommandBuilder commandBuilder, |
315 List globalArguments, | 316 List globalArguments, |
316 Map<String, String> environmentOverrides) { | 317 Map<String, String> environmentOverrides) { |
317 | 318 |
318 List<Command> allCommands = []; | 319 List<Command> allCommands = []; |
(...skipping 28 matching lines...) Expand all Loading... |
347 } | 348 } |
348 | 349 |
349 List<String> computeRuntimeArguments( | 350 List<String> computeRuntimeArguments( |
350 RuntimeConfiguration runtimeConfiguration, | 351 RuntimeConfiguration runtimeConfiguration, |
351 String buildDir, | 352 String buildDir, |
352 TestInformation info, | 353 TestInformation info, |
353 List<String> vmOptions, | 354 List<String> vmOptions, |
354 List<String> sharedOptions, | 355 List<String> sharedOptions, |
355 List<String> originalArguments, | 356 List<String> originalArguments, |
356 CommandArtifact artifact) { | 357 CommandArtifact artifact) { |
357 return <String>[artifact.filename]; | 358 final String suffix = isPrecompiler ? "/out.aotsnapshot" : ""; |
| 359 return <String>["${artifact.filename}${suffix}"]; |
358 } | 360 } |
359 | 361 |
360 static ComposedCompilerConfiguration createDartKPConfiguration( | 362 static ComposedCompilerConfiguration createDartKPConfiguration( |
361 {bool isHostChecked, String arch, bool useBlobs, bool isAndroid, | 363 {bool isHostChecked, String arch, bool useBlobs, bool isAndroid, |
362 bool useSdk}) { | 364 bool useSdk}) { |
363 var nested = []; | 365 var nested = []; |
364 | 366 |
365 // Compile with dartk. | 367 // Compile with dartk. |
366 nested.add(new PipelineCommand.runWithGlobalArguments( | 368 nested.add(new PipelineCommand.runWithGlobalArguments( |
367 new DartKCompilerConfiguration(isHostChecked: isHostChecked, | 369 new DartKCompilerConfiguration(isHostChecked: isHostChecked, |
368 useSdk: useSdk))); | 370 useSdk: useSdk))); |
369 | 371 |
370 // Run the normal precompiler. | 372 // Run the normal precompiler. |
371 nested.add(new PipelineCommand.runWithPreviousKernelOutput( | 373 nested.add(new PipelineCommand.runWithPreviousKernelOutput( |
372 new PrecompilerCompilerConfiguration( | 374 new PrecompilerCompilerConfiguration( |
373 arch: arch, useBlobs: useBlobs, isAndroid: isAndroid))); | 375 arch: arch, useBlobs: useBlobs, isAndroid: isAndroid))); |
374 | 376 |
375 return new ComposedCompilerConfiguration(nested); | 377 return new ComposedCompilerConfiguration(nested, isPrecompiler: true); |
376 } | 378 } |
377 | 379 |
378 static ComposedCompilerConfiguration createDartKConfiguration( | 380 static ComposedCompilerConfiguration createDartKConfiguration( |
379 {bool isHostChecked, bool useSdk}) { | 381 {bool isHostChecked, bool useSdk}) { |
380 var nested = []; | 382 var nested = []; |
381 | 383 |
382 // Compile with dartk. | 384 // Compile with dartk. |
383 nested.add(new PipelineCommand.runWithGlobalArguments( | 385 nested.add(new PipelineCommand.runWithGlobalArguments( |
384 new DartKCompilerConfiguration(isHostChecked: isHostChecked, | 386 new DartKCompilerConfiguration(isHostChecked: isHostChecked, |
385 useSdk: useSdk))); | 387 useSdk: useSdk))); |
386 | 388 |
387 return new ComposedCompilerConfiguration(nested); | 389 return new ComposedCompilerConfiguration(nested, isPrecompiler: false); |
388 } | 390 } |
389 } | 391 } |
390 | 392 |
391 /// Common configuration for dart2js-based tools, such as, dart2js | 393 /// Common configuration for dart2js-based tools, such as, dart2js |
392 class Dart2xCompilerConfiguration extends CompilerConfiguration { | 394 class Dart2xCompilerConfiguration extends CompilerConfiguration { |
393 final String moniker; | 395 final String moniker; |
394 static Map<String, List<Uri>> _bootstrapDependenciesCache = | 396 static Map<String, List<Uri>> _bootstrapDependenciesCache = |
395 new Map<String, List<Uri>>(); | 397 new Map<String, List<Uri>>(); |
396 | 398 |
397 Dart2xCompilerConfiguration(this.moniker, | 399 Dart2xCompilerConfiguration(this.moniker, |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 RuntimeConfiguration runtimeConfiguration, | 830 RuntimeConfiguration runtimeConfiguration, |
829 String buildDir, | 831 String buildDir, |
830 TestInformation info, | 832 TestInformation info, |
831 List<String> vmOptions, | 833 List<String> vmOptions, |
832 List<String> sharedOptions, | 834 List<String> sharedOptions, |
833 List<String> originalArguments, | 835 List<String> originalArguments, |
834 CommandArtifact artifact) { | 836 CommandArtifact artifact) { |
835 return <String>[]; | 837 return <String>[]; |
836 } | 838 } |
837 } | 839 } |
OLD | NEW |