Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: pkg/docgen/lib/src/io.dart

Issue 1364553002: remove docgen source and targets from build (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: remove scripts Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/docgen/lib/src/generator.dart ('k') | pkg/docgen/lib/src/library_helpers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/io.dart
diff --git a/pkg/docgen/lib/src/io.dart b/pkg/docgen/lib/src/io.dart
deleted file mode 100644
index 65e69e81bb44adca3bf11940bebb40ade452403b..0000000000000000000000000000000000000000
--- a/pkg/docgen/lib/src/io.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This is a helper library to make working with io easier.
-library docgen.io;
-
-// TODO(janicejl): listDir, canonicalize, resolveLink, and linkExists are from
-// pub/lib/src/io.dart. If the io.dart file becomes a package, should remove
-// copy of the functions.
-
-import 'dart:io';
-import 'package:path/path.dart' as path;
-
-/// Lists the contents of [dir].
-///
-/// If [recursive] is `true`, lists subdirectory contents (defaults to `false`).
-///
-/// Excludes files and directories beginning with `.`
-///
-/// The returned paths are guaranteed to begin with [dir].
-List<String> listDir(String dir, {bool recursive: false,
- List<FileSystemEntity> listDir(Directory dir)}) {
- if (listDir == null) listDir = (Directory dir) => dir.listSync();
-
- return _doList(dir, new Set<String>(), recursive, listDir);
-}
-
-List<String> _doList(String dir, Set<String> listedDirectories, bool recurse,
- List<FileSystemEntity> listDir(Directory dir)) {
- var contents = <String>[];
-
- // Avoid recursive symlinks.
- var resolvedPath = new Directory(dir).resolveSymbolicLinksSync();
- if (listedDirectories.contains(resolvedPath)) return [];
-
- listedDirectories = new Set<String>.from(listedDirectories);
- listedDirectories.add(resolvedPath);
-
- var children = <String>[];
- for (var entity in listDir(new Directory(dir))) {
- // Skip hidden files and directories
- if (path.basename(entity.path).startsWith('.')) {
- continue;
- }
-
- contents.add(entity.path);
- if (entity is Directory) {
- // TODO(nweiz): don't manually recurse once issue 4794 is fixed.
- // Note that once we remove the manual recursion, we'll need to
- // explicitly filter out files in hidden directories.
- if (recurse) {
- children.addAll(_doList(entity.path, listedDirectories, recurse,
- listDir));
- }
- }
- }
-
- contents.addAll(children);
- return contents;
-}
« no previous file with comments | « pkg/docgen/lib/src/generator.dart ('k') | pkg/docgen/lib/src/library_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698