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

Unified Diff: sdk/lib/_internal/pub/test/test_pub.dart

Issue 482053002: Precompile dependencies' executables for use with "pub run". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make our SDK version file match the SDK's. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/test/snapshot/upgrades_snapshot_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/test_pub.dart
diff --git a/sdk/lib/_internal/pub/test/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart
index 54e30dec86c62441281e98397e234ab09608f8fc..ff5d9f9db1aebe6e56d5e2059722ce075e36ac57 100644
--- a/sdk/lib/_internal/pub/test/test_pub.dart
+++ b/sdk/lib/_internal/pub/test/test_pub.dart
@@ -255,8 +255,11 @@ Map<String, List<Map>> _servedPackages;
///
/// If [contents] is given, its contents are added to every served
/// package.
+///
+/// If [serveBarback] is true, the repo versions of barback and its dependencies
+/// will be served as well.
void servePackages(List<Map> pubspecs, {bool replace: false,
- Iterable<d.Descriptor> contents}) {
+ Iterable<d.Descriptor> contents, bool serveBarback: false}) {
if (_servedPackages == null || _servedPackageDir == null) {
_servedPackages = <String, List<Map>>{};
_servedApiPackageDir = d.dir('packages', []);
@@ -284,6 +287,28 @@ void servePackages(List<Map> pubspecs, {bool replace: false,
versions.add(pubspec);
}
+ var repoPackages = new Set();
+ if (serveBarback) {
+ _addPackage(name) {
+ if (_servedPackages.containsKey(name)) return;
+ repoPackages.add(name);
+
+ var pubspec = new Map.from(loadYaml(
+ readTextFile(path.join(repoRoot, 'pkg', name, 'pubspec.yaml'))));
+
+ // Remove any SDK constraints since we don't have a valid SDK version
+ // while testing.
+ pubspec.remove('environment');
+
+ _servedPackages[name] = [pubspec];
+ if (pubspec.containsKey('dependencies')) {
+ pubspec['dependencies'].keys.forEach(_addPackage);
+ }
+ }
+
+ _addPackage('barback');
+ }
+
_servedApiPackageDir.contents.clear();
_servedPackageDir.contents.clear();
for (var name in _servedPackages.keys) {
@@ -305,6 +330,14 @@ void servePackages(List<Map> pubspecs, {bool replace: false,
d.dir('versions', _servedPackages[name].map((pubspec) {
var version = pubspec['version'];
+ if (repoPackages.contains(name)) {
+ return d.tar('$version.tar.gz', [
+ d.file('pubspec.yaml', JSON.encode(pubspec)),
+ new d.DirectoryDescriptor.fromFilesystem('lib',
+ path.join(repoRoot, 'pkg', name, 'lib'))
+ ]);
+ }
+
var archiveContents = [
d.file('pubspec.yaml', JSON.encode(pubspec)),
d.libDir(name, '$name $version')
« no previous file with comments | « sdk/lib/_internal/pub/test/snapshot/upgrades_snapshot_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698