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

Side by Side Diff: pkg/polymer/lib/transformer.dart

Issue 723393003: update to polymer js 0.5.1 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: little bit of cleanup Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS 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 /// Transfomer used for pub-serve and pub-deploy. 5 /// Transfomer used for pub-serve and pub-deploy.
6 library polymer.transformer; 6 library polymer.transformer;
7 7
8 import 'package:barback/barback.dart'; 8 import 'package:barback/barback.dart';
9 import 'package:observe/transformer.dart'; 9 import 'package:observe/transformer.dart';
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 26 matching lines...) Expand all
37 : this(_parseSettings(settings)); 37 : this(_parseSettings(settings));
38 } 38 }
39 39
40 TransformOptions _parseSettings(BarbackSettings settings) { 40 TransformOptions _parseSettings(BarbackSettings settings) {
41 var args = settings.configuration; 41 var args = settings.configuration;
42 bool releaseMode = settings.mode == BarbackMode.RELEASE; 42 bool releaseMode = settings.mode == BarbackMode.RELEASE;
43 bool jsOption = args['js']; 43 bool jsOption = args['js'];
44 bool csp = args['csp'] == true; // defaults to false 44 bool csp = args['csp'] == true; // defaults to false
45 bool injectBuildLogs = 45 bool injectBuildLogs =
46 !releaseMode && args['inject_build_logs_in_output'] != false; 46 !releaseMode && args['inject_build_logs_in_output'] != false;
47 bool injectPlatformJs = args['inject_platform_js'] != false; 47 bool injectWebComponentsJs = true;
48 if (args['inject_platform_js'] != null) {
49 print('Invalid polymer transformer option `inject_platform_js`. This has '
Siggi Cherem (dart-lang) 2014/11/25 17:53:42 Invalid -> Deprecated?
jakemac 2014/12/01 18:42:51 Done.
50 'been renamed `inject_web_components_js` to match the new file name.');
Siggi Cherem (dart-lang) 2014/11/25 17:53:42 since the file has no _, should it be inject_webco
jakemac 2014/12/01 18:42:51 yes true, it annoys me that they didn't put an _ i
51 injectWebComponentsJs = args['inject_platform_js'] != false;
52 }
53 if (args['inject_web_components_js'] != null) {
54 injectWebComponentsJs = args['inject_web_components_js'] != false;
55 }
48 return new TransformOptions( 56 return new TransformOptions(
49 entryPoints: readFileList(args['entry_points']), 57 entryPoints: readFileList(args['entry_points']),
50 inlineStylesheets: _readInlineStylesheets(args['inline_stylesheets']), 58 inlineStylesheets: _readInlineStylesheets(args['inline_stylesheets']),
51 directlyIncludeJS: jsOption == null ? releaseMode : jsOption, 59 directlyIncludeJS: jsOption == null ? releaseMode : jsOption,
52 contentSecurityPolicy: csp, 60 contentSecurityPolicy: csp,
53 releaseMode: releaseMode, 61 releaseMode: releaseMode,
54 lint: _parseLintOption(args['lint']), 62 lint: _parseLintOption(args['lint']),
55 injectBuildLogsInOutput: injectBuildLogs, 63 injectBuildLogsInOutput: injectBuildLogs,
56 injectPlatformJs: injectPlatformJs); 64 injectWebComponentsJs: injectWebComponentsJs);
57 } 65 }
58 66
59 // Lint option can be empty (all files), false, true, or a map indicating 67 // Lint option can be empty (all files), false, true, or a map indicating
60 // include/exclude files. 68 // include/exclude files.
61 _parseLintOption(value) { 69 _parseLintOption(value) {
62 var lint = null; 70 var lint = null;
63 if (value == null || value == true) return new LintOptions(); 71 if (value == null || value == true) return new LintOptions();
64 if (value == false) return new LintOptions.disabled(); 72 if (value == false) return new LintOptions.disabled();
65 if (value is Map && value.length == 1) { 73 if (value is Map && value.length == 1) {
66 var key = value.keys.single; 74 var key = value.keys.single;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 [new BuildFilter(options)], 168 [new BuildFilter(options)],
161 [new BuildLogCombiner(options)], 169 [new BuildLogCombiner(options)],
162 ]); 170 ]);
163 if (!options.releaseMode) { 171 if (!options.releaseMode) {
164 phases.add([new IndexPageBuilder(options)]); 172 phases.add([new IndexPageBuilder(options)]);
165 } 173 }
166 return phases; 174 return phases;
167 } 175 }
168 176
169 final RegExp _PACKAGE_PATH_REGEX = new RegExp(r'packages\/([^\/]+)\/(.*)'); 177 final RegExp _PACKAGE_PATH_REGEX = new RegExp(r'packages\/([^\/]+)\/(.*)');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698