| Index: pkg/polymer/lib/src/build/runner.dart
|
| ===================================================================
|
| --- pkg/polymer/lib/src/build/runner.dart (revision 38021)
|
| +++ pkg/polymer/lib/src/build/runner.dart (working copy)
|
| @@ -38,6 +38,10 @@
|
| /// Directory where to generate code, if any.
|
| final String outDir;
|
|
|
| + /// Disregard files that match these filters when copying in non
|
| + /// transformed files
|
| + List<String> fileFilter;
|
| +
|
| /// Whether to print error messages using a json-format that tools, such as
|
| /// the Dart Editor, can process.
|
| final bool machineFormat;
|
| @@ -54,7 +58,8 @@
|
| BarbackOptions(this.phases, this.outDir, {currentPackage, String packageHome,
|
| packageDirs, this.transformTests: false, this.machineFormat: false,
|
| this.followLinks: false,
|
| - this.packagePhases: const {}})
|
| + this.packagePhases: const {},
|
| + this.fileFilter: const []})
|
| : currentPackage = (currentPackage != null
|
| ? currentPackage : readCurrentPackageFromPubspec()),
|
| packageHome = packageHome,
|
| @@ -122,6 +127,10 @@
|
| return map;
|
| }
|
|
|
| +bool shouldSkip(List<String> filters, String path) {
|
| + return filters.any((filter) => path.contains(filter));
|
| +}
|
| +
|
| /// Return the relative path of each file under [subDir] in [package].
|
| Iterable<String> _listPackageDir(String package, String subDir,
|
| BarbackOptions options) {
|
| @@ -131,6 +140,7 @@
|
| if (!dir.existsSync()) return const [];
|
| return dir.listSync(recursive: true, followLinks: options.followLinks)
|
| .where((f) => f is File)
|
| + .where((f) => !shouldSkip(options.fileFilter, f.path))
|
| .map((f) => path.relative(f.path, from: packageDir));
|
| }
|
|
|
| @@ -287,7 +297,6 @@
|
|
|
| // Copy all the files we didn't process
|
| var dirs = options.packageDirs;
|
| -
|
| return Future.forEach(dirs.keys, (package) {
|
| return Future.forEach(_listPackageDir(package, 'lib', options), (relpath) {
|
| var inpath = path.join(dirs[package], relpath);
|
|
|