Skip to content

Commit 10e16a2

Browse files
authored
Change the --include-external flag to be more selective (#1289)
1 parent 648ad06 commit 10e16a2

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## unreleased
2+
* change the `--include-external` flag to help disambiguate files to
3+
include (#1236)
4+
15
## 0.9.8
26
* support for generic methods.
37
* remove deps on cli_utils and which.

bin/dartdoc.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ ArgParser _createArgsParser() {
193193
parser.addOption('include',
194194
allowMultiple: true, help: 'library names to generate docs for');
195195
parser.addOption('include-external',
196-
allowMultiple: true, help: 'additional (external) libraries to include');
196+
allowMultiple: true,
197+
help: 'additional (external) dart files to include, use "dir/fileName", '
198+
'as in lib/material.dart');
197199
parser.addOption('hosted-url',
198200
help:
199201
'URL where the docs will be hosted (used to generate the sitemap).');

lib/dartdoc.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,13 @@ class DartDoc {
252252
while (result.hasMoreWork) {
253253
result = context.performAnalysisTask();
254254
}
255-
255+
256256
// Use the includeExternals.
257257
for (Source source in context.librarySources) {
258258
LibraryElement library = context.computeLibraryElement(source);
259259
String libraryName = Library.getLibraryName(library);
260-
if (includeExternals.contains(libraryName)) {
260+
var fullPath = source.fullName;
261+
if (includeExternals.any((string) => fullPath.endsWith(string))) {
261262
if (libraries.map(Library.getLibraryName).contains(libraryName)) {
262263
continue;
263264
}

0 commit comments

Comments
 (0)