| 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 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:core' hide Resource; | 10 import 'dart:core' hide Resource; |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 * created for them and excluded from the context associated with the | 888 * created for them and excluded from the context associated with the |
| 889 * [folder]. | 889 * [folder]. |
| 890 * | 890 * |
| 891 * If [withPackageSpecOnly] is `true`, a context will be created only if there | 891 * If [withPackageSpecOnly] is `true`, a context will be created only if there |
| 892 * is a 'pubspec.yaml' or '.packages' file in the [folder]. | 892 * is a 'pubspec.yaml' or '.packages' file in the [folder]. |
| 893 * | 893 * |
| 894 * [parent] should be the parent of any contexts that are created. | 894 * [parent] should be the parent of any contexts that are created. |
| 895 */ | 895 */ |
| 896 void _createContexts( | 896 void _createContexts( |
| 897 ContextInfo parent, Folder folder, bool withPackageSpecOnly) { | 897 ContextInfo parent, Folder folder, bool withPackageSpecOnly) { |
| 898 if (folder.shortName.startsWith('.') || folder.shortName == 'packages') { | 898 if (_isExcluded(folder.path) || |
| 899 folder.shortName.startsWith('.') || |
| 900 folder.shortName == 'packages') { |
| 899 return; | 901 return; |
| 900 } | 902 } |
| 901 // Decide whether a context needs to be created for [folder] here, and if | 903 // Decide whether a context needs to be created for [folder] here, and if |
| 902 // so, create it. | 904 // so, create it. |
| 903 File packageSpec = _findPackageSpecFile(folder); | 905 File packageSpec = _findPackageSpecFile(folder); |
| 904 bool createContext = packageSpec.exists || !withPackageSpecOnly; | 906 bool createContext = packageSpec.exists || !withPackageSpecOnly; |
| 905 if (withPackageSpecOnly && | 907 if (withPackageSpecOnly && |
| 906 packageSpec.exists && | 908 packageSpec.exists && |
| 907 parent != null && | 909 parent != null && |
| 908 parent.ignored(packageSpec.path)) { | 910 parent.ignored(packageSpec.path)) { |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 var path = resourceProvider.pathContext.fromUri(uri); | 1445 var path = resourceProvider.pathContext.fromUri(uri); |
| 1444 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; | 1446 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; |
| 1445 } | 1447 } |
| 1446 }); | 1448 }); |
| 1447 return <UriResolver>[new SdkExtUriResolver(packageMap)]; | 1449 return <UriResolver>[new SdkExtUriResolver(packageMap)]; |
| 1448 } else { | 1450 } else { |
| 1449 return const <UriResolver>[]; | 1451 return const <UriResolver>[]; |
| 1450 } | 1452 } |
| 1451 } | 1453 } |
| 1452 } | 1454 } |
| OLD | NEW |