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

Unified Diff: utils/pub/sdk.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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 | « utils/pub/safe_http_server.dart ('k') | utils/pub/sdk/pub » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/sdk.dart
diff --git a/utils/pub/sdk.dart b/utils/pub/sdk.dart
deleted file mode 100644
index b9b50ecca2c7a1c2867fa340f81e734701292897..0000000000000000000000000000000000000000
--- a/utils/pub/sdk.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/// Operations relative to the user's installed Dart SDK.
-library sdk;
-
-import 'dart:io';
-
-import 'package:pathos/path.dart' as path;
-
-import 'io.dart';
-import 'log.dart' as log;
-import 'version.dart';
-
-/// Matches an Eclipse-style SDK version number. This is four dotted numbers
-/// (major, minor, patch, build) with an optional suffix attached to the build
-/// number.
-final _versionPattern = new RegExp(r'^(\d+)\.(\d+)\.(\d+)\.(\d+.*)$');
-
-/// Gets the path to the root directory of the SDK.
-String get rootDirectory {
- // If the environment variable was provided, use it. This is mainly used for
- // the pub tests.
- var dir = Platform.environment["DART_SDK"];
- if (dir != null) {
- log.fine("Using DART_SDK to find SDK at $dir");
- return dir;
- }
-
- var pubDir = path.dirname(new Options().script);
- dir = path.normalize(path.join(pubDir, "../../"));
- log.fine("Located SDK at $dir");
- return dir;
-}
-
-/// Gets the SDK's revision number formatted to be a semantic version.
-Version version = _getVersion();
-
-/// Is `true` if the current SDK is an unreleased bleeding edge version.
-bool get isBleedingEdge {
- // The live build is locked to the magical old number "0.1.2+<stuff>".
- return version.major == 0 && version.minor == 1 && version.patch == 2;
-}
-
-/// Determine the SDK's version number.
-Version _getVersion() {
- var revisionPath = path.join(rootDirectory, "version");
- var version = readTextFile(revisionPath).trim();
-
- // Given a version file like: 0.1.2.0_r17495
- // We create a semver like: 0.1.2+0.r17495
- var match = _versionPattern.firstMatch(version);
- if (match == null) {
- throw new FormatException("The Dart SDK's 'version' file was not in a "
- "format pub could recognize. Found: $version");
- }
-
- // Semantic versions cannot use "_".
- var build = match[4].replaceAll('_', '.');
-
- return new Version(
- int.parse(match[1]), int.parse(match[2]), int.parse(match[3]),
- build: build);
-}
« no previous file with comments | « utils/pub/safe_http_server.dart ('k') | utils/pub/sdk/pub » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698