Commit 5b5c701d authored by Seth Ladd's avatar Seth Ladd

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
parent 81e18ac1
...@@ -56,12 +56,33 @@ dependencies: ...@@ -56,12 +56,33 @@ dependencies:
args.add(name.substring(0, name.length - 5)); 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'); process = await Process.start('pub', args, workingDirectory: 'dev/docs');
_print(process.stdout); _print(process.stdout);
_print(process.stderr); _print(process.stderr);
exit(await process.exitCode); 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() { List<String> _findPackageNames() {
return _findPackages().map((Directory dir) => _entityName(dir.path)).toList(); return _findPackages().map((Directory dir) => _entityName(dir.path)).toList();
} }
...@@ -76,7 +97,6 @@ List<Directory> _findPackages() { ...@@ -76,7 +97,6 @@ List<Directory> _findPackages() {
return !nodoc; return !nodoc;
}) })
.toList(); .toList();
} }
List<String> _libraryRefs() sync* { List<String> _libraryRefs() sync* {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment