|
|
|
|
@@ -914,7 +914,15 @@ class _RepositoryDirectory extends _RepositoryEntry implements LicenseSource {
|
|
|
|
|
// direct child of this directory's filesystem node.
|
|
|
|
|
List<_RepositoryDirectory> get virtualSubdirectories => <_RepositoryDirectory>[];
|
|
|
|
|
|
|
|
|
|
// TODO(nurhan): soon add e2etests here.
|
|
|
|
|
/// Standard directory names containing files that should be ignored by the
|
|
|
|
|
/// license script.
|
|
|
|
|
///
|
|
|
|
|
/// Do not include repository-level directories here. Instead use one of:
|
|
|
|
|
///
|
|
|
|
|
/// - [_RepositoryFlutterDirectory], to filter specific sub-directories at the
|
|
|
|
|
/// flutter/engine repository level.
|
|
|
|
|
/// - [_EngineSrcDirectory], to filter specific sub-directories under the src/
|
|
|
|
|
/// directory (a.k.a. buildroot).
|
|
|
|
|
bool shouldRecurse(fs.IoNode entry) {
|
|
|
|
|
return !entry.fullName.endsWith('third_party/gn') &&
|
|
|
|
|
entry.name != '.cipd' &&
|
|
|
|
|
@@ -929,9 +937,6 @@ class _RepositoryDirectory extends _RepositoryEntry implements LicenseSource {
|
|
|
|
|
entry.name != 'tests' &&
|
|
|
|
|
entry.name != 'javatests' &&
|
|
|
|
|
entry.name != 'testing' &&
|
|
|
|
|
// The directory that contains end to end tests.
|
|
|
|
|
// Should be excluded from the licence checks.
|
|
|
|
|
entry.name != 'e2etests' &&
|
|
|
|
|
entry.name != '.dart_tool'; // Generated by various Dart tools, such as pub and
|
|
|
|
|
// build_runner. Skip it because it does not contain
|
|
|
|
|
// source code.
|
|
|
|
|
@@ -2111,7 +2116,13 @@ class _RepositoryFlutterDirectory extends _RepositoryDirectory {
|
|
|
|
|
&& entry.name != 'examples'
|
|
|
|
|
&& entry.name != 'build'
|
|
|
|
|
&& entry.name != 'ci'
|
|
|
|
|
&& entry.name != 'frontend_server'
|
|
|
|
|
&& entry.name != 'flutter_frontend_server'
|
|
|
|
|
// The directory that contains end to end tests.
|
|
|
|
|
// Should be excluded from the licence checks.
|
|
|
|
|
&& entry.name != 'e2etests'
|
|
|
|
|
// None of the web_sdk code is linked into Flutter apps. It's only used
|
|
|
|
|
// by engine tests and tools.
|
|
|
|
|
&& entry.name != 'web_sdk'
|
|
|
|
|
&& super.shouldRecurse(entry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2300,8 +2311,16 @@ class _RepositoryFlutterLicenseToolDirectory extends _RepositoryDirectory {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _RepositoryRoot extends _RepositoryDirectory {
|
|
|
|
|
_RepositoryRoot(fs.Directory io) : super(null, io);
|
|
|
|
|
/// The `src/` directory created by gclient sync (a.k.a. buildroot).
|
|
|
|
|
///
|
|
|
|
|
/// This directory is the parent of the flutter/engine repository. The license
|
|
|
|
|
/// crawler begins its search starting from this directory and recurses down
|
|
|
|
|
/// from it.
|
|
|
|
|
///
|
|
|
|
|
/// This is not the root of the flutter/engine repository.
|
|
|
|
|
/// [_RepositoryFlutterDirectory] represents that.
|
|
|
|
|
class _EngineSrcDirectory extends _RepositoryDirectory {
|
|
|
|
|
_EngineSrcDirectory(fs.Directory io) : super(null, io);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String get libraryName {
|
|
|
|
|
@@ -2317,8 +2336,7 @@ class _RepositoryRoot extends _RepositoryDirectory {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool shouldRecurse(fs.IoNode entry) {
|
|
|
|
|
return entry.name != 'testing' // only used by tests
|
|
|
|
|
&& entry.name != 'build' // only used by build
|
|
|
|
|
return entry.name != 'build' // only used by build
|
|
|
|
|
&& entry.name != 'buildtools' // only used by build
|
|
|
|
|
&& entry.name != 'build_overrides' // only used by build
|
|
|
|
|
&& entry.name != 'ios_tools' // only used by build
|
|
|
|
|
@@ -2575,7 +2593,7 @@ Future<void> main(List<String> arguments) async {
|
|
|
|
|
try {
|
|
|
|
|
system.stderr.writeln('Finding files...');
|
|
|
|
|
final fs.FileSystemDirectory rootDirectory = fs.FileSystemDirectory.fromPath(argResults['src']);
|
|
|
|
|
final _RepositoryDirectory root = _RepositoryRoot(rootDirectory);
|
|
|
|
|
final _RepositoryDirectory root = _EngineSrcDirectory(rootDirectory);
|
|
|
|
|
|
|
|
|
|
if (releaseMode) {
|
|
|
|
|
system.stderr.writeln('Collecting licenses...');
|
|
|
|
|
@@ -2623,7 +2641,7 @@ Future<void> main(List<String> arguments) async {
|
|
|
|
|
// For other components, we need a clean repository that does not
|
|
|
|
|
// contain any state left over from previous components.
|
|
|
|
|
clearLicenseRegistry();
|
|
|
|
|
componentRoot = _RepositoryRoot(rootDirectory).subdirectories
|
|
|
|
|
componentRoot = _EngineSrcDirectory(rootDirectory).subdirectories
|
|
|
|
|
.firstWhere((_RepositoryDirectory dir) => dir.name == component.name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|