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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/transformers_needed_by_transformers.dart

Issue 583853002: Use precompiled dependencies in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/barback/transformers_needed_by_transformers.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/transformers_needed_by_transformers.dart b/sdk/lib/_internal/pub/lib/src/barback/transformers_needed_by_transformers.dart
index c9cfdafc58baf0fafd3573df962fe938dfd4cc48..8a805a79218db212b43f9288571b55ea06f98dea 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/transformers_needed_by_transformers.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/transformers_needed_by_transformers.dart
@@ -26,16 +26,11 @@ import 'transformer_id.dart';
/// The returned graph is transitively closed. That is, if there's an edge from
/// `T1` to `T2` and an edge from `T2` to `T3`, there's also an edge from `T1`
/// to `T2`.
-///
-/// If [packages] is passed, only transformers in those packages will be
-/// inspected.
Map<TransformerId, Set<TransformerId>> computeTransformersNeededByTransformers(
- PackageGraph graph, {Iterable<String> packages}) {
- if (packages == null) packages = graph.packages.keys;
-
+ PackageGraph graph) {
var result = {};
var computer = new _DependencyComputer(graph);
- for (var packageName in ordered(packages)) {
+ for (var packageName in ordered(graph.packages.keys)) {
var package = graph.packages[packageName];
for (var phase in package.pubspec.transformers) {
for (var config in phase) {
@@ -102,7 +97,7 @@ class _DependencyComputer {
'"$packageUri").');
}
- var library = p.join(package.dir, 'lib', p.joinAll(components.skip(1)));
+ var library = package.path('lib', p.joinAll(components.skip(1)));
_loadPackageComputer(packageName);
return _packageComputers[packageName].transformersNeededByLibrary(library);
@@ -241,7 +236,7 @@ class _PackageDependencyComputer {
// set that would be recomputed if [transformersNeededByLibrary]
// were called anew.
_transformersNeededByTransformers[id] =
- transformersNeededByLibrary(id.getFullPath(_package.dir));
+ transformersNeededByLibrary(_package.transformerPath(id));
}
} on CycleException catch (error) {
throw error.prependStep("$packageName is transformed by $id");
@@ -267,7 +262,7 @@ class _PackageDependencyComputer {
}
_transformersNeededByTransformers[id] =
- transformersNeededByLibrary(id.getFullPath(_package.dir));
+ transformersNeededByLibrary(_package.transformerPath(id));
return _transformersNeededByTransformers[id];
}
@@ -353,7 +348,7 @@ class _PackageDependencyComputer {
continue;
}
- path = p.join(_package.dir, 'lib', p.joinAll(components.skip(1)));
+ path = _package.path('lib', p.joinAll(components.skip(1)));
} else if (uri.scheme == '' || uri.scheme == 'file') {
path = p.join(p.dirname(library), p.fromUri(uri));
} else {
@@ -377,7 +372,7 @@ class _PackageDependencyComputer {
/// If [library] is modified by a transformer, this will return `null`.
Set<Uri> _getDirectives(String library) {
var libraryUri = p.toUri(p.normalize(library));
- var relative = p.toUri(p.relative(library, from: _package.dir)).path;
+ var relative = p.toUri(_package.relative(library)).path;
if (_applicableTransformers.any((config) =>
config.canTransform(relative))) {
_directives[libraryUri] = null;

Powered by Google App Engine
This is Rietveld 408576698