@@ -16,7 +16,7 @@ import 'package:analyzer/src/generated/source.dart';
1616import 'package:dartdoc/src/utils.dart' ;
1717import 'package:html/dom.dart' show Element, Document;
1818import 'package:html/parser.dart' show parse;
19- import 'package:path/path.dart' as path ;
19+ import 'package:path/path.dart' as pathLib ;
2020
2121import 'package:tuple/tuple.dart' ;
2222import 'src/config.dart' ;
@@ -38,7 +38,7 @@ const String name = 'dartdoc';
3838// Update when pubspec version changes.
3939const String version = '0.17.1+1' ;
4040
41- final String defaultOutDir = path .join ('doc' , 'api' );
41+ final String defaultOutDir = pathLib .join ('doc' , 'api' );
4242
4343/// Initialize and setup the generators.
4444Future <List <Generator >> initGenerators (String url, String relCanonicalPrefix,
@@ -169,7 +169,7 @@ class DartDoc extends PackageBuilder {
169169
170170 for (var generator in generators) {
171171 await generator.generate (packageGraph, outputDir.path);
172- writtenFiles.addAll (generator.writtenFiles.map (path .normalize));
172+ writtenFiles.addAll (generator.writtenFiles.map (pathLib .normalize));
173173 }
174174 if (config.validateLinks) validateLinks (packageGraph, outputDir.path);
175175 int warnings = packageGraph.packageWarningCounter.warningCount;
@@ -209,12 +209,12 @@ class DartDoc extends PackageBuilder {
209209 Set <Warnable > warnOnElements;
210210
211211 // Make all paths relative to origin.
212- if (path .isWithin (origin, warnOn)) {
213- warnOn = path .relative (warnOn, from: origin);
212+ if (pathLib .isWithin (origin, warnOn)) {
213+ warnOn = pathLib .relative (warnOn, from: origin);
214214 }
215215 if (referredFrom != null ) {
216- if (path .isWithin (origin, referredFrom)) {
217- referredFrom = path .relative (referredFrom, from: origin);
216+ if (pathLib .isWithin (origin, referredFrom)) {
217+ referredFrom = pathLib .relative (referredFrom, from: origin);
218218 }
219219 // Source paths are always relative.
220220 if (_hrefs[referredFrom] != null ) {
@@ -245,13 +245,13 @@ class DartDoc extends PackageBuilder {
245245
246246 void _doOrphanCheck (
247247 PackageGraph packageGraph, String origin, Set <String > visited) {
248- String normalOrigin = path .normalize (origin);
249- String staticAssets = path .joinAll ([normalOrigin, 'static-assets' , '' ]);
250- String indexJson = path .joinAll ([normalOrigin, 'index.json' ]);
248+ String normalOrigin = pathLib .normalize (origin);
249+ String staticAssets = pathLib .joinAll ([normalOrigin, 'static-assets' , '' ]);
250+ String indexJson = pathLib .joinAll ([normalOrigin, 'index.json' ]);
251251 bool foundIndexJson = false ;
252252 for (FileSystemEntity f
253253 in new Directory (normalOrigin).listSync (recursive: true )) {
254- var fullPath = path .normalize (f.path);
254+ var fullPath = pathLib .normalize (f.path);
255255 if (f is Directory ) {
256256 continue ;
257257 }
@@ -304,8 +304,8 @@ class DartDoc extends PackageBuilder {
304304
305305 void _doSearchIndexCheck (
306306 PackageGraph packageGraph, String origin, Set <String > visited) {
307- String fullPath = path .joinAll ([origin, 'index.json' ]);
308- String indexPath = path .joinAll ([origin, 'index.html' ]);
307+ String fullPath = pathLib .joinAll ([origin, 'index.json' ]);
308+ String indexPath = pathLib .joinAll ([origin, 'index.html' ]);
309309 File file = new File ("$fullPath " );
310310 if (! file.existsSync ()) {
311311 return null ;
@@ -320,10 +320,10 @@ class DartDoc extends PackageBuilder {
320320 found.add (indexPath);
321321 for (Map <String , String > entry in jsonData) {
322322 if (entry.containsKey ('href' )) {
323- String entryPath = path .joinAll ([origin, entry['href' ]]);
323+ String entryPath = pathLib .joinAll ([origin, entry['href' ]]);
324324 if (! visited.contains (entryPath)) {
325325 _warn (packageGraph, PackageWarning .brokenLink, entryPath,
326- path .normalize (origin),
326+ pathLib .normalize (origin),
327327 referredFrom: fullPath);
328328 }
329329 found.add (entryPath);
@@ -333,7 +333,7 @@ class DartDoc extends PackageBuilder {
333333 Set <String > missing_from_search = visited.difference (found);
334334 for (String s in missing_from_search) {
335335 _warn (packageGraph, PackageWarning .missingFromSearchIndex, s,
336- path .normalize (origin),
336+ pathLib .normalize (origin),
337337 referredFrom: fullPath);
338338 }
339339 }
@@ -342,14 +342,14 @@ class DartDoc extends PackageBuilder {
342342 String pathToCheck,
343343 [String source, String fullPath]) {
344344 if (fullPath == null ) {
345- fullPath = path .joinAll ([origin, pathToCheck]);
346- fullPath = path .normalize (fullPath);
345+ fullPath = pathLib .joinAll ([origin, pathToCheck]);
346+ fullPath = pathLib .normalize (fullPath);
347347 }
348348
349349 Tuple2 stringLinksAndHref = _getStringLinksAndHref (fullPath);
350350 if (stringLinksAndHref == null ) {
351351 _warn (packageGraph, PackageWarning .brokenLink, pathToCheck,
352- path .normalize (origin),
352+ pathLib .normalize (origin),
353353 referredFrom: source);
354354 _onCheckProgress.add (pathToCheck);
355355 // Remove so that we properly count that the file doesn't exist for
@@ -376,13 +376,13 @@ class DartDoc extends PackageBuilder {
376376 if (uri == null || ! uri.hasAuthority && ! uri.hasFragment) {
377377 var full;
378378 if (baseHref != null ) {
379- full = '${path .dirname (pathToCheck )}/$baseHref /$href ' ;
379+ full = '${pathLib .dirname (pathToCheck )}/$baseHref /$href ' ;
380380 } else {
381- full = '${path .dirname (pathToCheck )}/$href ' ;
381+ full = '${pathLib .dirname (pathToCheck )}/$href ' ;
382382 }
383- var newPathToCheck = path .normalize (full);
384- String newFullPath = path .joinAll ([origin, newPathToCheck]);
385- newFullPath = path .normalize (newFullPath);
383+ var newPathToCheck = pathLib .normalize (full);
384+ String newFullPath = pathLib .joinAll ([origin, newPathToCheck]);
385+ newFullPath = pathLib .normalize (newFullPath);
386386 if (! visited.contains (newFullPath)) {
387387 toVisit.add (new Tuple2 (newPathToCheck, newFullPath));
388388 visited.add (newFullPath);
0 commit comments