<commit_before>module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-contrib-symlink');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-coffee');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-commands');

    var filesLess = {},
        filesCoffee = {};

    // Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        symlink: {
            // BOWER COMPONENT
            fontawesome_font_otf: {
                src: 'bower_components/font-awesome/fonts/FontAwesome.otf',
                dest: 'web/fonts/FontAwesome.otf'
            },
            fontawesome_font_eot: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.eot',
                dest: 'web/fonts/fontawesome-webfont.eot'
            },
            fontawesome_font_svg: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.svg',
                dest: 'web/fonts/fontawesome-webfont.svg'
            },
            fontawesome_font_ttf: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.ttf',
                dest: 'web/fonts/fontawesome-webfont.ttf'
            },
            fontawesome_font_woff: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.woff',
                dest: 'web/fonts/fontawesome-webfont.woff'
            },
            bootstrap_font_eot: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
                dest: 'web/fonts/glyphicons-halflings-regular.eot'
            },
            bootstrap_font_svg: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
                dest: 'web/fonts/glyphicons-halflings-regular.svg'
            },
            bootstrap_font_ttf: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
                dest: 'web/fonts/glyphicons-halflings-regular.ttf'
            },
            bootstrap_font_woff: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
                dest: 'web/fonts/glyphicons-halflings-regular.woff'
            },
            datatable_img_sort_asc: {
                src: 'bower_components/datatables/media/images/sort_asc.png',
                dest: 'web/images/sort_asc.png'
            },
            datatable_img_sort_both: {
                src: 'bower_components/datatables/media/images/sort_both.png',
                dest: 'web/images/sort_both.png'
            },
            datatable_img_sort_desc: {
                src: 'bower_components/datatables/media/images/sort_desc.png',
                dest: 'web/images/sort_desc.png'
            },
            pace_js: {
                src: 'bower_components/pace/pace.min.js',
                dest: 'web/js/pace.min.js'
            },

            // SMARTADMIN ASSETS
            smartadmin_bg: {
                src: 'web/bundles/phporchestrabackoffice/smartadmin/img/mybg.png',
                dest: 'web/img/mybg.png'
            },
            smartadmin_flags: {
                src: 'web/bundles/phporchestrabackoffice/smartadmin/img/flags/flags.png',
                dest: 'web/img/flags/flags.png'
            }
        },

        clean: {
            built: ["web/built"]
        },

        less: {
            bundles: {
                files: filesLess
            }
        },

        cssmin: {
            minify: {
                expand: true,
                src: ['web/css/all.css'],
                ext: '.min.css'
            }
        },

        coffee: {
            compileBare: {
                options: {
                    bare: true
                },
                files: filesCoffee
            }
        },

        uglify: {
            dist: {
                files: {
                    'web/js/all.min.js': ['web/js/all.js']
                }
            }
        },

        concat: {
            smartadminjs: {
                src: [
                    'bower_components/jquery/dist/jquery.js',
                    'bower_components/jquery-ui/jquery-ui.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/app.config.js',
                    'bower_components/bootstrap/dist/js/bootstrap.js',
                    'bower_components/Jcrop/js/jquery.Jcrop.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/notification/SmartNotification.min.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/smartwidgets/jarvis.widget.min.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/app.min.js'
                ],
                dest: 'web/built/smartadmin.js'
            },

            libjs: {
                src: [
                    'bower_components/underscore/underscore.js',
                    'bower_components/backbone/backbone.js',
                    'bower_components/angular/angular.js',
                    'bower_components/datatables/media/js/jquery.dataTables.js',
                    'bower_components/jquery-form/jquery.form.js',
                    'web/bundles/phporchestrabackoffice/js/latinise.js',
                    'web/bundles/phporchestrabackoffice/js/jQuery.DOMNodeAppear.js',
                    'web/bundles/phporchestrabackoffice/js/underscoreTemplateLoader.js'
                ],
                dest: 'web/built/lib.js'
            },

            orchestrajs: {
                src: [
                     'web/built/phporchestrabackoffice/js/orchestraLib.js',
                     'web/built/phporchestrabackoffice/js/orchestraListeners.js',

                     // MISC
                     'web/built/phporchestrabackoffice/js/OrchestraView.js',
                     'web/built/phporchestrabackoffice/js/addPrototype.js',
                     'web/built/phporchestrabackoffice/js/modelBackbone.js',
                     'web/built/phporchestrabackoffice/js/adminFormView.js',
                     'web/built/phporchestrabackoffice/js/generateAlias.js',
                     'web/built/phporchestrabackoffice/js/generateContentTypeId.js',
                     'web/built/phporchestrabackoffice/js/page/makeSortable.js',
                     'web/built/phporchestrabackoffice/js/page/areaView.js',
                     'web/built/phporchestrabackoffice/js/page/blockView.js',
                     'web/built/phporchestrabackoffice/js/page/nodeView.js',
                     'web/built/phporchestrabackoffice/js/page/NodeVersionView.js',
                     'web/built/phporchestrabackoffice/js/page/NodeLanguageView.js',
                     'web/built/phporchestrabackoffice/js/page/previewLinkView.js',
                     'web/built/phporchestrabackoffice/js/table/TableviewView.js',
                     'web/built/phporchestrabackoffice/js/table/TableviewCollectionView.js',
                     'web/built/phporchestrabackoffice/js/FullPageFormView.js',
                     'web/built/phporchestrabackoffice/js/ContentTypeChangeTypeListener.js',
                     'web/built/phporchestrabackoffice/js/page/templateView.js',
                     'web/built/phporchestrabackoffice/js/page/showNode.js',
                     'web/built/phporchestrabackoffice/js/page/showTemplate.js',
                     'web/built/phporchestrabackoffice/js/table/tableviewLoader.js',
                     'web/built/phporchestrabackoffice/js/page/nodeConstructor.js',
                     'web/built/phporchestrabackoffice/js/treeAjaxDelete.js',
                     'web/built/phporchestrabackoffice/js/configurableContentFormListener.js',
                     'web/built/phporchestrabackoffice/js/page/blocksPanel.js',
                     'web/built/phporchestrabackoffice/js/security.js',
                     'web/built/phporchestrabackoffice/js/page/blockTrash.js',

                     // MEDIATHEQUE
                     'web/built/phporchestrabackoffice/js/mediatheque/*.js',

                     // INDEXATION
                     'web/bundles/phporchestraindexation/js/*.js',

                     // LEXIKTRANSLATION
                     'web/bundles/lexiktranslation/ng-table/ng-table.min.js',
                     'web/built/phporchestratranslation/js/translationView.js',

                     // BACKBONE ROUTER
                     'web/bundles/phporchestrabackoffice/js/backboneRouter.js'
                ],
                dest: 'web/built/orchestra.js'
            },

            js: {
                src: [
                    'web/built/smartadmin.js',
                    'web/built/lib.js',
                    'web/built/orchestra.js'
                ],
                dest: 'web/js/all.js'
            },

            smartadmincss: {
                src: [
                    // SMARTADMIN PACKAGE
//                    'bower_components/bootstrap/dist/css/bootstrap.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/bootstrap.min.css',
                    'bower_components/font-awesome/css/font-awesome.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-production-plugins.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-production.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-skins.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-rtl.min.css',

                    // ORCHESTRA SMARTADMIN PATCHES
                    'web/built/phporchestrabackoffice/css/smartadminPatches/flags.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/title.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/modal.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/widget.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/checkbox.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/tab.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/form.css',

                    // TINYMCE PATCHES
                    'web/built/phporchestrabackoffice/css/tinyMCEPatches/floatPanel.css'

                ],
                dest: 'web/built/smartadmin.css'
            },

            libcss: {
                src: [
                      'bower_components/jquery-ui/themes/base/all.css',
                      'bower_components/datatables/media/css/jquery.dataTables.css'
                ],
                dest: 'web/built/lib.css'
            },

            orchestracss: {
                src: [
                      'web/built/phporchestrabackoffice/css/phporchestra.css',
                      'web/built/phporchestrabackoffice/css/mediatheque.css',
                      'web/built/phporchestrabackoffice/css/template.css',
                      'web/built/phporchestrabackoffice/css/blocksPanel.css',
                      'web/built/phporchestrabackoffice/css/mediaModal.css',
                      'web/bundles/lexiktranslation/ng-table/ng-table.min.css',
                      'web/built/phporchestrabackoffice/css/loginPage.css',
                      'web/built/phporchestrabackoffice/css/editTable.css',
                      'web/built/phporchestrabackoffice/css/node.css',
                      'web/built/phporchestrabackoffice/css/widget-trash-block.css'
                ],
                dest: 'web/built/orchestra.css'
            },

            css: {
                src: [
                      'web/built/smartadmin.css',
                      'web/built/lib.css',
                      'web/built/orchestra.css'
                ],
                dest: 'web/css/all.css'
            }
        },

        watch: {
            css: {
                files: ['web/bundles/*/less/*.less'],
                tasks: ['css', 'command:assetic_dump']
            },
            javascript: {
                files: ['web/bundles/*/coffee/*.coffee'],
                tasks: ['javascript', 'command:assetic_dump']
            }
        },

        command : {
            assets_install: {
                cmd  : 'php app/console assets:install --symlink'
            },
            assetic_dump: {
                cmd  : 'php app/console assetic:dump'
            }
        }
    });

    // Default task(s).
    grunt.registerTask('default', ['clean', 'command:assets_install', 'symlink', 'css', 'javascript', 'javascriptProd', 'command:assetic_dump']);
    grunt.registerTask('css', ['less:discovering', 'less', 'concat:smartadmincss', 'concat:libcss', 'concat:orchestracss', 'concat:css', 'cssmin']);
    grunt.registerTask('javascript', ['coffee:discovering', 'coffee', 'concat:smartadminjs', 'concat:libjs', 'concat:orchestrajs', 'concat:js']);
    grunt.registerTask('javascriptProd', ['uglify']);
    grunt.registerTask('less:discovering', 'This is a function', function() {
        // LESS Files management
        // Source LESS files are located inside : bundles/[bundle]/less/
        // Destination CSS files are located inside : built/[bundle]/css/
        var mappingFileLess = grunt.file.expandMapping(
            ['*/less/*.less', '*/less/*/*.less'],
            'web/built/', {
                cwd: 'web/bundles/',
                rename: function(dest, matchedSrcPath, options) {
                    return dest + matchedSrcPath.replace(/less/g, 'css');
                }
            });

        grunt.util._.each(mappingFileLess, function(value) {
            // Why value.src is an array ??
            filesLess[value.dest] = value.src[0];
        });
    });
    grunt.registerTask('coffee:discovering', 'This is a function', function() {
        // COFFEE Files management
        // Source COFFEE files are located inside : bundles/[bundle]/coffee/
        // Destination JS files are located inside : built/[bundle]/js/
        var mappingFileCoffee = grunt.file.expandMapping(
            ['*/coffee/*.coffee', '*/coffee/*/*.coffee'],
            'web/built/', {
                cwd: 'web/bundles/',
                rename: function(dest, matchedSrcPath, options) {
                    return dest + matchedSrcPath.replace(/coffee/g, 'js');
                }
            });

        grunt.util._.each(mappingFileCoffee, function(value) {
            // Why value.src is an array ??
            filesCoffee[value.dest] = value.src[0];
        });
    });
};
<commit_msg>Add background for none src images<commit_after>module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-contrib-symlink');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-coffee');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-commands');

    var filesLess = {},
        filesCoffee = {};

    // Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        symlink: {
            // BOWER COMPONENT
            fontawesome_font_otf: {
                src: 'bower_components/font-awesome/fonts/FontAwesome.otf',
                dest: 'web/fonts/FontAwesome.otf'
            },
            fontawesome_font_eot: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.eot',
                dest: 'web/fonts/fontawesome-webfont.eot'
            },
            fontawesome_font_svg: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.svg',
                dest: 'web/fonts/fontawesome-webfont.svg'
            },
            fontawesome_font_ttf: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.ttf',
                dest: 'web/fonts/fontawesome-webfont.ttf'
            },
            fontawesome_font_woff: {
                src: 'bower_components/font-awesome/fonts/fontawesome-webfont.woff',
                dest: 'web/fonts/fontawesome-webfont.woff'
            },
            bootstrap_font_eot: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
                dest: 'web/fonts/glyphicons-halflings-regular.eot'
            },
            bootstrap_font_svg: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
                dest: 'web/fonts/glyphicons-halflings-regular.svg'
            },
            bootstrap_font_ttf: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
                dest: 'web/fonts/glyphicons-halflings-regular.ttf'
            },
            bootstrap_font_woff: {
                src: 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
                dest: 'web/fonts/glyphicons-halflings-regular.woff'
            },
            datatable_img_sort_asc: {
                src: 'bower_components/datatables/media/images/sort_asc.png',
                dest: 'web/images/sort_asc.png'
            },
            datatable_img_sort_both: {
                src: 'bower_components/datatables/media/images/sort_both.png',
                dest: 'web/images/sort_both.png'
            },
            datatable_img_sort_desc: {
                src: 'bower_components/datatables/media/images/sort_desc.png',
                dest: 'web/images/sort_desc.png'
            },
            pace_js: {
                src: 'bower_components/pace/pace.min.js',
                dest: 'web/js/pace.min.js'
            },

            // SMARTADMIN ASSETS
            smartadmin_bg: {
                src: 'web/bundles/phporchestrabackoffice/smartadmin/img/mybg.png',
                dest: 'web/img/mybg.png'
            },
            smartadmin_flags: {
                src: 'web/bundles/phporchestrabackoffice/smartadmin/img/flags/flags.png',
                dest: 'web/img/flags/flags.png'
            },

            no_image: {
                src: 'web/bundles/phporchestrabackoffice/images/no_image_available.jpg',
                dest: 'web/img/no_image_available.jpg'
            }

        },

        clean: {
            built: ["web/built"]
        },

        less: {
            bundles: {
                files: filesLess
            }
        },

        cssmin: {
            minify: {
                expand: true,
                src: ['web/css/all.css'],
                ext: '.min.css'
            }
        },

        coffee: {
            compileBare: {
                options: {
                    bare: true
                },
                files: filesCoffee
            }
        },

        uglify: {
            dist: {
                files: {
                    'web/js/all.min.js': ['web/js/all.js']
                }
            }
        },

        concat: {
            smartadminjs: {
                src: [
                    'bower_components/jquery/dist/jquery.js',
                    'bower_components/jquery-ui/jquery-ui.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/app.config.js',
                    'bower_components/bootstrap/dist/js/bootstrap.js',
                    'bower_components/Jcrop/js/jquery.Jcrop.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/notification/SmartNotification.min.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/smartwidgets/jarvis.widget.min.js',
                    'web/bundles/phporchestrabackoffice/smartadmin/js/app.min.js'
                ],
                dest: 'web/built/smartadmin.js'
            },

            libjs: {
                src: [
                    'bower_components/underscore/underscore.js',
                    'bower_components/backbone/backbone.js',
                    'bower_components/angular/angular.js',
                    'bower_components/datatables/media/js/jquery.dataTables.js',
                    'bower_components/jquery-form/jquery.form.js',
                    'web/bundles/phporchestrabackoffice/js/latinise.js',
                    'web/bundles/phporchestrabackoffice/js/jQuery.DOMNodeAppear.js',
                    'web/bundles/phporchestrabackoffice/js/underscoreTemplateLoader.js'
                ],
                dest: 'web/built/lib.js'
            },

            orchestrajs: {
                src: [
                     'web/built/phporchestrabackoffice/js/orchestraLib.js',
                     'web/built/phporchestrabackoffice/js/orchestraListeners.js',

                     // MISC
                     'web/built/phporchestrabackoffice/js/OrchestraView.js',
                     'web/built/phporchestrabackoffice/js/addPrototype.js',
                     'web/built/phporchestrabackoffice/js/modelBackbone.js',
                     'web/built/phporchestrabackoffice/js/adminFormView.js',
                     'web/built/phporchestrabackoffice/js/generateAlias.js',
                     'web/built/phporchestrabackoffice/js/generateContentTypeId.js',
                     'web/built/phporchestrabackoffice/js/page/makeSortable.js',
                     'web/built/phporchestrabackoffice/js/page/areaView.js',
                     'web/built/phporchestrabackoffice/js/page/blockView.js',
                     'web/built/phporchestrabackoffice/js/page/nodeView.js',
                     'web/built/phporchestrabackoffice/js/page/NodeVersionView.js',
                     'web/built/phporchestrabackoffice/js/page/NodeLanguageView.js',
                     'web/built/phporchestrabackoffice/js/page/previewLinkView.js',
                     'web/built/phporchestrabackoffice/js/table/TableviewView.js',
                     'web/built/phporchestrabackoffice/js/table/TableviewCollectionView.js',
                     'web/built/phporchestrabackoffice/js/FullPageFormView.js',
                     'web/built/phporchestrabackoffice/js/ContentTypeChangeTypeListener.js',
                     'web/built/phporchestrabackoffice/js/page/templateView.js',
                     'web/built/phporchestrabackoffice/js/page/showNode.js',
                     'web/built/phporchestrabackoffice/js/page/showTemplate.js',
                     'web/built/phporchestrabackoffice/js/table/tableviewLoader.js',
                     'web/built/phporchestrabackoffice/js/page/nodeConstructor.js',
                     'web/built/phporchestrabackoffice/js/treeAjaxDelete.js',
                     'web/built/phporchestrabackoffice/js/configurableContentFormListener.js',
                     'web/built/phporchestrabackoffice/js/page/blocksPanel.js',
                     'web/built/phporchestrabackoffice/js/security.js',
                     'web/built/phporchestrabackoffice/js/page/blockTrash.js',

                     // MEDIATHEQUE
                     'web/built/phporchestrabackoffice/js/mediatheque/*.js',

                     // INDEXATION
                     'web/bundles/phporchestraindexation/js/*.js',

                     // LEXIKTRANSLATION
                     'web/bundles/lexiktranslation/ng-table/ng-table.min.js',
                     'web/built/phporchestratranslation/js/translationView.js',

                     // BACKBONE ROUTER
                     'web/bundles/phporchestrabackoffice/js/backboneRouter.js'
                ],
                dest: 'web/built/orchestra.js'
            },

            js: {
                src: [
                    'web/built/smartadmin.js',
                    'web/built/lib.js',
                    'web/built/orchestra.js'
                ],
                dest: 'web/js/all.js'
            },

            smartadmincss: {
                src: [
                    // SMARTADMIN PACKAGE
//                    'bower_components/bootstrap/dist/css/bootstrap.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/bootstrap.min.css',
                    'bower_components/font-awesome/css/font-awesome.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-production-plugins.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-production.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-skins.min.css',
                    'web/bundles/phporchestrabackoffice/smartadmin/css/smartadmin-rtl.min.css',

                    // ORCHESTRA SMARTADMIN PATCHES
                    'web/built/phporchestrabackoffice/css/smartadminPatches/flags.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/title.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/modal.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/widget.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/checkbox.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/tab.css',
                    'web/built/phporchestrabackoffice/css/smartadminPatches/form.css',

                    // TINYMCE PATCHES
                    'web/built/phporchestrabackoffice/css/tinyMCEPatches/floatPanel.css'

                ],
                dest: 'web/built/smartadmin.css'
            },

            libcss: {
                src: [
                      'bower_components/jquery-ui/themes/base/all.css',
                      'bower_components/datatables/media/css/jquery.dataTables.css'
                ],
                dest: 'web/built/lib.css'
            },

            orchestracss: {
                src: [
                      'web/built/phporchestrabackoffice/css/phporchestra.css',
                      'web/built/phporchestrabackoffice/css/mediatheque.css',
                      'web/built/phporchestrabackoffice/css/template.css',
                      'web/built/phporchestrabackoffice/css/blocksPanel.css',
                      'web/built/phporchestrabackoffice/css/mediaModal.css',
                      'web/bundles/lexiktranslation/ng-table/ng-table.min.css',
                      'web/built/phporchestrabackoffice/css/loginPage.css',
                      'web/built/phporchestrabackoffice/css/editTable.css',
                      'web/built/phporchestrabackoffice/css/node.css',
                      'web/built/phporchestrabackoffice/css/widget-trash-block.css'
                ],
                dest: 'web/built/orchestra.css'
            },

            css: {
                src: [
                      'web/built/smartadmin.css',
                      'web/built/lib.css',
                      'web/built/orchestra.css'
                ],
                dest: 'web/css/all.css'
            }
        },

        watch: {
            css: {
                files: ['web/bundles/*/less/*.less'],
                tasks: ['css', 'command:assetic_dump']
            },
            javascript: {
                files: ['web/bundles/*/coffee/*.coffee'],
                tasks: ['javascript', 'command:assetic_dump']
            }
        },

        command : {
            assets_install: {
                cmd  : 'php app/console assets:install --symlink'
            },
            assetic_dump: {
                cmd  : 'php app/console assetic:dump'
            }
        }
    });

    // Default task(s).
    grunt.registerTask('default', ['clean', 'command:assets_install', 'symlink', 'css', 'javascript', 'javascriptProd', 'command:assetic_dump']);
    grunt.registerTask('css', ['less:discovering', 'less', 'concat:smartadmincss', 'concat:libcss', 'concat:orchestracss', 'concat:css', 'cssmin']);
    grunt.registerTask('javascript', ['coffee:discovering', 'coffee', 'concat:smartadminjs', 'concat:libjs', 'concat:orchestrajs', 'concat:js']);
    grunt.registerTask('javascriptProd', ['uglify']);
    grunt.registerTask('less:discovering', 'This is a function', function() {
        // LESS Files management
        // Source LESS files are located inside : bundles/[bundle]/less/
        // Destination CSS files are located inside : built/[bundle]/css/
        var mappingFileLess = grunt.file.expandMapping(
            ['*/less/*.less', '*/less/*/*.less'],
            'web/built/', {
                cwd: 'web/bundles/',
                rename: function(dest, matchedSrcPath, options) {
                    return dest + matchedSrcPath.replace(/less/g, 'css');
                }
            });

        grunt.util._.each(mappingFileLess, function(value) {
            // Why value.src is an array ??
            filesLess[value.dest] = value.src[0];
        });
    });
    grunt.registerTask('coffee:discovering', 'This is a function', function() {
        // COFFEE Files management
        // Source COFFEE files are located inside : bundles/[bundle]/coffee/
        // Destination JS files are located inside : built/[bundle]/js/
        var mappingFileCoffee = grunt.file.expandMapping(
            ['*/coffee/*.coffee', '*/coffee/*/*.coffee'],
            'web/built/', {
                cwd: 'web/bundles/',
                rename: function(dest, matchedSrcPath, options) {
                    return dest + matchedSrcPath.replace(/coffee/g, 'js');
                }
            });

        grunt.util._.each(mappingFileCoffee, function(value) {
            // Why value.src is an array ??
            filesCoffee[value.dest] = value.src[0];
        });
    });
};
<|endoftext|>


