| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Tracks the shape of the import/export graph and dependencies between files. | 5 /// Tracks the shape of the import/export graph and dependencies between files. |
| 6 library dev_compiler.src.dependency_graph; | 6 library dev_compiler.src.dependency_graph; |
| 7 | 7 |
| 8 import 'dart:collection' show HashSet; | 8 import 'dart:collection' show HashSet; |
| 9 | 9 |
| 10 import 'package:analyzer/analyzer.dart' show parseDirectives; | 10 import 'package:analyzer/analyzer.dart' show parseDirectives; |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 bool _same(Set a, Set b) => a.length == b.length && a.containsAll(b); | 455 bool _same(Set a, Set b) => a.length == b.length && a.containsAll(b); |
| 456 | 456 |
| 457 /// An error message discovered while parsing the dependencies between files. | 457 /// An error message discovered while parsing the dependencies between files. |
| 458 class DependencyGraphError extends MessageWithSpan { | 458 class DependencyGraphError extends MessageWithSpan { |
| 459 const DependencyGraphError(String message, SourceSpan span) | 459 const DependencyGraphError(String message, SourceSpan span) |
| 460 : super(message, Level.SEVERE, span); | 460 : super(message, Level.SEVERE, span); |
| 461 } | 461 } |
| 462 | 462 |
| 463 /// Runtime files added to all applications when running the compiler in the | 463 /// Runtime files added to all applications when running the compiler in the |
| 464 /// command line. | 464 /// command line. |
| 465 const defaultRuntimeFiles = const [ | 465 final defaultRuntimeFiles = () { |
| 466 'harmony_feature_check.js', | 466 var files = ['harmony_feature_check.js', 'dart_runtime.js',]; |
| 467 'dart_runtime.js', | 467 files.addAll(corelibOrder.map((l) => l.replaceAll('.', '/') + '.js')); |
| 468 'dart/core.js', | 468 return files; |
| 469 'dart/collection.js', | 469 }(); |
| 470 'dart/math.js' | 470 |
| 471 /// Curated order to minimize lazy classes needed by dart:core and its |
| 472 /// transitive SDK imports. |
| 473 const corelibOrder = const [ |
| 474 'dart.core', |
| 475 'dart.collection', |
| 476 'dart._internal', |
| 477 'dart.math', |
| 478 'dart._foreign_helper', |
| 479 'dart._js_helper', |
| 480 // TODO(jmesserly): add others |
| 481 /* |
| 482 'dart.async', |
| 483 'dart.convert', |
| 484 'dart.isolate', |
| 485 'dart.typed_data', |
| 486 'dart._foreign_helper', |
| 487 'dart._interceptors', |
| 488 'dart._isolate_helper', |
| 489 'dart._js_embedded_names', |
| 490 'dart._js_names', |
| 491 'dart._js_primitives', |
| 492 'dart._native_typed_data', |
| 493 */ |
| 471 ]; | 494 ]; |
| 472 | 495 |
| 473 /// Runtime files added to applications when running in server mode. | 496 /// Runtime files added to applications when running in server mode. |
| 474 final runtimeFilesForServerMode = new List<String>.from(defaultRuntimeFiles) | 497 final runtimeFilesForServerMode = new List<String>.from(defaultRuntimeFiles) |
| 475 ..addAll(const ['messages_widget.js', 'messages.css']); | 498 ..addAll(const ['messages_widget.js', 'messages.css']); |
| 476 | 499 |
| 477 final _log = new Logger('dev_compiler.dependency_graph'); | 500 final _log = new Logger('dev_compiler.dependency_graph'); |
| OLD | NEW |