| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 'lib/src/fasta/parser': | 75 'lib/src/fasta/parser': |
| 76 new SubpackageRules(allowSubdirs: true, allowedDependencies: [ | 76 new SubpackageRules(allowSubdirs: true, allowedDependencies: [ |
| 77 'lib/src/fasta', | 77 'lib/src/fasta', |
| 78 'lib/src/fasta/scanner', | 78 'lib/src/fasta/scanner', |
| 79 'lib/src/fasta/util', | 79 'lib/src/fasta/util', |
| 80 ]), | 80 ]), |
| 81 'lib/src/fasta/scanner': | 81 'lib/src/fasta/scanner': |
| 82 new SubpackageRules(allowSubdirs: true, allowedDependencies: [ | 82 new SubpackageRules(allowSubdirs: true, allowedDependencies: [ |
| 83 'lib/src/fasta', | 83 'lib/src/fasta', |
| 84 'lib/src/fasta/parser', | 84 'lib/src/fasta/parser', |
| 85 // fasta scanner produces analyzer scanner tokens |
| 86 'lib/src/scanner', |
| 85 'lib/src/fasta/util', | 87 'lib/src/fasta/util', |
| 86 ]), | 88 ]), |
| 87 'lib/src/fasta/source': new SubpackageRules(allowedDependencies: [ | 89 'lib/src/fasta/source': new SubpackageRules(allowedDependencies: [ |
| 88 'lib/src/fasta', | 90 'lib/src/fasta', |
| 89 'lib/src/fasta/builder', | 91 'lib/src/fasta/builder', |
| 90 'lib/src/fasta/dill', | 92 'lib/src/fasta/dill', |
| 91 'lib/src/fasta/kernel', | 93 'lib/src/fasta/kernel', |
| 92 'lib/src/fasta/parser', | 94 'lib/src/fasta/parser', |
| 93 'lib/src/fasta/scanner', | 95 'lib/src/fasta/scanner', |
| 94 'lib/src/fasta/util', | 96 'lib/src/fasta/util', |
| 95 ]), | 97 ]), |
| 96 'lib/src/fasta/testing': | 98 'lib/src/fasta/testing': |
| 97 new SubpackageRules(mayImportAnalyzer: true, allowedDependencies: [ | 99 new SubpackageRules(mayImportAnalyzer: true, allowedDependencies: [ |
| 98 'lib/src/fasta', | 100 'lib/src/fasta', |
| 99 'lib/src/fasta/dill', | 101 'lib/src/fasta/dill', |
| 100 'lib/src/fasta/kernel', | 102 'lib/src/fasta/kernel', |
| 101 'lib/src/fasta/analyzer', | 103 'lib/src/fasta/analyzer', |
| 102 'lib/src/fasta/scanner', | 104 'lib/src/fasta/scanner', |
| 103 ]), | 105 ]), |
| 104 'lib/src/fasta/util': new SubpackageRules(), | 106 'lib/src/fasta/util': new SubpackageRules(), |
| 105 'lib/src/scanner': new SubpackageRules(allowedDependencies: [ | 107 'lib/src/scanner': new SubpackageRules(allowedDependencies: [ |
| 106 'lib/src/base', | 108 'lib/src/base', |
| 109 // fasta scanner produces analyzer scanner tokens |
| 110 'lib/src/fasta/scanner', |
| 107 ]), | 111 ]), |
| 108 }; | 112 }; |
| 109 | 113 |
| 110 /// Rules for what a subpackage may depend directly on. | 114 /// Rules for what a subpackage may depend directly on. |
| 111 class SubpackageRules { | 115 class SubpackageRules { |
| 112 /// Indicates whether the subpackage may directly depend on analyzer. | 116 /// Indicates whether the subpackage may directly depend on analyzer. |
| 113 final bool mayImportAnalyzer; | 117 final bool mayImportAnalyzer; |
| 114 | 118 |
| 115 /// Indicates whether dart files may exist in subdirectories of this | 119 /// Indicates whether dart files may exist in subdirectories of this |
| 116 /// subpackage. | 120 /// subpackage. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 problem('Uri $src is inside package:front_end but is not in any known ' | 234 problem('Uri $src is inside package:front_end but is not in any known ' |
| 231 'subpackage'); | 235 'subpackage'); |
| 232 } else if (!subpackageRules[subpackage].allowSubdirs && | 236 } else if (!subpackageRules[subpackage].allowSubdirs && |
| 233 pathWithinSubpackage.contains('/')) { | 237 pathWithinSubpackage.contains('/')) { |
| 234 problem('Uri $src is in a subfolder of $subpackage, but that ' | 238 problem('Uri $src is in a subfolder of $subpackage, but that ' |
| 235 'subpackage does not allow dart files in subdirectories.'); | 239 'subpackage does not allow dart files in subdirectories.'); |
| 236 } | 240 } |
| 237 return subpackage; | 241 return subpackage; |
| 238 } | 242 } |
| 239 } | 243 } |
| OLD | NEW |