<commit_before>"use strict";

module.exports = function (grunt) {
    // Load grunt tasks automatically
    require("jit-grunt")(grunt, {
        nugetpack: "grunt-nuget",
        nugetpush: "grunt-nuget",
        buildcontrol: "grunt-build-control"
    });
    require("time-grunt")(grunt); // Time how long tasks take. Can help when optimizing build times

    var pkg = require("./package.json");

    grunt.initConfig({
        pkg: pkg,
        // Configurable paths
        paths: {
            bin: "bin",
            lib: "lib",
            tmpl: "template",
            build: "build",
            dist: "dist",
            all: "{<%= paths.bin %>,<%= paths.lib %>,<%= paths.tmpl %>}",
            defs: "typings/_definitions.d.ts",
            temp: "temp"
        },

        typescript: {
            options: {
                target: "es5",
                module: "commonjs",
                sourceMap: true,
                declaration: false,
                removeComments: false
            },
            src: {
                src: ["<%= paths.defs %>", "<%= paths.all %>/**/*.ts", "./*.ts"]
            },
            dist: {
                src: ["<%= typescript.src.src %>"],
                options: {
                    sourceMap: false
                }
            }
        },

        jsdoc : {
            typescript : {
                src: ["node_modules/typescript/bin/typescript.d.ts"],
                dest: "<%= paths.dist %>/typescript",
                options: { configure: "<%= paths.build %>/conf.typescript.json" }
            },
            lib : {
                src: ["node_modules/typescript/bin/lib.d.ts"],
                dest: "<%= paths.dist %>/lib",
                options: { configure: "<%= paths.build %>/conf.lib.json" }
            },
            node : {
                src: ["typings/node/node.d.ts"],
                dest: "<%= paths.dist %>/node",
                options: { configure: "<%= paths.build %>/conf.node.json" }
            }
        },

        tslint: {
            options: {
                configuration: grunt.file.readJSON("tslint.json")
            },
            src: {
                src: ["<%= paths.all %>/**/*.ts", "./*.ts"]
            }
        },

        clean: {
            src: [
                "<%= paths.all %>/**/*.{d.ts,js,js.map}",
                "./*.{d.ts,js,js.map}",
                "!<%= paths.tmpl %>/static/**",
                "!./Gruntfile.js",
            ],
            dist: "<%= paths.dist %>",
            temp: "<%= paths.temp %>"
        },

        connect: {
            options: {
                port: "8080",
                livereload: 56765
            },
            dist: {
                options: {
                    base: "<%= paths.dist %>"
                }
            }
        },

        watch: {
            tslint: { files: ["<%= tslint.src.src %>"], tasks: ["tslint:src"] },
            typescript: { files: ["<%= typescript.src.src %>"], tasks: ["typescript:src"] },
            gruntfile: { files: ["Gruntfile.js"] },

            livereload: {
                options: {
                    livereload: "<%= connect.options.livereload %>"
                },
                files: ["<%= paths.dist %>/**/*.{js,html,css}"]
            }
        },

        buildcontrol: {
            docs: {
                options: {
                    dir: "<%= paths.dist %>",
                    commit: true,
                    push: true,
                    branch: "gh-pages",
                    message: "Built documentations %sourceName% from commit %sourceCommit% on branch %sourceBranch%"
                }
            }
        }
    });

    grunt.registerTask("dev", ["tslint:src", "clean:src", "typescript:src"]);
    grunt.registerTask("build", ["tslint:src", "clean:src", "typescript:dist"]);
    grunt.registerTask("doc", ["clean:dist", "jsdoc:typescript", "jsdoc:node"]);

    grunt.registerTask("serve", ["dev", "doc", "connect:dist", "watch"]);

    grunt.registerTask("publish", ["build", "doc", "buildcontrol:docs"]);

    grunt.registerTask("default", ["build"]);
};<commit_msg>Fix issue in buildcontrol task<commit_after>"use strict";

