From 71d3babb3f4e348d579b6acdd6b608cbc1f69fed Mon Sep 17 00:00:00 2001 From: "sgjesse@google.com" <sgjesse@google.com> Date: Tue, 25 Jun 2013 12:56:23 +0000 Subject: [PATCH] Move getters from Options to Platform The getters for executable, script and version are now statics on Platform. I kept them on Options for now, but updated most tests to use Platform. R=ajohnsen@google.com, floitsch@google.com, iposva@google.com BUG= Review URL: https://codereview.chromium.org//17406010 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@24401 260f80e4-7a28-3924-810f-c04153c831b5 --- lib/src/io.dart | 2 +- lib/src/sdk.dart | 2 +- test/test_pub.dart | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/io.dart b/lib/src/io.dart index f61f47e5..66477f5e 100644 --- a/lib/src/io.dart +++ b/lib/src/io.dart @@ -368,7 +368,7 @@ void createPackageSymlink(String name, String target, String symlink, /// Whether pub is running from within the Dart SDK, as opposed to from the Dart /// source repository. -bool get runningFromSdk => path.extension(new Options().script) == '.snapshot'; +bool get runningFromSdk => path.extension(Platform.script) == '.snapshot'; /// Resolves [target] relative to the path to pub's `resource` directory. String resourcePath(String target) { diff --git a/lib/src/sdk.dart b/lib/src/sdk.dart index 0fbe5f96..7f4e26a2 100644 --- a/lib/src/sdk.dart +++ b/lib/src/sdk.dart @@ -29,7 +29,7 @@ String get rootDirectory { } // Assume the Dart executable is always coming from the SDK. - return path.dirname(path.dirname(new Options().executable)); + return path.dirname(path.dirname(Platform.executable)); } /// Gets the SDK's revision number formatted to be a semantic version. diff --git a/test/test_pub.dart b/test/test_pub.dart index a5fcd168..c35ab69e 100644 --- a/test/test_pub.dart +++ b/test/test_pub.dart @@ -436,7 +436,7 @@ ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) { // Find a Dart executable we can use to spawn. Use the same one that was // used to run this script itself. - var dartBin = new Options().executable; + var dartBin = Platform.executable; // If the executable looks like a path, get its full path. That way we // can still find it when we spawn it with a different working directory. @@ -555,7 +555,7 @@ class PubProcess extends ScheduledProcess { /// The path to the `packages` directory from which pub loads its dependencies. String get _packageRoot { return path.absolute(path.join( - path.dirname(new Options().executable), '..', '..', 'packages')); + path.dirname(Platform.executable), '..', '..', 'packages')); } /// Skips the current test if Git is not installed. This validates that the -- GitLab