Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:front_end/compiler_options.dart'; | 8 import 'package:front_end/compiler_options.dart'; |
| 9 import 'package:front_end/dependency_grapher.dart'; | 9 import 'package:front_end/dependency_grapher.dart'; |
| 10 import 'package:path/path.dart' as pathos; | 10 import 'package:path/path.dart' as pathos; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 final subpackageRules = { | 27 final subpackageRules = { |
| 28 'lib': new SubpackageRules( | 28 'lib': new SubpackageRules( |
| 29 mayImportAnalyzer: true, | 29 mayImportAnalyzer: true, |
| 30 allowedDependencies: ['lib/src', 'lib/src/base']), | 30 allowedDependencies: ['lib/src', 'lib/src/base']), |
| 31 'lib/src': new SubpackageRules( | 31 'lib/src': new SubpackageRules( |
| 32 mayImportAnalyzer: true, | 32 mayImportAnalyzer: true, |
| 33 allowedDependencies: ['lib', 'lib/src/base', 'lib/src/scanner']), | 33 allowedDependencies: ['lib', 'lib/src/base', 'lib/src/scanner']), |
| 34 'lib/src/base': new SubpackageRules( | 34 'lib/src/base': new SubpackageRules( |
| 35 mayImportAnalyzer: true, allowedDependencies: ['lib']), | 35 mayImportAnalyzer: true, allowedDependencies: ['lib']), |
| 36 'lib/src/scanner': new SubpackageRules(allowedDependencies: ['lib/src/base']), | 36 'lib/src/scanner': new SubpackageRules(allowedDependencies: ['lib/src/base']), |
| 37 'lib/src/fasta': new SubpackageRules(mayImportAnalyzer: true), | |
|
ahe
2017/02/01 13:40:37
I should probably move all analyzer dependencies t
Paul Berry
2017/02/01 13:44:38
Do you think, for purposes of the checks done by t
ahe
2017/02/01 13:52:04
Yes, that would be nice.
| |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 /// Rules for what a subpackage may depend directly on. | 40 /// Rules for what a subpackage may depend directly on. |
| 40 class SubpackageRules { | 41 class SubpackageRules { |
| 41 /// Indicates whether the subpackage may directly depend on analyzer. | 42 /// Indicates whether the subpackage may directly depend on analyzer. |
| 42 final bool mayImportAnalyzer; | 43 final bool mayImportAnalyzer; |
| 43 | 44 |
| 44 /// Indicates which other subpackages a given subpackage may directly depend | 45 /// Indicates which other subpackages a given subpackage may directly depend |
| 45 /// on. | 46 /// on. |
| 46 final List<String> allowedDependencies; | 47 final List<String> allowedDependencies; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 /// | 133 /// |
| 133 /// If [src] is not part of the front end, `null` is returned. | 134 /// If [src] is not part of the front end, `null` is returned. |
| 134 String subpackageForUri(Uri src) { | 135 String subpackageForUri(Uri src) { |
| 135 if (src.scheme != 'package') return null; | 136 if (src.scheme != 'package') return null; |
| 136 if (src.pathSegments[0] != 'front_end') return null; | 137 if (src.pathSegments[0] != 'front_end') return null; |
| 137 if (src.pathSegments[1] != 'src') return 'lib'; | 138 if (src.pathSegments[1] != 'src') return 'lib'; |
| 138 if (src.pathSegments.length == 3) return 'lib/src'; | 139 if (src.pathSegments.length == 3) return 'lib/src'; |
| 139 return 'lib/src/${src.pathSegments[2]}'; | 140 return 'lib/src/${src.pathSegments[2]}'; |
| 140 } | 141 } |
| 141 } | 142 } |
| OLD | NEW |