module.exports = function (grunt) {
    // Load grunt tasks automatically
    require("jit-grunt")(grunt, {
        nugetpack: "grunt-nuget",
        nugetpush: "grunt-nuget",
        buildcontrol: "grunt-build-control"
    });
    require("time-grunt")(grunt); // Time how long tasks take. Can help when optimizing build times

    var pkg = require("./package.json");

    grunt.initConfig({
        pkg: pkg,
        // Configurable paths
        paths: {
            bin: "bin",
            lib: "lib",
            tmpl: "template",
            build: "build",
            dist: "dist",
            all: "{<%= paths.bin %>,<%= paths.lib %>,<%= paths.tmpl %>}",
            defs: "typings/_definitions.d.ts",
            temp: "temp"
        },

        typescript: {
            options: {
                target: "es5",
                module: "commonjs",
                sourceMap: true,
                declaration: false,
                removeComments: false
            },
            src: {
                src: ["<%= paths.defs %>", "<%= paths.all %>/**/*.ts", "./*.ts"]
            },
            dist: {
                src: ["<%= typescript.src.src %>"],
                options: {
                    sourceMap: false
                }
            }
        },

        jsdoc : {
            typescript : {
                src: ["node_modules/typescript/bin/typescript.d.ts"],
                dest: "<%= paths.dist %>/typescript",
                options: { configure: "<%= paths.build %>/conf.typescript.json" }
            },
            lib : {
                src: ["node_modules/typescript/bin/lib.d.ts"],
                dest: "<%= paths.dist %>/lib",
                options: { configure: "<%= paths.build %>/conf.lib.json" }
            },
            node : {
                src: ["typings/node/node.d.ts"],
                dest: "<%= paths.dist %>/node",
                options: { configure: "<%= paths.build %>/conf.node.json" }
            }
        },

        tslint: {
            options: {
                configuration: grunt.file.readJSON("tslint.json")
            },
            src: {
                src: ["<%= paths.all %>/**/*.ts", "./*.ts"]
            }
        },

        clean: {
            src: [
                "<%= paths.all %>/**/*.{d.ts,js,js.map}",
                "./*.{d.ts,js,js.map}",
                "!<%= paths.tmpl %>/static/**",
                "!./Gruntfile.js",
            ],
            dist: "<%= paths.dist %>",
            temp: "<%= paths.temp %>"
        },

        connect: {
            options: {
                port: "8080",
                livereload: 56765
            },
            dist: {
                options: {
                    base: "<%= paths.dist %>"
                }
            }
        },

        watch: {
            tslint: { files: ["<%= tslint.src.src %>"], tasks: ["tslint:src"] },
            typescript: { files: ["<%= typescript.src.src %>"], tasks: ["typescript:src"] },
            gruntfile: { files: ["Gruntfile.js"] },

            livereload: {
                options: {
                    livereload: "<%= connect.options.livereload %>"
                },
                files: ["<%= paths.dist %>/**/*.{js,html,css}"]
            }
        },

        buildcontrol: {
            docs: {
                options: {
                    dir: "<%= paths.dist %>",
                    commit: true,
                    push: true,
                    branch: "gh-pages",
                    //remote: "git@github.com:spatools/ts2jsdoc.git",
                    message: "Built documentations %sourceName% from commit %sourceCommit% on branch %sourceBranch%"
                }
            }
        }
    });

    grunt.registerTask("dev", ["tslint:src", "clean:src", "typescript:src"]);
    grunt.registerTask("build", ["tslint:src", "clean:src", "typescript:dist"]);
    grunt.registerTask("doc", ["clean:dist", "jsdoc:typescript", "jsdoc:node"]);

    grunt.registerTask("serve", ["dev", "doc", "connect:dist", "watch"]);

    grunt.registerTask("publish", ["build", "doc", "buildcontrol:docs"]);

    grunt.registerTask("default", ["build"]);
};<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('eui.jquery.json'),
        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
                '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
                '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
                '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
                ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
        // Task configuration.
        clean: {
            files: ['dist']
        },
        concat: {
            options: {
                banner: '<%= banner %>',
                stripBanners: true
            },
            dist: {
                src: ['src/<%= pkg.name %>.js'],
                dest: 'dist/<%= pkg.name %>.js'
            },
        },
        uglify: {
            options: {
                banner: '<%= banner %>'
            },
            dist: {
                src: '<%= concat.dist.dest %>',
                dest: 'dist/<%= pkg.name %>.min.js'
            },
        },
        qunit: {
            files: ['test/**/*.html']
        },
        jshint: {
            gruntfile: {
                options: {
                    jshintrc: '.jshintrc'
                },
                src: 'Gruntfile.js'
            },
            src: {
                options: {
                    jshintrc: 'src/.jshintrc'
                },
                src: ['src/**/*.js']
            },
            test: {
                options: {
                    jshintrc: 'test/.jshintrc'
                },
                src: ['test/**/*.js']
            },
        },
        watch: {
            gruntfile: {
                files: '<%= jshint.gruntfile.src %>',
                tasks: ['jshint:gruntfile']
            },
            src: {
                files: '<%= jshint.src.src %>',
                tasks: ['jshint:src', 'qunit']
            },
            test: {
                files: '<%= jshint.test.src %>',
                tasks: ['jshint:test', 'qunit']
            },
        },
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');

    // Default task.
    grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify']);

};
<commit_msg>Linting is the default task<commit_after>'use strict';

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('eui.jquery.json'),
        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
                '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
                '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
                '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
                ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
        // Task configuration.
        clean: {
            files: ['dist']
        },
        concat: {
            options: {
                banner: '<%= banner %>',
                stripBanners: true
            },
            dist: {
                src: ['src/<%= pkg.name %>.js'],
                dest: 'dist/<%= pkg.name %>.js'
            },
        },
        uglify: {
            options: {
                banner: '<%= banner %>'
            },
            dist: {
                src: '<%= concat.dist.dest %>',
                dest: 'dist/<%= pkg.name %>.min.js'
            },
        },
        qunit: {
            files: ['test/**/*.html']
        },
        jshint: {
            gruntfile: {
                options: {
                    jshintrc: '.jshintrc'
                },
                src: 'Gruntfile.js'
            },
            src: {
                options: {
                    jshintrc: 'src/.jshintrc'
                },
                src: ['src/**/*.js']
            },
            test: {
                options: {
                    jshintrc: 'test/.jshintrc'
                },
                src: ['test/**/*.js']
            },
        },
        watch: {
            gruntfile: {
                files: '<%= jshint.gruntfile.src %>',
                tasks: ['jshint:gruntfile']
            },
            src: {
                files: '<%= jshint.src.src %>',
                tasks: ['jshint:src', 'qunit']
            },
            test: {
                files: '<%= jshint.test.src %>',
                tasks: ['jshint:test', 'qunit']
            },
        },
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');

    // Default task.
    grunt.registerTask('check', ['jshint']);
    // Default task.
    grunt.registerTask('default', ['check']);

};
<|endoftext|>


