Skip to content

Don’t include lib/src files in package analysis #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions lib/src/library_analyzer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,18 @@ class LibraryScanner {
String package, String packageDir) async {
Map<String, List<String>> results = new SplayTreeMap();
List<String> dartFiles = await listFiles(packageDir, endsWith: '.dart');
List<String> mainFiles = dartFiles
.where((path) => path.startsWith('lib/') || path.startsWith('bin/'))
.toList();
List<String> mainFiles = dartFiles.where((path) {
if (p.isWithin('bin', path)) {
return true;
}

// Include all Dart files in lib – except for implementation files.
if (p.isWithin('lib', path) && !p.isWithin('lib/src', path)) {
return true;
}

return false;
}).toList();
for (String relativePath in mainFiles) {
String uri = _toUri(package, relativePath);
if (!_cachedLibs.containsKey(uri)) {
Expand Down