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

Unified Diff: lib/src/util/io.dart

Issue 2184543002: Use the package_resolver package. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 5 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 | « lib/src/util/dart.dart ('k') | lib/src/util/stack_trace_mapper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/util/io.dart
diff --git a/lib/src/util/io.dart b/lib/src/util/io.dart
index 4ede6045862efb5b7121e6b87b4f092d96d6ca34..3f7f13a6736d7d3697d8ac2f3961d29f88bb56b0 100644
--- a/lib/src/util/io.dart
+++ b/lib/src/util/io.dart
@@ -4,13 +4,11 @@
import 'dart:async';
import 'dart:io';
-import 'dart:mirrors';
import 'package:path/path.dart' as p;
import 'package:pub_semver/pub_semver.dart';
import '../backend/operating_system.dart';
-import '../runner/application_exception.dart';
import '../util/stream_queue.dart';
import '../utils.dart';
@@ -52,12 +50,6 @@ final _tempDir = Platform.environment.containsKey("_UNITTEST_TEMP_DIR")
? Platform.environment["_UNITTEST_TEMP_DIR"]
: Directory.systemTemp.path;
-/// The path to the `lib` directory of the `test` package.
-String libDir({String packageRoot}) {
- var pathToIo = libraryPath(#test.util.io, packageRoot: packageRoot);
- return p.dirname(p.dirname(p.dirname(pathToIo)));
-}
-
// TODO(nweiz): Make this check [stdioType] once that works within "pub run".
/// Whether "special" strings such as Unicode characters or color escapes are
/// safe to use.
@@ -124,34 +116,6 @@ void warn(String message, {bool color}) {
stderr.writeln(wordWrap("$header $message\n"));
}
-/// Returns the package root at [root].
-///
-/// If [override] is passed, that's used. If the package root doesn't exist, an
-/// [ApplicationException] is thrown.
-String packageRootFor(String root, [String override]) {
- if (root == null) root = p.current;
- var packageRoot = override == null ? p.join(root, 'packages') : override;
-
- if (!new Directory(packageRoot).existsSync()) {
- throw new ApplicationException(
- "Directory ${p.prettyUri(p.toUri(packageRoot))} does not exist.");
- }
-
- return packageRoot;
-}
-
-/// The library name must be globally unique, or the wrong library path may be
-/// returned.
-String libraryPath(Symbol libraryName, {String packageRoot}) {
- var lib = currentMirrorSystem().findLibrary(libraryName);
- if (lib.uri.scheme != 'package') return p.fromUri(lib.uri);
-
- // TODO(nweiz): is there a way to avoid assuming this is being run next to a
- // packages directory?.
- if (packageRoot == null) packageRoot = p.absolute('packages');
- return p.join(packageRoot, p.fromUri(lib.uri.path));
-}
-
/// Repeatedly finds a probably-unused port on localhost and passes it to
/// [tryPort] until it binds successfully.
///
« no previous file with comments | « lib/src/util/dart.dart ('k') | lib/src/util/stack_trace_mapper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698