@@ -226,11 +226,9 @@ class PubPackageBuilder implements PackageBuilder {
226
226
/// [addingSpecials] indicates that only [SpecialClass] es are being resolved
227
227
/// in this round.
228
228
Future <void > _discoverLibraries (
229
- void Function (DartDocResolvedLibrary ) addLibrary,
230
- Set <LibraryElement > processedLibraries,
231
- Set <String > files, {
232
- bool addingSpecials = false ,
233
- }) async {
229
+ void Function (DartDocResolvedLibrary ) addLibrary,
230
+ Set <LibraryElement > processedLibraries,
231
+ Set <String > files) async {
234
232
files = {...files};
235
233
// Discover Dart libraries in a loop. In each iteration of the loop, we take
236
234
// a set of files (starting with the ones passed into the function), resolve
@@ -251,17 +249,15 @@ class PubPackageBuilder implements PackageBuilder {
251
249
// find all documentable files in that package, for the universal reference
252
250
// scope. This variable tracks which packages we've seen so far.
253
251
var knownPackages = < PackageMeta > {};
254
- if (! addingSpecials) {
255
- progressBarStart (files.length);
256
- }
252
+ progressBarStart (files.length);
253
+
257
254
// The set of files that are discovered while iterating in the below
258
255
// do-while loop, which are then added to `files`, as they are found.
259
256
var newFiles = < String > {};
260
257
do {
261
258
filesInLastPass = filesInCurrentPass;
262
- if (! addingSpecials) {
263
- progressBarUpdateTickCount (files.length);
264
- }
259
+ progressBarUpdateTickCount (files.length);
260
+
265
261
// Be careful here, not to accidentally stack up multiple
266
262
// [DartDocResolvedLibrary]s, as those eat our heap.
267
263
var libraryFiles = files.difference (_knownParts);
@@ -271,9 +267,8 @@ class PubPackageBuilder implements PackageBuilder {
271
267
continue ;
272
268
}
273
269
processedFiles.add (file);
274
- if (! addingSpecials) {
275
- progressBarTick ();
276
- }
270
+ progressBarTick ();
271
+
277
272
var resolvedLibrary = await _resolveLibrary (file);
278
273
if (resolvedLibrary == null ) {
279
274
// `file` did not resolve to a _library_; could be a part, an
@@ -292,41 +287,35 @@ class PubPackageBuilder implements PackageBuilder {
292
287
processedLibraries.add (resolvedLibrary.element);
293
288
}
294
289
files.addAll (newFiles);
295
- if (! addingSpecials) {
296
- var externals = _includedExternalsFrom (newFiles);
297
- if (externals.isNotEmpty) {
298
- includeExternalsWasSpecified = true ;
299
- }
300
- files.addAll (externals);
290
+ var externals = _includedExternalsFrom (newFiles);
291
+ if (externals.isNotEmpty) {
292
+ includeExternalsWasSpecified = true ;
301
293
}
294
+ files.addAll (externals);
302
295
303
296
var packages = _packageMetasForFiles (files.difference (_knownParts));
304
297
filesInCurrentPass = {...files.difference (_knownParts)};
305
298
306
- if (! addingSpecials) {
307
- // To get canonicalization correct for non-locally documented packages
308
- // (so we can generate the right hyperlinks), it's vital that we add all
309
- // libraries in dependent packages. So if the analyzer discovers some
310
- // files in a package we haven't seen yet, add files for that package.
311
- for (var meta in packages.difference (knownPackages)) {
312
- if (meta.isSdk) {
313
- if (! _skipUnreachableSdkLibraries) {
314
- files.addAll (_sdkFilesToDocument);
315
- }
316
- } else {
317
- files.addAll (await _findFilesToDocumentInPackage (
318
- meta.dir.path,
319
- includeDependencies: false ,
320
- filterExcludes: false ,
321
- ).toList ());
299
+ // To get canonicalization correct for non-locally documented packages
300
+ // (so we can generate the right hyperlinks), it's vital that we add all
301
+ // libraries in dependent packages. So if the analyzer discovers some
302
+ // files in a package we haven't seen yet, add files for that package.
303
+ for (var meta in packages.difference (knownPackages)) {
304
+ if (meta.isSdk) {
305
+ if (! _skipUnreachableSdkLibraries) {
306
+ files.addAll (_sdkFilesToDocument);
322
307
}
308
+ } else {
309
+ files.addAll (await _findFilesToDocumentInPackage (
310
+ meta.dir.path,
311
+ includeDependencies: false ,
312
+ filterExcludes: false ,
313
+ ).toList ());
323
314
}
324
- knownPackages.addAll (packages);
325
315
}
316
+ knownPackages.addAll (packages);
326
317
} while (! filesInLastPass.containsAll (filesInCurrentPass));
327
- if (! addingSpecials) {
328
- progressBarComplete ();
329
- }
318
+ progressBarComplete ();
330
319
}
331
320
332
321
/// Returns all top level library files in the 'lib/' directory of the given
0 commit comments