document libs from sky_services (#3170)
* document libs from sky_services * scan directory of sky_services for libraries * simplify error message when sky_services directory not found * address review comments
This commit is contained in:
parent
81e18ac11c
commit
5b5c701d84
@ -56,12 +56,33 @@ dependencies:
|
||||
args.add(name.substring(0, name.length - 5));
|
||||
}
|
||||
|
||||
_findSkyServicesLibraryNames().forEach((String libName) {
|
||||
args.add('--include-external');
|
||||
args.add(libName);
|
||||
});
|
||||
|
||||
process = await Process.start('pub', args, workingDirectory: 'dev/docs');
|
||||
_print(process.stdout);
|
||||
_print(process.stderr);
|
||||
exit(await process.exitCode);
|
||||
}
|
||||
|
||||
List<String> _findSkyServicesLibraryNames() {
|
||||
Directory skyServicesLocation = new Directory('bin/cache/pkg/sky_services/lib');
|
||||
if (!skyServicesLocation.existsSync()) {
|
||||
throw 'Did not find sky_services package location in '
|
||||
'${skyServicesLocation.path}.';
|
||||
}
|
||||
return skyServicesLocation.listSync(followLinks: false, recursive: true)
|
||||
.where((FileSystemEntity entity) {
|
||||
return entity is File && entity.path.endsWith('.mojom.dart');
|
||||
}).map((FileSystemEntity entity) {
|
||||
String basename = _entityName(entity.path);
|
||||
basename = basename.substring(0, basename.length-('.dart'.length));
|
||||
return basename.replaceAll('.', '_');
|
||||
});
|
||||
}
|
||||
|
||||
List<String> _findPackageNames() {
|
||||
return _findPackages().map((Directory dir) => _entityName(dir.path)).toList();
|
||||
}
|
||||
@ -76,7 +97,6 @@ List<Directory> _findPackages() {
|
||||
return !nodoc;
|
||||
})
|
||||
.toList();
|
||||
|
||||
}
|
||||
|
||||
List<String> _libraryRefs() sync* {
|
||||
|
Loading…
x
Reference in New Issue
Block a user