Chromium Code Reviews| 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 context.directory.manager; | 5 library context.directory.manager; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 } | 276 } |
| 277 _addPreviouslyExcludedSources(info, changeSet, child, oldExcludedPaths); | 277 _addPreviouslyExcludedSources(info, changeSet, child, oldExcludedPaths); |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * Resursively adds all Dart and HTML files to the [changeSet]. | 283 * Resursively adds all Dart and HTML files to the [changeSet]. |
| 284 */ | 284 */ |
| 285 void _addSourceFiles(ChangeSet changeSet, Folder folder, _ContextInfo info) { | 285 void _addSourceFiles(ChangeSet changeSet, Folder folder, _ContextInfo info) { |
| 286 if (info.excludesResource(folder)) { | 286 if (info.excludesResource(folder) || folder.shortName.startsWith('\.')) { |
|
Paul Berry
2015/02/04 18:39:52
Nit: remove the backslash, since it has no effect.
Brian Wilkerson
2015/02/04 21:26:19
Done
| |
| 287 return; | 287 return; |
| 288 } | 288 } |
| 289 List<Resource> children = folder.getChildren(); | 289 List<Resource> children = folder.getChildren(); |
| 290 for (Resource child in children) { | 290 for (Resource child in children) { |
| 291 String path = child.path; | 291 String path = child.path; |
| 292 // ignore excluded files or folders | 292 // ignore excluded files or folders |
| 293 if (_isExcluded(path)) { | 293 if (_isExcluded(path)) { |
| 294 continue; | 294 continue; |
| 295 } | 295 } |
| 296 // add files, recurse into folders | 296 // add files, recurse into folders |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 655 /** | 655 /** |
| 656 * Returns `true` if [path] is excluded, as it is in one of the children. | 656 * Returns `true` if [path] is excluded, as it is in one of the children. |
| 657 */ | 657 */ |
| 658 bool excludes(String path) { | 658 bool excludes(String path) { |
| 659 return children.any((child) { | 659 return children.any((child) { |
| 660 return child.folder.contains(path); | 660 return child.folder.contains(path); |
| 661 }); | 661 }); |
| 662 } | 662 } |
| 663 | 663 |
| 664 /** | 664 /** |
| 665 * Returns `true` if [resource] is excldued, as it is in one of the children. | 665 * Returns `true` if [resource] is excluded, as it is in one of the children. |
| 666 */ | 666 */ |
| 667 bool excludesResource(Resource resource) { | 667 bool excludesResource(Resource resource) { |
| 668 return excludes(resource.path); | 668 return excludes(resource.path); |
| 669 } | 669 } |
| 670 | 670 |
| 671 /** | 671 /** |
| 672 * Returns `true` if [path] is the pubspec file of this context. | 672 * Returns `true` if [path] is the pubspec file of this context. |
| 673 */ | 673 */ |
| 674 bool isPubspec(String path) { | 674 bool isPubspec(String path) { |
| 675 return path == pubspecPath; | 675 return path == pubspecPath; |
| 676 } | 676 } |
| 677 } | 677 } |
| OLD | NEW |