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

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

Issue 531943002: delete debug only files from output in release mode (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 6 years, 3 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/CHANGELOG.md ('k') | pkg/polymer/lib/src/build/delete_file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/build_filter.dart
diff --git a/pkg/polymer/lib/src/build/build_filter.dart b/pkg/polymer/lib/src/build/build_filter.dart
index 4b50fe1caf86e83941a2fb619e88046ba675c586..8b7d56f8cadf628284f8b70132de106fee442d91 100644
--- a/pkg/polymer/lib/src/build/build_filter.dart
+++ b/pkg/polymer/lib/src/build/build_filter.dart
@@ -17,25 +17,22 @@ class BuildFilter extends Transformer with PolymerTransformer {
final TransformOptions options;
BuildFilter(this.options);
- // TODO(nweiz): This should just take an AssetId when barback <0.13.0 support
- // is dropped.
- Future<bool> isPrimary(idOrAsset) {
- var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id;
- return new Future.value(
- // nothing is filtered in debug mode
- options.releaseMode &&
+ isPrimary(AssetId id) {
+ // nothing is filtered in debug mode
+ return options.releaseMode &&
// TODO(sigmund): remove this exclusion once we have dev_transformers
// (dartbug.com/14187)
- id.path.startsWith('web/') &&
+ !id.path.startsWith('lib/') &&
// may filter non-entry HTML files and internal artifacts
- (id.extension == '.html' || id.extension == '.scriptUrls') &&
+ (id.extension == '.html' || id.extension == _DATA_EXTENSION) &&
// keep any entry points
- !options.isHtmlEntryPoint(id));
+ !options.isHtmlEntryPoint(id);
}
- Future apply(Transform transform) {
- if (transform.primaryInput.id.extension == '.scriptUrls') {
- return new Future.value(null);
+ apply(Transform transform) {
+ transform.consumePrimary();
+ if (transform.primaryInput.id.extension == _DATA_EXTENSION) {
+ return null;
}
return readPrimaryAsHtml(transform).then((document) {
// Keep .html files that don't use polymer, since the app developer might
@@ -46,3 +43,5 @@ class BuildFilter extends Transformer with PolymerTransformer {
});
}
}
+
+const String _DATA_EXTENSION = '._data';
« no previous file with comments | « pkg/polymer/CHANGELOG.md ('k') | pkg/polymer/lib/src/build/delete_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698