OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:barback/barback.dart'; | 7 import 'package:barback/barback.dart'; |
8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 for (var package in listDir(sandboxDir)) { | 89 for (var package in listDir(sandboxDir)) { |
90 if (!fileExists(p.join(package, 'pubspec.yaml'))) continue; | 90 if (!fileExists(p.join(package, 'pubspec.yaml'))) continue; |
91 var packageName = p.basename(package); | 91 var packageName = p.basename(package); |
92 packages[packageName] = | 92 packages[packageName] = |
93 new Package.load(packageName, package, systemCache.sources); | 93 new Package.load(packageName, package, systemCache.sources); |
94 } | 94 } |
95 | 95 |
96 loadPackage(packageName) { | 96 loadPackage(packageName) { |
97 if (packages.containsKey(packageName)) return; | 97 if (packages.containsKey(packageName)) return; |
98 packages[packageName] = new Package.load( | 98 packages[packageName] = |
99 packageName, | 99 new Package.load(packageName, packagePath(packageName), systemCache.sour
ces); |
100 p.join(pkgPath, packageName), | |
101 systemCache.sources); | |
102 for (var dep in packages[packageName].dependencies) { | 100 for (var dep in packages[packageName].dependencies) { |
103 loadPackage(dep.name); | 101 loadPackage(dep.name); |
104 } | 102 } |
105 } | 103 } |
106 | 104 |
107 loadPackage('barback'); | 105 loadPackage('barback'); |
108 | 106 |
109 return new PackageGraph(entrypoint, null, packages); | 107 return new PackageGraph(entrypoint, null, packages); |
110 } | 108 } |
111 | 109 |
(...skipping 10 matching lines...) Expand all Loading... |
122 | 120 |
123 buffer.writeln(""" | 121 buffer.writeln(""" |
124 NoOpTransformer extends Transformer { | 122 NoOpTransformer extends Transformer { |
125 bool isPrimary(AssetId id) => true; | 123 bool isPrimary(AssetId id) => true; |
126 void apply(Transform transform) {} | 124 void apply(Transform transform) {} |
127 } | 125 } |
128 """); | 126 """); |
129 | 127 |
130 return buffer.toString(); | 128 return buffer.toString(); |
131 } | 129 } |
OLD | NEW |