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

Side by Side Diff: pkg/shadow_dom/tool/gruntfile.js

Issue 23548014: update shadowdom polyfill to latest (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The Polymer Authors. All rights reserved. 2 * Copyright 2013 The Polymer Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style 3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file. 4 * license that can be found in the LICENSE file.
5 */ 5 */
6 module.exports = function(grunt) { 6 module.exports = function(grunt) {
7 ShadowDOMPolyfill = [ 7 // recursive module builder
Emily Fortuna 2013/09/05 18:19:10 nit: comments start with capital letter and end wi
Jennifer Messerly 2013/09/05 19:47:02 yeah, I think the Polymer folks aren't following i
8 'sidetable.js', 8 var path = require('path');
9 'wrappers.js', 9 function readManifest(filename, modules) {
10 'wrappers/events.js', 10 modules = modules || [];
11 'wrappers/NodeList.js', 11 var lines = grunt.file.readJSON(filename);
12 'wrappers/Node.js', 12 var dir = path.dirname(filename);
13 'querySelector.js', 13 lines.forEach(function(line) {
14 'wrappers/node-interfaces.js', 14 var fullpath = path.join(dir, line);
15 'wrappers/CharacterData.js', 15 if (line.slice(-5) == '.json') {
16 'wrappers/Element.js', 16 // recurse
17 'wrappers/HTMLElement.js', 17 readManifest(fullpath, modules);
18 'wrappers/HTMLContentElement.js', 18 } else {
19 'wrappers/HTMLShadowElement.js', 19 modules.push(fullpath);
20 'wrappers/HTMLTemplateElement.js', 20 }
21 'wrappers/HTMLUnknownElement.js', 21 });
22 'wrappers/generic.js', 22 return modules;
23 'wrappers/ShadowRoot.js', 23 }
24 'ShadowRenderer.js',
25 'wrappers/Document.js',
26 'wrappers/Window.js',
27 'wrappers/MutationObserver.js',
28 'wrappers/override-constructors.js'
29 ];
30 ShadowDOMPolyfill = ShadowDOMPolyfill.map(function(p) {
31 return '../../../third_party/polymer/ShadowDOM/src/' + p;
32 });
33
34 // Apply partial patch from Polymer/Platform, dart2js, CSS
35 // polyfill from platform and dart2js CSS patches:
36 ShadowDOMPolyfill.unshift(
37 '../lib/src/platform/patches-shadowdom-polyfill-before.js'
38 );
39 ShadowDOMPolyfill.push(
40 '../lib/src/platform/patches-shadowdom-polyfill.js',
41 '../lib/src/platform/platform-init.js',
42 '../lib/src/platform/ShadowCSS.js',
43 '../lib/src/platform/patches-shadow-css.js'
44 );
45
46 // Only load polyfill if not natively present.
47 ConditionalShadowDOM = [].concat(
48 'build/if-poly.js',
49 ShadowDOMPolyfill,
50 'build/end-if.js'
51 );
52 24
53 // karma setup 25 // karma setup
54 var browsers; 26 var browsers;
55 (function() { 27 (function() {
56 try { 28 try {
57 var config = grunt.file.readJSON('local.json'); 29 var config = grunt.file.readJSON('local.json');
58 if (config.browsers) { 30 if (config.browsers) {
59 browsers = config.browsers; 31 browsers = config.browsers;
60 } 32 }
61 } catch (e) { 33 } catch (e) {
62 var os = require('os'); 34 var os = require('os');
63 browsers = ['Chrome', 'Firefox']; 35 browsers = ['Chrome', 'Firefox'];
64 if (os.type() === 'Darwin') { 36 if (os.type() === 'Darwin') {
65 browsers.push('ChromeCanary'); 37 browsers.push('ChromeCanary');
66 } 38 }
67 if (os.type() === 'Windows_NT') { 39 if (os.type() === 'Windows_NT') {
68 browsers.push('IE'); 40 browsers.push('IE');
69 } 41 }
70 } 42 }
71 })(); 43 })();
72 grunt.initConfig({ 44 grunt.initConfig({
45 shell: {
46 gitclone: {
47 command: 'git clone --branch shadowdom_patches ' +
48 'https://github.com/dart-lang/ShadowDOM.git ' +
49 '../../../third_party/polymer/ShadowDOM'
50 }
51 },
52
73 karma: { 53 karma: {
74 options: { 54 options: {
75 configFile: 'conf/karma.conf.js', 55 configFile: 'conf/karma.conf.js',
76 keepalive: true, 56 keepalive: true,
77 browsers: browsers 57 browsers: browsers
78 }, 58 },
79 buildbot: { 59 buildbot: {
80 browsers: browsers, 60 browsers: browsers,
81 reporters: ['crbot'], 61 reporters: ['crbot'],
82 logLevel: 'OFF' 62 logLevel: 'OFF'
83 }, 63 },
84 ShadowDOM: { 64 ShadowDOM: {
85 browsers: browsers 65 browsers: browsers
86 } 66 }
87 }, 67 },
88 concat: { 68 concat: {
89 ShadowDOM: { 69 ShadowDOM: {
90 src: ConditionalShadowDOM, 70 src: readManifest('build.json'),
91 dest: '../lib/shadow_dom.debug.js', 71 dest: '../lib/shadow_dom.debug.js',
92 nonull: true 72 nonull: true
93 } 73 }
94 }, 74 },
95 uglify: { 75 uglify: {
96 ShadowDOM: { 76 ShadowDOM: {
97 options: { 77 options: {
98 compress: { 78 compress: {
99 // TODO(sjmiles): should be false by default (?) 79 // TODO(sjmiles): should be false by default (?)
100 // https://github.com/mishoo/UglifyJS2/issues/165 80 // https://github.com/mishoo/UglifyJS2/issues/165
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 grunt.loadNpmTasks('grunt-contrib-yuidoc'); 113 grunt.loadNpmTasks('grunt-contrib-yuidoc');
134 grunt.loadNpmTasks('grunt-karma-0.9.1'); 114 grunt.loadNpmTasks('grunt-karma-0.9.1');
135 115
136 // tasks 116 // tasks
137 grunt.registerTask('default', ['concat', 'uglify']); 117 grunt.registerTask('default', ['concat', 'uglify']);
138 grunt.registerTask('minify', ['concat', 'uglify']); 118 grunt.registerTask('minify', ['concat', 'uglify']);
139 grunt.registerTask('docs', ['yuidoc']); 119 grunt.registerTask('docs', ['yuidoc']);
140 grunt.registerTask('test', ['karma:ShadowDOM']); 120 grunt.registerTask('test', ['karma:ShadowDOM']);
141 grunt.registerTask('test-buildbot', ['karma:buildbot']); 121 grunt.registerTask('test-buildbot', ['karma:buildbot']);
142 }; 122 };
143
OLDNEW
« pkg/shadow_dom/lib/shadow_dom.min.js ('K') | « pkg/shadow_dom/tool/build.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698