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

Side by Side Diff: lib/src/entrypoint.dart

Issue 1272903002: Run "pub run" against the .packages file. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Merge Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | lib/src/executable.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.entrypoint; 5 library pub.entrypoint;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:path/path.dart' as path; 9 import 'package:path/path.dart' as path;
10 import 'package:barback/barback.dart'; 10 import 'package:barback/barback.dart';
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 cache = cache, 69 cache = cache,
70 _packageSymlinks = packageSymlinks; 70 _packageSymlinks = packageSymlinks;
71 71
72 /// Creates an entrypoint given package and lockfile objects. 72 /// Creates an entrypoint given package and lockfile objects.
73 Entrypoint.inMemory(this.root, this._lockFile, this.cache) 73 Entrypoint.inMemory(this.root, this._lockFile, this.cache)
74 : _packageSymlinks = false; 74 : _packageSymlinks = false;
75 75
76 /// The path to the entrypoint's "packages" directory. 76 /// The path to the entrypoint's "packages" directory.
77 String get packagesDir => root.path('packages'); 77 String get packagesDir => root.path('packages');
78 78
79 /// The path to the entrypoint's ".packages" file.
80 String get packagesFile => root.path('.packages');
81
79 /// `true` if the entrypoint package currently has a lock file. 82 /// `true` if the entrypoint package currently has a lock file.
80 bool get lockFileExists => _lockFile != null || entryExists(lockFilePath); 83 bool get lockFileExists => _lockFile != null || entryExists(lockFilePath);
81 84
82 LockFile get lockFile { 85 LockFile get lockFile {
83 if (_lockFile != null) return _lockFile; 86 if (_lockFile != null) return _lockFile;
84 87
85 if (!lockFileExists) { 88 if (!lockFileExists) {
86 _lockFile = new LockFile.empty(); 89 _lockFile = new LockFile.empty();
87 } else { 90 } else {
88 _lockFile = new LockFile.load(lockFilePath, cache.sources); 91 _lockFile = new LockFile.load(lockFilePath, cache.sources);
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 /// If [packageSymlinks] is true, creates a symlink to the "packages" 552 /// If [packageSymlinks] is true, creates a symlink to the "packages"
550 /// directory in [dir]. 553 /// directory in [dir].
551 /// 554 ///
552 /// Otherwise, deletes a "packages" directories in [dir] if one exists. 555 /// Otherwise, deletes a "packages" directories in [dir] if one exists.
553 void _linkOrDeleteSecondaryPackageDir(String dir) { 556 void _linkOrDeleteSecondaryPackageDir(String dir) {
554 var symlink = path.join(dir, 'packages'); 557 var symlink = path.join(dir, 'packages');
555 if (entryExists(symlink)) deleteEntry(symlink); 558 if (entryExists(symlink)) deleteEntry(symlink);
556 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true); 559 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true);
557 } 560 }
558 } 561 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/executable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698