Package Skia licenses into a separate file from other third party libraries (flutter/engine#5861)

Fixes https://github.com/flutter/flutter/issues/19776
This commit is contained in:
Jason Simmons
2018-07-25 12:26:24 -07:00
committed by GitHub
parent 90d63afdeb
commit 5c957e1a04

View File

@@ -910,8 +910,17 @@ class RepositoryDirectory extends RepositoryEntry implements LicenseSource {
}
}
}
for (RepositoryDirectory child in virtualSubdirectories) {
_subdirectories.add(child);
_childrenByName[child.name] = child;
}
}
// Override this to add additional child directories that do not represent a
// direct child of this directory's filesystem node.
List<RepositoryDirectory> get virtualSubdirectories => <RepositoryDirectory>[];
bool shouldRecurse(fs.IoNode entry) {
return entry.name != '.cipd' &&
entry.name != '.git' &&
@@ -1913,6 +1922,7 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec
&& entry.name != 'instrumented_libraries' // unused according to chinmay
&& entry.name != 'android_tools' // excluded on advice
&& entry.name != 'googletest' // only used by tests
&& entry.name != 'skia' // treated as a separate component
&& super.shouldRecurse(entry);
}
@@ -1946,8 +1956,6 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec
return new RepositoryLibWebpDirectory(this, entry);
if (entry.name == 'pkg')
return new RepositoryPkgDirectory(this, entry);
if (entry.name == 'skia')
return new RepositorySkiaDirectory(this, entry);
if (entry.name == 'vulkan')
return new RepositoryVulkanDirectory(this, entry);
return super.createSubdirectory(entry);
@@ -2392,6 +2400,15 @@ class RepositoryRoot extends RepositoryDirectory {
return new RepositoryTopazDirectory(this, entry);
return super.createSubdirectory(entry);
}
@override
List<RepositoryDirectory> get virtualSubdirectories {
// Skia is updated more frequently than other third party libraries and
// is therefore represented as a separate top-level component.
fs.Directory thirdPartyNode = io.walk.firstWhere((fs.IoNode node) => node.name == 'third_party');
fs.IoNode skiaNode = thirdPartyNode.walk.firstWhere((fs.IoNode node) => node.name == 'skia');
return <RepositoryDirectory>[new RepositorySkiaDirectory(this, skiaNode)];
}
}