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

Unified Diff: pkg/polymer/lib/src/build/runner.dart

Issue 372983006: Add file-filter flag to polymer deploy (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 | « pkg/polymer/lib/deploy.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « pkg/polymer/lib/deploy.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698