Chromium Code Reviews| Index: pkg/shadow_dom/tool/gruntfile.js |
| diff --git a/pkg/shadow_dom/tool/gruntfile.js b/pkg/shadow_dom/tool/gruntfile.js |
| index f245d730352a1cf52ae23bad23cd92756066d005..5d1ab3d0efa21229a5bd15b24e7ae23f80fccf66 100644 |
| --- a/pkg/shadow_dom/tool/gruntfile.js |
| +++ b/pkg/shadow_dom/tool/gruntfile.js |
| @@ -4,51 +4,23 @@ |
| * license that can be found in the LICENSE file. |
| */ |
| module.exports = function(grunt) { |
| - ShadowDOMPolyfill = [ |
| - 'sidetable.js', |
| - 'wrappers.js', |
| - 'wrappers/events.js', |
| - 'wrappers/NodeList.js', |
| - 'wrappers/Node.js', |
| - 'querySelector.js', |
| - 'wrappers/node-interfaces.js', |
| - 'wrappers/CharacterData.js', |
| - 'wrappers/Element.js', |
| - 'wrappers/HTMLElement.js', |
| - 'wrappers/HTMLContentElement.js', |
| - 'wrappers/HTMLShadowElement.js', |
| - 'wrappers/HTMLTemplateElement.js', |
| - 'wrappers/HTMLUnknownElement.js', |
| - 'wrappers/generic.js', |
| - 'wrappers/ShadowRoot.js', |
| - 'ShadowRenderer.js', |
| - 'wrappers/Document.js', |
| - 'wrappers/Window.js', |
| - 'wrappers/MutationObserver.js', |
| - 'wrappers/override-constructors.js' |
| - ]; |
| - ShadowDOMPolyfill = ShadowDOMPolyfill.map(function(p) { |
| - return '../../../third_party/polymer/ShadowDOM/src/' + p; |
| - }); |
| - |
| - // Apply partial patch from Polymer/Platform, dart2js, CSS |
| - // polyfill from platform and dart2js CSS patches: |
| - ShadowDOMPolyfill.unshift( |
| - '../lib/src/platform/patches-shadowdom-polyfill-before.js' |
| - ); |
| - ShadowDOMPolyfill.push( |
| - '../lib/src/platform/patches-shadowdom-polyfill.js', |
| - '../lib/src/platform/platform-init.js', |
| - '../lib/src/platform/ShadowCSS.js', |
| - '../lib/src/platform/patches-shadow-css.js' |
| - ); |
| - |
| - // Only load polyfill if not natively present. |
| - ConditionalShadowDOM = [].concat( |
| - 'build/if-poly.js', |
| - ShadowDOMPolyfill, |
| - 'build/end-if.js' |
| - ); |
| + // 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
|
| + var path = require('path'); |
| + function readManifest(filename, modules) { |
| + modules = modules || []; |
| + var lines = grunt.file.readJSON(filename); |
| + var dir = path.dirname(filename); |
| + lines.forEach(function(line) { |
| + var fullpath = path.join(dir, line); |
| + if (line.slice(-5) == '.json') { |
| + // recurse |
| + readManifest(fullpath, modules); |
| + } else { |
| + modules.push(fullpath); |
| + } |
| + }); |
| + return modules; |
| + } |
| // karma setup |
| var browsers; |
| @@ -70,6 +42,14 @@ module.exports = function(grunt) { |
| } |
| })(); |
| grunt.initConfig({ |
| + shell: { |
| + gitclone: { |
| + command: 'git clone --branch shadowdom_patches ' + |
| + 'https://github.com/dart-lang/ShadowDOM.git ' + |
| + '../../../third_party/polymer/ShadowDOM' |
| + } |
| + }, |
| + |
| karma: { |
| options: { |
| configFile: 'conf/karma.conf.js', |
| @@ -87,7 +67,7 @@ module.exports = function(grunt) { |
| }, |
| concat: { |
| ShadowDOM: { |
| - src: ConditionalShadowDOM, |
| + src: readManifest('build.json'), |
| dest: '../lib/shadow_dom.debug.js', |
| nonull: true |
| } |
| @@ -140,4 +120,3 @@ module.exports = function(grunt) { |
| grunt.registerTask('test', ['karma:ShadowDOM']); |
| grunt.registerTask('test-buildbot', ['karma:buildbot']); |
| }; |
| - |