<commit_before>
'use strict';

module.exports = function (grunt) {
    // show elapsed time at the end
    require('time-grunt')(grunt);
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    var _ = require('underscore')._;

    var reloadPort = 35729, files;

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        browserify: {
            options: {
                debug: true,
                extensions: ['.jsx'],
                transform: ['reactify']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {
                options: {
                    debug: false
                },
                src: '<%= browserify.devApp.src %>',
                dest: '<%= browserify.devApp.dest %>'
            }
        },

        build: {
            app: {
                options: {
                    developTasks: ['browserify:devApp', 'stylus:devApp', 'copy:app'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app']
                }
            }
        },

        copy: {
            app: {
                files: [
                    { expand: true, cwd: './public', src: 'index.html', dest: './dist/app' },
                    { expand: true, cwd: './public', src: 'css/**/*.css', dest: './dist/app/css', flatten: true },
                    { expand: true, cwd: './public', src: 'img/**/*.*', dest: './dist/app' }]
            }
        },

        express: {
            options: {
                script: 'app.js'
            },

            devApp: {
                node_env: 'develop'
            },

            prodApp: {
                node_env: 'production'
            }
        },

        run: {
            app: {
                options: {
                    developTasks: ['watchify:devApp', 'stylus:devApp', 'copy:app', 'express:devApp', 'watch'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app', 'express:prodApp', 'keepalive']
                }
            }
        },

        stylus: {
            devApp: {
                files: {
                    './dist/app/css/style.css': ['./public/css/**/*.styl'],
                }
            },

            prodApp: {
                options: {
                    compress: true
                },

                files: '<%= stylus.devApp.files %>'
            }
        },

        watch: {
            options: {
                nospawn: true,
                livereload: reloadPort
            },
            server: {
                files: [
                    'app.js',
                    'model/*.js',
                    'routes/*.js'
                ],
                tasks: ['express:devApp', 'delayed-livereload']
            },
            js: {
                files: ['public/js/*.js', 'dist/js/*.js'],
                options: {
                  livereload: reloadPort
                }
            },
            css: {
                files: ['public/css/*.css'],
                options: {
                  livereload: reloadPort
                }
            },
            jade: {
                files: ['views/*.jade'],
                options: {
                  livereload: reloadPort
                }
            }
        },

        watchify: {
            options: {
                debug: true,
                transform: ['reactify'],
                extensions: ['.jsx']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {
                options: {
                    debug: false
                },
                src: '<%= watchify.dev.src %>',
                dest: '<%= watchify.dev.dest %>'
            }
        }
    });

    grunt.config.requires('watch.server.files');
    files = grunt.config('watch.server.files');
    files = grunt.file.expand(files);

    grunt.registerTask('delayed-livereload', 'Live reload after the node server has restarted.', function () {
        var request = require('request')
          , done = this.async();

        setTimeout(function () {
            request.get('http://localhost:' + reloadPort + '/changed?files=' + files.join(','),  function (err, res) {
                var reloaded = !err && res.statusCode === 200;
                if (reloaded) {
                    grunt.log.ok('Delayed live reload successful.');
                } else {
                    grunt.log.error('Unable to make a delayed live reload.');
                }
                done(reloaded);
            });
        }, 500);
    });

    grunt.registerMultiTask('build', 'Build and deploy application targets', function () {
        grunt.log.writeln('Building target "' + this.target + '"...');

        var options = this.options()
          , developMode = this.flags.develop
          , tasks = developMode
                ? options.developTasks
                : options.productionTasks;

        grunt.task.run(tasks);
    });

    grunt.registerMultiTask('run', 'Run application targets', function () {
        grunt.log.writeln('Running target "' + this.target + '"...');

        var options = this.options()
          , developMode = this.flags.develop
          , tasks = developMode
                ? options.developTasks
                : options.productionTasks;

        grunt.task.run(tasks);
    });

    grunt.registerTask('default', ['run:app:develop']);
};
<commit_msg>removed usage of time-grunt, as it was causing deployment to crash<commit_after>
'use strict';

module.exports = function (grunt) {
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    var _ = require('underscore')._;

    var reloadPort = 35729, files;

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        browserify: {
            options: {
                debug: true,
                extensions: ['.jsx'],
                transform: ['reactify']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {
                options: {
                    debug: false
                },
                src: '<%= browserify.devApp.src %>',
                dest: '<%= browserify.devApp.dest %>'
            }
        },

        build: {
            app: {
                options: {
                    developTasks: ['browserify:devApp', 'stylus:devApp', 'copy:app'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app']
                }
            }
        },

        copy: {
            app: {
                files: [
                    { expand: true, cwd: './public', src: 'index.html', dest: './dist/app' },
                    { expand: true, cwd: './public', src: 'css/**/*.css', dest: './dist/app/css', flatten: true },
                    { expand: true, cwd: './public', src: 'img/**/*.*', dest: './dist/app' }]
            }
        },

        express: {
            options: {
                script: 'app.js'
            },

            devApp: {
                node_env: 'develop'
            },

            prodApp: {
                node_env: 'production'
            }
        },

        run: {
            app: {
                options: {
                    developTasks: ['watchify:devApp', 'stylus:devApp', 'copy:app', 'express:devApp', 'watch'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app', 'express:prodApp', 'keepalive']
                }
            }
        },

        stylus: {
            devApp: {
                files: {
                    './dist/app/css/style.css': ['./public/css/**/*.styl'],
                }
            },

            prodApp: {
                options: {
                    compress: true
                },

                files: '<%= stylus.devApp.files %>'
            }
        },

        watch: {
            options: {
                nospawn: true,
                livereload: reloadPort
            },
            server: {
                files: [
                    'app.js',
                    'model/*.js',
                    'routes/*.js'
                ],
                tasks: ['express:devApp', 'delayed-livereload']
            },
            js: {
                files: ['public/js/*.js', 'dist/js/*.js'],
                options: {
                  livereload: reloadPort
                }
            },
            css: {
                files: ['public/css/*.css'],
                options: {
                  livereload: reloadPort
                }
            },
            jade: {
                files: ['views/*.jade'],
                options: {
                  livereload: reloadPort
                }
            }
        },

        watchify: {
            options: {
                debug: true,
                transform: ['reactify'],
                extensions: ['.jsx']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {
                options: {
                    debug: false
                },
                src: '<%= watchify.dev.src %>',
                dest: '<%= watchify.dev.dest %>'
            }
        }
    });

    grunt.config.requires('watch.server.files');
    files = grunt.config('watch.server.files');
    files = grunt.file.expand(files);

    grunt.registerTask('delayed-livereload', 'Live reload after the node server has restarted.', function () {
        var request = require('request')
          , done = this.async();

        setTimeout(function () {
            request.get('http://localhost:' + reloadPort + '/changed?files=' + files.join(','),  function (err, res) {
                var reloaded = !err && res.statusCode === 200;
                if (reloaded) {
                    grunt.log.ok('Delayed live reload successful.');
                } else {
                    grunt.log.error('Unable to make a delayed live reload.');
                }
                done(reloaded);
            });
        }, 500);
    });

    grunt.registerMultiTask('build', 'Build and deploy application targets', function () {
        grunt.log.writeln('Building target "' + this.target + '"...');

        var options = this.options()
          , developMode = this.flags.develop
          , tasks = developMode
                ? options.developTasks
                : options.productionTasks;

        grunt.task.run(tasks);
    });

    grunt.registerMultiTask('run', 'Run application targets', function () {
        grunt.log.writeln('Running target "' + this.target + '"...');

        var options = this.options()
          , developMode = this.flags.develop
          , tasks = developMode
                ? options.developTasks
                : options.productionTasks;

        grunt.task.run(tasks);
    });

    grunt.registerTask('default', ['run:app:develop']);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		// Metadata.
		pkg: grunt.file.readJSON('jquery-ui-timepicker-addon.json'),
		banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
			'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
			'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
			'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
			' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
		// Task configuration.
		clean: {
			files: ['dist']
		},
		copy: {
			dist: {
				files: [
					//{ src: 'src/index.html', dest: 'dist/index.html' },
					{ src: 'src/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' },
					{ src: 'src/i18n/jquery-ui-timepicker-*.js', dest: 'dist/i18n/', expand:true, flatten: true },
				]
			}
		},
		concat: {
			dist: {
				options: {
					banner: '<%= banner %>',
					stripBanners: true
				},
				src: ['src/<%= pkg.name %>.js'],
				dest: 'dist/<%= pkg.name %>.js'
			},
			docs: {
				src: [
						'src/docs/header.html',
						'src/docs/intro.html',
						'src/docs/options.html',
						'src/docs/formatting.html',
						'src/docs/i18n.html',
						'src/docs/examples.html',
						'src/docs/footer.html'
					],
				dest: 'dist/index.html'
			}
		},
		uglify: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: '<%= concat.dist.dest %>',
				dest: 'dist/<%= pkg.name %>.min.js'
			},
		},
		cssmin: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: 'dist/<%= pkg.name %>.css',
				dest: 'dist/<%= pkg.name %>.min.css'
			},
		},
		jasmine: {
			src: 'src/<%= pkg.name %>.js',
			options: {
				specs: 'test/*_spec.js',
				vendor: [
						'http://code.jquery.com/jquery-1.10.1.min.js',
						'http://code.jquery.com/ui/1.10.3/jquery-ui.min.js',
						'http://github.com/searls/jasmine-fixture/releases/1.0.5/1737/jasmine-fixture.js'
					]
			}
		},
		jshint: {
			gruntfile: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: 'Gruntfile.js'
			},
			src: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: ['src/**/*.js']
			},
			test: {
				options: {
					jshintrc: 'test/.jshintrc'
				},
				src: ['test/**/*.js']
			},
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: ['jshint:gruntfile']
			},
			src: {
				files: 'src/**',//'<%= jshint.src.src %>',
				tasks: ['jshint:src', 'clean', 'less', 'copy', 'concat', 'uglify', 'cssmin']
			},
			test: {
				files: '<%= jshint.test.src %>',
				tasks: ['jshint:test', 'jasmine']
			},
		},
	});

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-contrib-jasmine');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');

	// Default task.
	grunt.registerTask('default', ['jshint', 'jasmine', 'clean', 'copy', 'concat', 'uglify', 'cssmin']);

};
<commit_msg>Minor gruntfile cleanup<commit_after>'use strict';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		// Metadata.
		pkg: grunt.file.readJSON('jquery-ui-timepicker-addon.json'),
		banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
			'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
			'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
			'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
			' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
		// Task configuration.
		clean: {
			files: ['dist']
		},
		copy: {
			dist: {
				files: [
					//{ src: 'src/index.html', dest: 'dist/index.html' },
					{ src: 'src/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' },
					{ src: 'src/i18n/jquery-ui-timepicker-*.js', dest: 'dist/i18n/', expand:true, flatten: true }
				]
			}
		},
		concat: {
			dist: {
				options: {
					banner: '<%= banner %>',
					stripBanners: true
				},
				src: ['src/<%= pkg.name %>.js'],
				dest: 'dist/<%= pkg.name %>.js'
			},
			docs: {
				src: [
						'src/docs/header.html',
						'src/docs/intro.html',
						'src/docs/options.html',
						'src/docs/formatting.html',
						'src/docs/i18n.html',
						'src/docs/examples.html',
						'src/docs/footer.html'
					],
				dest: 'dist/index.html'
			}
		},
		uglify: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: '<%= concat.dist.dest %>',
				dest: 'dist/<%= pkg.name %>.min.js'
			}
		},
		cssmin: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: 'dist/<%= pkg.name %>.css',
				dest: 'dist/<%= pkg.name %>.min.css'
			}
		},
		jasmine: {
			src: 'src/<%= pkg.name %>.js',
			options: {
				specs: 'test/*_spec.js',
				vendor: [
						'http://code.jquery.com/jquery-1.10.1.min.js',
						'http://code.jquery.com/ui/1.10.3/jquery-ui.min.js',
						'http://github.com/searls/jasmine-fixture/releases/1.0.5/1737/jasmine-fixture.js'
					]
			}
		},
		jshint: {
			gruntfile: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: 'Gruntfile.js'
			},
			src: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: ['src/**/*.js']
			},
			test: {
				options: {
					jshintrc: 'test/.jshintrc'
				},
				src: ['test/**/*.js']
			}
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: ['jshint:gruntfile']
			},
			src: {
				files: 'src/**',//'<%= jshint.src.src %>',
				tasks: ['jshint:src', 'clean', 'less', 'copy', 'concat', 'uglify', 'cssmin']
			},
			test: {
				files: '<%= jshint.test.src %>',
				tasks: ['jshint:test', 'jasmine']
			}
		}
	});

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-contrib-jasmine');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');

	// Default task.
	grunt.registerTask('default', ['jshint', 'jasmine', 'clean', 'copy', 'concat', 'uglify', 'cssmin']);

};
<|endoftext|>


