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

Unified Diff: pkg/polymer/lib/transformer.dart

Issue 47933006: Build fixes: adds arguments to the pub-build plugin to configure whether 'js' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/src/build/script_compactor.dart ('k') | pkg/polymer/test/build/all_phases_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/transformer.dart
diff --git a/pkg/polymer/lib/transformer.dart b/pkg/polymer/lib/transformer.dart
index 4d132cffba343fa14cb04b783c479d78e5368df2..a4f0e10646a8549a9ed5126487f812e7506b6323 100644
--- a/pkg/polymer/lib/transformer.dart
+++ b/pkg/polymer/lib/transformer.dart
@@ -35,26 +35,29 @@ class PolymerTransformerGroup implements TransformerGroup {
TransformOptions _parseArgs(Map args) {
- var entryPoints;
- if (args.containsKey('entry_points')) {
- entryPoints = [];
- var value = args['entry_points'];
- bool error;
- if (value is List) {
- entryPoints = value;
- error = value.any((e) => e is! String);
- } else if (value is String) {
- entryPoints = [value];
- error = false;
- } else {
- error = true;
- }
+ return new TransformOptions(
+ entryPoints: _readEntrypoints(args['entry_points']),
+ directlyIncludeJS: args['js'] != false, // default to true
Jennifer Messerly 2013/10/29 02:15:35 shouldn't args populate this so it's always be tru
+ contentSecurityPolicy: args['csp'] == true); // default to false
+}
- if (error) {
- print('Invalid value for "entry_points" in the polymer transformer.');
- }
+_readEntrypoints(value) {
+ if (value == null) return null;
+ var entryPoints = [];
+ bool error;
+ if (value is List) {
+ entryPoints = value;
+ error = value.any((e) => e is! String);
+ } else if (value is String) {
+ entryPoints = [value];
+ error = false;
+ } else {
+ error = true;
+ }
+ if (error) {
+ print('Invalid value for "entry_points" in the polymer transformer.');
}
- return new TransformOptions(entryPoints: entryPoints);
+ return entryPoints;
}
List<List<Transformer>> _createDeployPhases(TransformOptions options) {
« no previous file with comments | « pkg/polymer/lib/src/build/script_compactor.dart ('k') | pkg/polymer/test/build/all_phases_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698