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

Side by Side Diff: pkg/polymer/lib/src/build/common.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 /// Common methods used by transfomers. 5 /// Common methods used by transfomers.
6 library polymer.src.build.common; 6 library polymer.src.build.common;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 /// This will make a physical element appear on the page showing build logs. 82 /// This will make a physical element appear on the page showing build logs.
83 /// It will only appear when ![releaseMode] even if this is true. 83 /// It will only appear when ![releaseMode] even if this is true.
84 final bool injectBuildLogsInOutput; 84 final bool injectBuildLogsInOutput;
85 85
86 /// Rules to determine whether to run liner on an html file. 86 /// Rules to determine whether to run liner on an html file.
87 // TODO(jmesserly): instead of this flag, we should only run linter on 87 // TODO(jmesserly): instead of this flag, we should only run linter on
88 // reachable (entry point+imported) html if deploying. See dartbug.com/17199. 88 // reachable (entry point+imported) html if deploying. See dartbug.com/17199.
89 final LintOptions lint; 89 final LintOptions lint;
90 90
91 /// This will automatically inject `platform.js` from the `web_components` 91 /// This will automatically inject `webcomponents.js` from the `web_components `
Siggi Cherem (dart-lang) 2014/11/25 17:53:42 long line, idea, say 'inject the polyfills' instea
jakemac 2014/12/01 18:42:51 Done.
92 /// package in all entry points, if it is not already included. 92 /// package in all entry points, if it is not already included.
93 final bool injectPlatformJs; 93 final bool injectWebComponentsJs;
94 94
95 TransformOptions({entryPoints, this.inlineStylesheets, 95 TransformOptions({entryPoints, this.inlineStylesheets,
96 this.contentSecurityPolicy: false, this.directlyIncludeJS: true, 96 this.contentSecurityPolicy: false, this.directlyIncludeJS: true,
97 this.releaseMode: true, this.lint: const LintOptions(), 97 this.releaseMode: true, this.lint: const LintOptions(),
98 this.injectBuildLogsInOutput: false, this.injectPlatformJs: true}) 98 this.injectBuildLogsInOutput: false, this.injectWebComponentsJs: true})
99 : entryPoints = entryPoints == null ? null 99 : entryPoints = entryPoints == null ? null
100 : entryPoints.map(systemToAssetPath).toList(); 100 : entryPoints.map(systemToAssetPath).toList();
101 101
102 /// Whether an asset with [id] is an entry point HTML file. 102 /// Whether an asset with [id] is an entry point HTML file.
103 bool isHtmlEntryPoint(AssetId id) { 103 bool isHtmlEntryPoint(AssetId id) {
104 if (id.extension != '.html') return false; 104 if (id.extension != '.html') return false;
105 105
106 // Note: [id.path] is a relative path from the root of a package. 106 // Note: [id.path] is a relative path from the root of a package.
107 if (entryPoints == null) { 107 if (entryPoints == null) {
108 return id.path.startsWith('web/') || id.path.startsWith('test/'); 108 return id.path.startsWith('web/') || id.path.startsWith('test/');
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 /// Returns true if this is a valid custom element name. See: 264 /// Returns true if this is a valid custom element name. See:
265 /// <http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type> 265 /// <http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type>
266 bool isCustomTagName(String name) { 266 bool isCustomTagName(String name) {
267 if (name == null || !name.contains('-')) return false; 267 if (name == null || !name.contains('-')) return false;
268 return !invalidTagNames.containsKey(name); 268 return !invalidTagNames.containsKey(name);
269 } 269 }
270 270
271 /// Regex to split names in the 'attributes' attribute, which supports 'a b c', 271 /// Regex to split names in the 'attributes' attribute, which supports 'a b c',
272 /// 'a,b,c', or even 'a b,c'. This is the same as in `lib/src/declaration.dart`. 272 /// 'a,b,c', or even 'a b,c'. This is the same as in `lib/src/declaration.dart`.
273 final ATTRIBUTES_REGEX = new RegExp(r'\s|,'); 273 final ATTRIBUTES_REGEX = new RegExp(r'\s|,');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698