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

Unified Diff: utils/pub/sdk_source.dart

Issue 12790006: Remove support for SDK dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | utils/pub/system_cache.dart » ('j') | utils/pub/validator/dependency.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/sdk_source.dart
diff --git a/utils/pub/sdk_source.dart b/utils/pub/sdk_source.dart
deleted file mode 100644
index c02a172814089fc81805f3a18a74b268246fd5fa..0000000000000000000000000000000000000000
--- a/utils/pub/sdk_source.dart
+++ /dev/null
@@ -1,54 +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.
-
-library sdk_source;
-
-import 'dart:async';
-
-import '../../pkg/pathos/lib/path.dart' as path;
-
-import 'io.dart';
-import 'package.dart';
-import 'pubspec.dart';
-import 'sdk.dart' as sdk;
-import 'source.dart';
-import 'utils.dart';
-import 'version.dart';
-
-/// A package source that uses libraries from the Dart SDK.
-class SdkSource extends Source {
- final String name = "sdk";
- final bool shouldCache = false;
-
- /// SDK packages are not individually versioned. Instead, their version is
- /// inferred from the revision number of the SDK itself.
- Future<Pubspec> describe(PackageId id) {
- return defer(() {
- var packageDir = _getPackagePath(id);
- // TODO(rnystrom): What if packageDir is null?
- var pubspec = new Pubspec.load(id.name, packageDir, systemCache.sources);
- // Ignore the pubspec's version, and use the SDK's.
- return new Pubspec(id.name, sdk.version, pubspec.dependencies,
- pubspec.devDependencies, pubspec.environment);
- });
- }
-
- /// Since all the SDK files are already available locally, installation just
- /// involves symlinking the SDK library into the packages directory.
- Future<bool> install(PackageId id, String destPath) {
- return defer(() {
- var path = _getPackagePath(id);
- if (path == null) return false;
-
- return createPackageSymlink(id.name, path, destPath).then((_) => true);
- });
- }
-
- /// Gets the path in the SDK's "pkg" directory to the directory containing
- /// package [id]. Returns `null` if the package could not be found.
- String _getPackagePath(PackageId id) {
- var pkgPath = path.join(sdk.rootDirectory, "pkg", id.description);
- return dirExists(pkgPath) ? pkgPath : null;
- }
-}
« no previous file with comments | « no previous file | utils/pub/system_cache.dart » ('j') | utils/pub/validator/dependency.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698