<commit_before>// Generated on 2013-12-19 using generator-angular 0.6.0
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: {
      // configurable paths
      app: require('./bower.json').appPath || 'app',
      dist: 'dist'
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      options: {
        spawn: false
      },
      js: {
        files: ['{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all', 'karma:background:run']
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma:background:run']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      svg2png: {
        files: ['<%= yeoman.app %>/images/*.svg'],
        tasks: ['svg2png']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      }
      // livereload: {
      //   options: {
      //     livereload: '<%= connect.options.livereload %>'
      //   },
      //   files: [
      //     '<%= yeoman.app %>/{,*/}*.html',
      //     '.tmp/styles/{,*/}*.css',
      //     '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
      //   ]
      // }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: '0.0.0.0',
        livereload: 35729
      },
      // livereload: {
      //   options: {
      //     open: true,
      //     base: [
      //       '.tmp',
      //       '<%= yeoman.app %>'
      //     ]
      //   }
      // },
      test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      },
      dist: {
        options: {
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        'Gruntfile.js',
        '<%= yeoman.app %>/scripts/{,*/}*.js'
      ],
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/*',
            '!<%= yeoman.dist %>/.git*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: '<%= yeoman.app %>/bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

    svg2png: {
      all: {
        files: [{
          src: [
            '<%= yeoman.app %>/images/icon-*.svg'
          ],
          dest: '.tmp/images'
        }]
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= yeoman.dist %>/scripts/{,*/}*.js',
            '<%= yeoman.dist %>/styles/{,*/}*.css',
            '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= yeoman.dist %>/styles/fonts/*'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>'
      }
    },

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      js: [
        '<%= yeoman.dist %>/scripts/{,*/}*.js',
        '!<%= yeoman.dist %>/scripts/*worker.js'
      ],
      worker: ['<%= yeoman.dist %>/scripts/*worker.js'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>'],
        patterns: {
          js: [
            [
              /Worker\(['"]([^'"]+.js)['"]\)/,
              'Replacing reference to Worker URLs'
            ]
          ],
          worker: [
            [
              /importScripts\(['"]([^'"]+\.js)['"]\)/,
              'Replacing reference to lib.js',
              function (m) { return 'scripts/' + m; },
              function (m) { return m.replace(/^scripts\//, ''); }
            ]
          ]
        }
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },
    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },
    htmlmin: {
      dist: {
        options: {
          // Optional configurations that you can uncomment to use
          // removeCommentsFromCDATA: true,
          // collapseBooleanAttributes: true,
          // removeAttributeQuotes: true,
          // removeRedundantAttributes: true,
          // useShortDoctype: true,
          // removeEmptyAttributes: true,
          // removeOptionalTags: true*/
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>',
          src: ['*.html', 'views/*.html', 'templates/*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // Allow the use of non-minsafe AngularJS files. Automatically makes it
    // minsafe compatible so Uglify does not destroy the ng references
    ngmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            'bower_components/**/*',
            'images/{,*/}*.{webp}',
            'fonts/*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: [
            'icon-*.png',
            'generated/*'
          ]
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server',
        'svg2png',
        'copy:styles'
      ],
      test: [
        'compass',
        'copy:styles'
      ],
      dist: [
        'compass:dist',
        'svg2png',
        'copy:styles',
        'imagemin',
        'svgmin',
        'htmlmin'
      ]
    },

    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css',
    //         '<%= yeoman.app %>/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    // Test settings
    karma: {
      options: {
        configFile: 'karma.conf.js'
      },
      background: {
        singleRun: false,
        background: true,
        runnerPort: 9999
      },
      continuous: {
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'concurrent:server',
      'autoprefixer',
      // 'connect:livereload',
      'livereload',
      'karma:background',
      'watch'
    ]);
  });

  grunt.registerTask('livereload', 'Spawn a separate process for LiveReload', function () {
    grunt.util.spawn({
      grunt: true,
      args: ['--gruntfile', 'Gruntfile-LR.js']
    }, function (error, result, code) {
      console.log(error, result, code);
    });
  });

  grunt.registerTask('test', [
    'clean:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma:continuous'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'rev',
    'usemin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<commit_msg>chore(build): apply newer to svg2png<commit_after>// Generated on 2013-12-19 using generator-angular 0.6.0
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: {
      // configurable paths
      app: require('./bower.json').appPath || 'app',
      dist: 'dist'
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      options: {
        spawn: false
      },
      js: {
        files: ['{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all', 'karma:background:run']
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma:background:run']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      svg2png: {
        files: ['<%= yeoman.app %>/images/*.svg'],
        tasks: ['newer:svg2png']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      }
      // livereload: {
      //   options: {
      //     livereload: '<%= connect.options.livereload %>'
      //   },
      //   files: [
      //     '<%= yeoman.app %>/{,*/}*.html',
      //     '.tmp/styles/{,*/}*.css',
      //     '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
      //   ]
      // }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: '0.0.0.0',
        livereload: 35729
      },
      // livereload: {
      //   options: {
      //     open: true,
      //     base: [
      //       '.tmp',
      //       '<%= yeoman.app %>'
      //     ]
      //   }
      // },
      test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      },
      dist: {
        options: {
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        'Gruntfile.js',
        '<%= yeoman.app %>/scripts/{,*/}*.js'
      ],
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/*',
            '!<%= yeoman.dist %>/.git*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: '<%= yeoman.app %>/bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

    svg2png: {
      all: {
        files: [{
          src: [
            '<%= yeoman.app %>/images/icon-*.svg'
          ],
          dest: '.tmp/images'
        }]
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= yeoman.dist %>/scripts/{,*/}*.js',
            '<%= yeoman.dist %>/styles/{,*/}*.css',
            '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= yeoman.dist %>/styles/fonts/*'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>'
      }
    },

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      js: [
        '<%= yeoman.dist %>/scripts/{,*/}*.js',
        '!<%= yeoman.dist %>/scripts/*worker.js'
      ],
      worker: ['<%= yeoman.dist %>/scripts/*worker.js'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>'],
        patterns: {
          js: [
            [
              /Worker\(['"]([^'"]+.js)['"]\)/,
              'Replacing reference to Worker URLs'
            ]
          ],
          worker: [
            [
              /importScripts\(['"]([^'"]+\.js)['"]\)/,
              'Replacing reference to lib.js',
              function (m) { return 'scripts/' + m; },
              function (m) { return m.replace(/^scripts\//, ''); }
            ]
          ]
        }
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },
    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },
    htmlmin: {
      dist: {
        options: {
          // Optional configurations that you can uncomment to use
          // removeCommentsFromCDATA: true,
          // collapseBooleanAttributes: true,
          // removeAttributeQuotes: true,
          // removeRedundantAttributes: true,
          // useShortDoctype: true,
          // removeEmptyAttributes: true,
          // removeOptionalTags: true*/
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>',
          src: ['*.html', 'views/*.html', 'templates/*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // Allow the use of non-minsafe AngularJS files. Automatically makes it
    // minsafe compatible so Uglify does not destroy the ng references
    ngmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            'bower_components/**/*',
            'images/{,*/}*.{webp}',
            'fonts/*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: [
            'icon-*.png',
            'generated/*'
          ]
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server',
        'svg2png',
        'copy:styles'
      ],
      test: [
        'compass',
        'copy:styles'
      ],
      dist: [
        'compass:dist',
        'svg2png',
        'copy:styles',
        'imagemin',
        'svgmin',
        'htmlmin'
      ]
    },

    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css',
    //         '<%= yeoman.app %>/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    // Test settings
    karma: {
      options: {
        configFile: 'karma.conf.js'
      },
      background: {
        singleRun: false,
        background: true,
        runnerPort: 9999
      },
      continuous: {
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'concurrent:server',
      'autoprefixer',
      // 'connect:livereload',
      'livereload',
      'karma:background',
      'watch'
    ]);
  });

  grunt.registerTask('livereload', 'Spawn a separate process for LiveReload', function () {
    grunt.util.spawn({
      grunt: true,
      args: ['--gruntfile', 'Gruntfile-LR.js']
    }, function (error, result, code) {
      console.log(error, result, code);
    });
  });

  grunt.registerTask('test', [
    'clean:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma:continuous'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'rev',
    'usemin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
    'use strict';

    var pkg = grunt.file.readJSON('package.json'),
        dirs = {
            build: 'build',
            release: 'dist',
            tasks: 'tasks',
            source: 'src',
            test: 'test',
            unit: 'test/unit',
            typings: 'src/typings',
            benchmark: 'benchmark'
        },
        files = {
            main: 'multiplex.js',
            minified: 'multiplex.min.js',
            typings: 'multiplex.d.ts'
        },
        lint = [
            'Gruntfile.js',
            dirs.source + '/**/*.js',
            dirs.tasks + '/**/*.js',
            dirs.test + '/**/*.js'
        ],
        banner = [
            '/*!',
            '* ' + pkg.title + ' - ' + pkg.description,
            '* Version ' + pkg.version + ' (' + grunt.template.today('mmmm dd, yyyy') + ')',
            '',
            '* Created and maintained by Kamyar Nazeri <Kamyar.Nazeri@yahoo.com>',
            '* Licensed under MIT License',
            '* ' + pkg.homepage,
            '*/',
            ''
        ].join('\n');

    grunt.initConfig({
        pkg: pkg,
        dirs: dirs,
        files: files,
        lint: lint,
        banner: banner
    });

    // load grunt tasks
    grunt.loadTasks(dirs.tasks);

    // load grunt tasks from NPM packages
    require('load-grunt-tasks')(grunt);

    // linting
    grunt.registerTask('lint', ['jshint', 'jscs']);

    // test tasks
    grunt.registerTask('test', ['build', 'qtest']);

    // default task
    grunt.registerTask('default', ['lint', 'test']);

    // travis build task
    grunt.registerTask('build:travis', ['default']);

    // releasing a new version
    grunt.registerTask('release', [
        'clean:release',
        'default',
        'copy:release'
    ]);
};
<commit_msg>include testrunner in grunt<commit_after>module.exports = function (grunt) {
    'use strict';

    var pkg = grunt.file.readJSON('package.json'),
        dirs = {
            build: 'build',
            release: 'dist',
            tasks: 'tasks',
            source: 'src',
            test: 'test',
            unit: 'test/unit',
            typings: 'src/typings',
            benchmark: 'benchmark'
        },
        files = {
            main: 'multiplex.js',
            minified: 'multiplex.min.js',
            typings: 'multiplex.d.ts',
            testrunner: 'testrunner'
        },
        lint = [
            'Gruntfile.js',
            dirs.source + '/**/*.js',
            dirs.tasks + '/**/*.js',
            dirs.test + '/**/*.js'
        ],
        banner = [
            '/*!',
            '* ' + pkg.title + ' - ' + pkg.description,
            '* Version ' + pkg.version + ' (' + grunt.template.today('mmmm dd, yyyy') + ')',
            '',
            '* Created and maintained by Kamyar Nazeri <Kamyar.Nazeri@yahoo.com>',
            '* Licensed under MIT License',
            '* ' + pkg.homepage,
            '*/',
            ''
        ].join('\n');

    grunt.initConfig({
        pkg: pkg,
        dirs: dirs,
        files: files,
        lint: lint,
        banner: banner
    });

    // load grunt tasks
    grunt.loadTasks(dirs.tasks);

    // load grunt tasks from NPM packages
    require('load-grunt-tasks')(grunt);

    // linting
    grunt.registerTask('lint', ['jshint', 'jscs']);

    // test tasks
    grunt.registerTask('test', ['build', 'qtest']);

    // default task
    grunt.registerTask('default', ['lint', 'test']);

    // travis build task
    grunt.registerTask('build:travis', ['default']);

    // releasing a new version
    grunt.registerTask('release', [
        'clean:release',
        'default',
        'copy:release'
    ]);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  "use strict";
  grunt.loadNpmTasks("grunt-contrib-requirejs");

  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),
    requirejs: {
      compile: {
        options: {
          baseUrl: "js/",
          mainConfigFile: "static/js/main.js",
          appDir: "static/",
          dir: "static-built/",
          skipDirOptimize: true,
          generateSourceMaps: false,
          findNestedDependencies: true,
          preserveLicenseComments: false,
          removeCombined: true,
          uglify2: {
            mangle: false
          },
          modules: [
            {
              name: "main",
              exclude: ["vendor-angular", "vendor-bootstrap", "vendor-jquery", "vendor-misc"]
            },
            {
              name: "vendor-angular"
            },
            {
              name: "vendor-bootstrap"
            },
            {
              name: "vendor-jquery"
            },
            {
              name: "vendor-misc"
            }
          ],
          optimize: "uglify2",
          optimizeCss: "none"
        }
      }
    }
  });
};
<commit_msg>Enable wrapShim<commit_after>module.exports = function(grunt) {
  "use strict";
  grunt.loadNpmTasks("grunt-contrib-requirejs");

  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),
    requirejs: {
      compile: {
        options: {
          baseUrl: "js/",
          mainConfigFile: "static/js/main.js",
          appDir: "static/",
          dir: "static-built/",
          skipDirOptimize: true,
          generateSourceMaps: false,
          findNestedDependencies: true,
          preserveLicenseComments: false,
          removeCombined: true,
          uglify2: {
            mangle: false
          },
          modules: [
            {
              name: "main",
              exclude: ["vendor-angular", "vendor-bootstrap", "vendor-jquery", "vendor-misc"]
            },
            {
              name: "vendor-angular"
            },
            {
              name: "vendor-bootstrap"
            },
            {
              name: "vendor-jquery"
            },
            {
              name: "vendor-misc"
            }
          ],
          optimize: "uglify2",
          optimizeCss: "none",
          wrapShim: 'true'
        }
      }
    }
  });
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
	'use strict';

	grunt.initConfig({
		reduce: {
			root: 'public',
			outRoot: 'dist',
			less: false,
			asyncScripts: false
		},
		handlebars: {
			options: {
				namespace: false
			},
			compile: {
				files: {
					'public/js/tweet.handlebars.js': 'templates/tweet.handlebars'
				}
			}
		}
	});

	grunt.loadNpmTasks('grunt-reduce');
	grunt.loadNpmTasks('grunt-contrib-handlebars');

	grunt.registerTask('default', ['handlebars', 'reduce']);
};
<commit_msg>Corrected grunt-contrib-handlebars options<commit_after>module.exports = function (grunt) {
	'use strict';

	grunt.initConfig({
		reduce: {
			root: 'public',
			outRoot: 'dist',
			less: false,
			asyncScripts: false
		},
		handlebars: {
			options: {
				namespace: 'Handlebars.templates',
				processName: function (filename) {
					var pieces = filename.split('/');
					return pieces[pieces.length - 1].replace(/\.handlebars$/, '');
				}
			},
			compile: {
				files: {
					'public/js/tweet.handlebars.js': 'templates/tweet.handlebars'
				}
			}
		}
	});

	grunt.loadNpmTasks('grunt-reduce');
	grunt.loadNpmTasks('grunt-contrib-handlebars');

	grunt.registerTask('default', ['handlebars', 'reduce']);
};
<|endoftext|>


