1015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.orgmodule.exports = function(grunt) {
2015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org
3015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  // Project configuration.
4015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.initConfig({
5015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    pkg: grunt.file.readJSON('package.json'),
6015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    // Install all the packages listed in the bower.json file.
7015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    shell: {
8015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      bower_install: {
9015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org         command: 'bower install'
10015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      }
11015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    },
12015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    // Copy all the bower files into a single directory.
13015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    bower: {
14015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      dev: {
15015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        dest: '../../../out/grunt/third_party'
16015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      }
17015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    },
18015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    // Concatenate all the files in third_party into a single file.
19015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    concat: {
20015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      dist: {
21015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        src: [
22015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org          '../../../out/grunt/third_party/WeakMap.js',
23015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org          '../../../out/grunt/third_party/classlist.js',
24015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org          '../../../out/grunt/third_party/pointerevents-polyfill.js',
25015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org          '../../../out/grunt/third_party/MutationObserver.js',
26015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org          '../../../out/grunt/third_party/CustomElements.js',
27015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org          '../../../out/grunt/third_party/HTMLImports.js',
28015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        ],
29015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        dest: '../../../out/grunt/src/<%= pkg.name %>.js'
30015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      }
31015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    },
32015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    // Uglify the one big file into one smaller file.
33015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    uglify: {
34015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      options: {
35015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        banner: '/*! <%= pkg.name %> built from /exerimental/webtry/poly <%= grunt.template.today("yyyy-mm-dd") %> */\n'
36015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      },
37015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      build: {
38015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        src: '../../../out/grunt/src/<%= pkg.name %>.js',
39015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        dest: '../res/js/<%= pkg.name %>.js'
40015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      }
41015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    },
42015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    copy: {
43015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      simple: {
44015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        src: '../../../out/grunt/src/<%= pkg.name %>.js',
45015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org        dest: '../res/js/<%= pkg.name %>.js'
46015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org      }
47015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org    }
48015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  });
49015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org
50015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  // Load the plugins for the above commands.
51015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.loadNpmTasks('grunt-bower');
52015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.loadNpmTasks('grunt-contrib-concat');
53015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.loadNpmTasks('grunt-contrib-copy');
54015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.loadNpmTasks('grunt-contrib-cssmin');
55015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.loadNpmTasks('grunt-contrib-uglify');
56015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.loadNpmTasks('grunt-shell');
57015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org
58015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  // By default run all the commands in the right sequence to build our custom minified polyfill.
59015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.registerTask('default', ['shell:bower_install', 'bower', 'concat', 'uglify']);
60015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org
61015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  // A target to build an unminified version, for debugging.
62015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org  grunt.registerTask('notmin', ['shell:bower_install', 'bower', 'concat', 'copy:simple']);
63015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org
64015c08e5ca44260b2f8edd6b70ae4eb05a05f2a9commit-bot@chromium.org};
65