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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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] = new Package.load( | 92 packages[packageName] = new Package.load( |
93 packageName, package, systemCache.sources); | 93 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] = new Package.load( |
99 packageName, p.join(pkgPath, packageName), systemCache.sources); | 99 packageName, packagePath(packageName), systemCache.sources); |
100 for (var dep in packages[packageName].dependencies) { | 100 for (var dep in packages[packageName].dependencies) { |
101 loadPackage(dep.name); | 101 loadPackage(dep.name); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 loadPackage('barback'); | 105 loadPackage('barback'); |
106 | 106 |
107 return new PackageGraph(entrypoint, null, packages); | 107 return new PackageGraph(entrypoint, null, packages); |
108 } | 108 } |
109 | 109 |
(...skipping 10 matching lines...) Expand all Loading... |
120 | 120 |
121 buffer.writeln(""" | 121 buffer.writeln(""" |
122 NoOpTransformer extends Transformer { | 122 NoOpTransformer extends Transformer { |
123 bool isPrimary(AssetId id) => true; | 123 bool isPrimary(AssetId id) => true; |
124 void apply(Transform transform) {} | 124 void apply(Transform transform) {} |
125 } | 125 } |
126 """); | 126 """); |
127 | 127 |
128 return buffer.toString(); | 128 return buffer.toString(); |
129 } | 129 } |
OLD | NEW |