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

Unified Diff: sdk/lib/_internal/pub/lib/src/entrypoint.dart

Issue 583853002: Use precompiled dependencies in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 3 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
Index: sdk/lib/_internal/pub/lib/src/entrypoint.dart
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index 13aa2f63bd3669a61f6a4908d199f64697e85b4b..4effd166d167e321ef996b72488e28d616f155a2 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -73,7 +73,7 @@ class Entrypoint {
: _packageSymlinks = false;
/// The path to the entrypoint's "packages" directory.
- String get packagesDir => path.join(root.dir, 'packages');
+ String get packagesDir => root.path('packages');
/// `true` if the entrypoint package currently has a lock file.
bool get lockFileExists => _lockFile != null || entryExists(lockFilePath);
@@ -91,10 +91,10 @@ class Entrypoint {
}
/// The path to the entrypoint package's pubspec.
- String get pubspecPath => path.join(root.dir, 'pubspec.yaml');
+ String get pubspecPath => root.path('pubspec.yaml');
/// The path to the entrypoint package's lockfile.
- String get lockFilePath => path.join(root.dir, 'pubspec.lock');
+ String get lockFilePath => root.path('pubspec.lock');
/// Gets all dependencies of the [root] package.
///
@@ -190,6 +190,10 @@ class Entrypoint {
unionAll(dependenciesToPrecompile.map(graph.transitiveDependencies))
.map((package) => package.name).toSet();
+ for (var package in dependenciesToPrecompile) {
+ deleteEntry(path.join(depsDir, package));
+ }
+
var environment = await AssetEnvironment.create(this, BarbackMode.DEBUG,
packages: packagesToLoad, useDart2JS: false);
@@ -197,10 +201,6 @@ class Entrypoint {
/// below.
environment.barback.errors.listen((_) {});
- for (var package in dependenciesToPrecompile) {
- cleanDir(path.join(depsDir, package));
- }
-
// TODO(nweiz): only get assets from [dependenciesToPrecompile] so as not
// to trigger unnecessary lazy transformers.
var assets = await environment.barback.getAllAssets();
@@ -292,7 +292,7 @@ class Entrypoint {
List<AssetId> _executablesForPackage(PackageGraph graph, String packageName,
Set<String> changed) {
var package = graph.packages[packageName];
- var binDir = path.join(package.dir, 'bin');
+ var binDir = package.path('bin');
if (!dirExists(binDir)) return [];
if (graph.isPackageMutable(packageName)) return [];
@@ -466,7 +466,7 @@ class Entrypoint {
/// Saves a list of concrete package versions to the `pubspec.lock` file.
void _saveLockFile(List<PackageId> packageIds) {
_lockFile = new LockFile(packageIds);
- var lockFilePath = path.join(root.dir, 'pubspec.lock');
+ var lockFilePath = root.path('pubspec.lock');
writeTextFile(lockFilePath, _lockFile.serialize(root.dir, cache.sources));
}
@@ -489,12 +489,12 @@ class Entrypoint {
void _linkOrDeleteSecondaryPackageDirs() {
// Only the main "bin" directory gets a "packages" directory, not its
// subdirectories.
- var binDir = path.join(root.dir, 'bin');
+ var binDir = root.path('bin');
if (dirExists(binDir)) _linkOrDeleteSecondaryPackageDir(binDir);
// The others get "packages" directories in subdirectories too.
for (var dir in ['benchmark', 'example', 'test', 'tool', 'web']) {
- _linkOrDeleteSecondaryPackageDirsRecursively(path.join(root.dir, dir));
+ _linkOrDeleteSecondaryPackageDirsRecursively(root.path(dir));
}
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/list_package_dirs.dart ('k') | sdk/lib/_internal/pub/lib/src/global_packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698