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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 'lib/src/fasta/parser', | 128 'lib/src/fasta/parser', |
129 'lib/src/fasta/source', | 129 'lib/src/fasta/source', |
130 ]), | 130 ]), |
131 'lib/src/scanner': new SubpackageRules(allowedDependencies: [ | 131 'lib/src/scanner': new SubpackageRules(allowedDependencies: [ |
132 'lib/src/base', | 132 'lib/src/base', |
133 // For error codes. | 133 // For error codes. |
134 'lib/src/fasta', | 134 'lib/src/fasta', |
135 // fasta scanner produces analyzer scanner tokens | 135 // fasta scanner produces analyzer scanner tokens |
136 'lib/src/fasta/scanner', | 136 'lib/src/fasta/scanner', |
137 ]), | 137 ]), |
| 138 'lib/src/testing': new SubpackageRules(allowedDependencies: [ |
| 139 'lib', |
| 140 ]), |
| 141 'lib/src/vm': new SubpackageRules(allowedDependencies: []), |
138 }; | 142 }; |
139 | 143 |
140 /// Rules for what a subpackage may depend directly on. | 144 /// Rules for what a subpackage may depend directly on. |
141 class SubpackageRules { | 145 class SubpackageRules { |
142 /// Indicates whether the subpackage may directly depend on analyzer. | 146 /// Indicates whether the subpackage may directly depend on analyzer. |
143 final bool mayImportAnalyzer; | 147 final bool mayImportAnalyzer; |
144 | 148 |
145 /// Indicates whether dart files may exist in subdirectories of this | 149 /// Indicates whether dart files may exist in subdirectories of this |
146 /// subpackage. | 150 /// subpackage. |
147 /// | 151 /// |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 if (subpackageRules[subpackage].allowSubdirs) { | 297 if (subpackageRules[subpackage].allowSubdirs) { |
294 subpackageRules[subpackage].actuallyHasSubdirs = true; | 298 subpackageRules[subpackage].actuallyHasSubdirs = true; |
295 } else { | 299 } else { |
296 problem('Uri $src is in a subfolder of $subpackage, but that ' | 300 problem('Uri $src is in a subfolder of $subpackage, but that ' |
297 'subpackage does not allow dart files in subdirectories.'); | 301 'subpackage does not allow dart files in subdirectories.'); |
298 } | 302 } |
299 } | 303 } |
300 return subpackage; | 304 return subpackage; |
301 } | 305 } |
302 } | 306 } |
OLD | NEW |