<commit_before>/* jshint node: true */
'use strict';
var path = require('path');

function autoBuild(project, verbose, stack) {
  var args = ['auto-build'];

  if (verbose) { args.unshift('--verbose'); }
  if (stack) { args.unshift('--stack'); }

  return {
    opts: {
      cwd: path.resolve(__dirname, '../'+ project)
    },
    // cmd: './node_modules/grunt-cli/bin/grunt',
    cmd: 'grunt',
    args: args
  };
}

function clone(project) {
  return {
    opts: {
      cwd: __dirname +'/../'
    },
    cmd: 'git',
    args: [
      'clone',
      'git@github.com:camunda/'+ project +'.git',
    ]
  };
}

function linkFrom(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: 'npm',
    args: [
      'link'
    ]
  };
}

function bonerInstall(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: './node_modules/bower/bin/bower',
    args: [
      'install'
    ]
  };
}

function linkTo(project) {
  return {
    opts: {},
    cmd: 'npm',
    args: [
      'link',
      project
    ]
  };
}

module.exports = function(grunt) {
  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  var verbose = grunt.option('verbose');
  var stack = grunt.option('stack');

  grunt.initConfig({
    parallel: {
      clone: {
        options: {
          stream: true
        },
        tasks: [
          clone('camunda-bpm-sdk-js'),
          clone('camunda-commons-ui'),
          clone('camunda-admin-ui'),
          clone('camunda-cockpit-ui'),
          clone('camunda-tasklist-ui'),
          clone('camunda-cockpit-plugin-base')
        ]
      },

      linkFrom: {
        options: {
          stream: true
        },
        tasks: [
          linkFrom('camunda-bpm-sdk-js'),
          linkFrom('camunda-commons-ui'),
          linkFrom('camunda-admin-ui'),
          linkFrom('camunda-cockpit-ui'),
          linkFrom('camunda-tasklist-ui'),
          // linkFrom('camunda-cockpit-plugin-base')
        ]
      },

      bonerInstall: {
        options: {
          stream: true
        },
        tasks: [
          // bonerInstall('camunda-bpm-sdk-js'),
          // bonerInstall('camunda-commons-ui'),
          bonerInstall('camunda-admin-ui'),
          bonerInstall('camunda-cockpit-ui'),
          bonerInstall('camunda-tasklist-ui'),
          // bonerInstall('camunda-cockpit-plugin-base')
        ]
      },

      linkTo: {
        options: {
          stream: true
        },
        tasks: [
          linkTo('camunda-bpm-sdk-js'),
          linkTo('camunda-commons-ui'),
          linkTo('camunda-admin-ui'),
          linkTo('camunda-cockpit-ui'),
          linkTo('camunda-tasklist-ui'),
          // linkTo('camunda-cockpit-plugin-base')
        ]
      },

      develop: {
        options: {
          stream: true
        },
        tasks: [
          {
            opts: {
              cwd: path.resolve(__dirname, './webapp')
            },
            cmd: 'mvn',
            args: [
              'clean',
              'install',
              'jetty:run',
              '-DskipTests',
              '-Pdevelop,livereload',
              //'-o'
            ]
          },
          autoBuild('camunda-bpm-sdk-js', verbose, stack),
          // autoBuild('camunda-commons-ui', verbose, stack),
          autoBuild('camunda-admin-ui', verbose, stack),
          autoBuild('camunda-cockpit-ui', verbose, stack),
          autoBuild('camunda-tasklist-ui', verbose, stack)
        ]
      }
    }
  });

  grunt.registerTask('setup', [
    'parallel:clone',
    'parallel:linkFrom',
    'parallel:bonerInstall',
    'parallel:linkTo'
  ]);

  grunt.registerTask('default', ['parallel:develop']);
};
<commit_msg>improve(grunt): allow to switch the -o flag for mvn command<commit_after>/* jshint node: true */
'use strict';
var path = require('path');

