Skip to content

Commit

Permalink
Exclude lib/txt/third_party/fonts from the license source tree traver…
Browse files Browse the repository at this point in the history
…sal (flutter#3960)
  • Loading branch information
jason-simmons authored Aug 7, 2017
1 parent c826f83 commit 50b2951
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tools/licenses/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,33 @@ class RepositoryRootLibDirectory extends RepositoryDirectory {

@override
bool get subdirectoriesAreLicenseRoots => true;

@override
RepositoryDirectory createSubdirectory(fs.Directory entry) {
if (entry.name == 'txt')
return new RepositoryLibTxtDirectory(this, entry);
return super.createSubdirectory(entry);
}
}

class RepositoryLibTxtDirectory extends RepositoryDirectory {
RepositoryLibTxtDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io);

@override
RepositoryDirectory createSubdirectory(fs.Directory entry) {
if (entry.name == 'third_party')
return new RepositoryLibTxtThirdPartyDirectory(this, entry);
return super.createSubdirectory(entry);
}
}

class RepositoryLibTxtThirdPartyDirectory extends RepositoryDirectory {
RepositoryLibTxtThirdPartyDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io);

@override
bool shouldRecurse(fs.IoNode entry) {
return entry.name != 'fonts';
}
}

class RepositoryFlutterDirectory extends RepositoryDirectory {
Expand Down

0 comments on commit 50b2951

Please sign in to comment.