function autoBuild(project, verbose, stack) {
  var args = ['auto-build'];

  if (verbose) { args.unshift('--verbose'); }
  if (stack) { args.unshift('--stack'); }

  return {
    opts: {
      cwd: path.resolve(__dirname, '../'+ project)
    },
    // cmd: './node_modules/grunt-cli/bin/grunt',
    cmd: 'grunt',
    args: args
  };
}

function clone(project) {
  return {
    opts: {
      cwd: __dirname +'/../'
    },
    cmd: 'git',
    args: [
      'clone',
      'git@github.com:camunda/'+ project +'.git',
    ]
  };
}

function linkFrom(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: 'npm',
    args: [
      'link'
    ]
  };
}

function bonerInstall(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: './node_modules/bower/bin/bower',
    args: [
      'install'
    ]
  };
}

function linkTo(project) {
  return {
    opts: {},
    cmd: 'npm',
    args: [
      'link',
      project
    ]
  };
}

module.exports = function(grunt) {
  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  var verbose = grunt.option('verbose');
  var stack = grunt.option('stack');
  var webappArgs = [
    'clean',
    'install',
    'jetty:run',
    '-DskipTests',
    '-Pdevelop,livereload',
  ];

  if (!grunt.option('update')) {
    webappArgs.push('-o');
  }

  grunt.initConfig({
    parallel: {
      clone: {
        options: {
          stream: true
        },
        tasks: [
          clone('camunda-bpm-sdk-js'),
          clone('camunda-commons-ui'),
          clone('camunda-admin-ui'),
          clone('camunda-cockpit-ui'),
          clone('camunda-tasklist-ui'),
          clone('camunda-cockpit-plugin-base')
        ]
      },

      linkFrom: {
        options: {
          stream: true
        },
        tasks: [
          linkFrom('camunda-bpm-sdk-js'),
          linkFrom('camunda-commons-ui'),
          linkFrom('camunda-admin-ui'),
          linkFrom('camunda-cockpit-ui'),
          linkFrom('camunda-tasklist-ui'),
          // linkFrom('camunda-cockpit-plugin-base')
        ]
      },

      bonerInstall: {
        options: {
          stream: true
        },
        tasks: [
          // bonerInstall('camunda-bpm-sdk-js'),
          // bonerInstall('camunda-commons-ui'),
          bonerInstall('camunda-admin-ui'),
          bonerInstall('camunda-cockpit-ui'),
          bonerInstall('camunda-tasklist-ui'),
          // bonerInstall('camunda-cockpit-plugin-base')
        ]
      },

      linkTo: {
        options: {
          stream: true
        },
        tasks: [
          linkTo('camunda-bpm-sdk-js'),
          linkTo('camunda-commons-ui'),
          linkTo('camunda-admin-ui'),
          linkTo('camunda-cockpit-ui'),
          linkTo('camunda-tasklist-ui'),
          // linkTo('camunda-cockpit-plugin-base')
        ]
      },

      develop: {
        options: {
          stream: true
        },
        tasks: [
          {
            opts: {
              cwd: path.resolve(__dirname, './webapp')
            },
            cmd: 'mvn',
            args: webappArgs
          },
          autoBuild('camunda-bpm-sdk-js', verbose, stack),
          // autoBuild('camunda-commons-ui', verbose, stack),
          autoBuild('camunda-admin-ui', verbose, stack),
          autoBuild('camunda-cockpit-ui', verbose, stack),
          autoBuild('camunda-tasklist-ui', verbose, stack)
        ]
      }
    }
  });

  grunt.registerTask('setup', [
    'parallel:clone',
    'parallel:linkFrom',
    'parallel:bonerInstall',
    'parallel:linkTo'
  ]);

  grunt.registerTask('default', ['parallel:develop']);
};
<|endoftext|>