<commit_before>/*
 * grunt-draw-my-project
 * http://manland.github.io/draw-my-project
 *
 * Copyright (c) 2014 Romain Maneschi
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  var gruntConfig = require( './gruntConfig.js' );

  var taskConfig = {
    pkg: grunt.file.readJSON("package.json"),
    meta: {
      banner:
        '/**\n' +
        ' * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
        ' * <%= pkg.homepage %>\n' +
        ' *\n' +
        ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> : <%= pkg.author.url %>\n' +
        ' * Licensed <%= pkg.licenses[0].type %> <%= pkg.licenses[0].url %>\n' +
        ' */\n'
    },

    nodeunit: {
      tests: ['test/*_test.js'],
    },

    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js',
        '<%= app_files.js %>',
        '<%= test_files.js %>',
        '<%= nodeunit.tests %>'
      ],
      options: {
        jshintrc: '.jshintrc',
      },
    },

    // Before generating any new files, remove any previously-created files.
    clean: [
      'tmp',
      '<%= build_dir %>',
      '<%= compile_dir %>'
    ],

    copy: {
      build: {
        files: [
          {
            src: [
              '<%= app_files.js %>',
              '<%= app_files.tplHtml %>',
              '<%= vendor_files.js %>',
              '<%= app_files.assets %>',
              '<%= app_files.stylesheet %>'
            ],
            dest: '<%= build_dir %>/',
            cwd: '.',
            expand: true
          }
        ]
      },
      compile: {
        files: [
          {
            src: [ '**/*' ],
            dest: '<%= compile_dir %>/assets',
            cwd: '<%= build_dir %>/template_src/assets',
            expand: true
          }
        ]
      }
    },

    concat: {
      compile_js: {
        options: {
          banner: '<%= meta.banner %>'
        },
        src: [
          '<%= vendor_files.js %>',
          '<%= build_dir %>/template_src/src/**/*.js'
        ],
        dest: '<%= compile_dir %>/<%= pkg.name %>-<%= pkg.version %>.js'
      },
      compile_css: {
        options: {
          banner: '<%= meta.banner %>'
        },
        src: [
          'template_src/stylesheet/reset.css',
          '<%= app_files.stylesheet %>',
        ],
        dest: '<%= compile_dir %>/stylesheet/<%= pkg.name %>-<%= pkg.version %>.css'
      }
    },

    uglify: {
      compile: {
        options: {
          banner: '<%= meta.banner %>'
        },
        files: {
          '<%= concat.compile_js.dest %>': '<%= concat.compile_js.dest %>'
        }
      }
    },

    index: {
      build: {
        dir: '<%= build_dir %>/template_src',
        src: [
          '<%= vendor_files.js %>',
          '<%= app_files.js %>',
          '<%= build_dir %>/**/*.css'
        ]
      },
      compile: {
        dir: '<%= compile_dir %>',
        src: [
          '<%= concat.compile_js.dest %>',
          '<%= vendor_files.css %>',
          '<%= concat.compile_css.dest %>'
        ]
      }
    },

    watch: {
      files: [
        'tasks/*.js',
        '<%= app_files.html %>',
        '<%= app_files.js %>',
        '<%= vendor_files.js %>',
        '<%= app_files.assets %>',
        '<%= app_files.stylesheet %>',
        '<%= test_files.js %>'
      ],
      tasks: ['jshint', /*'karma:build:run',*/ 'build']
    },

    ngtemplates: {
      app: {
        src: 'src/**/*.tpl.html',
        cwd: 'template_src/',
        dest: '<%= build_dir %>/template_src/src/templates.js'
      }
    },

    // Configuration to be run (and then tested).
    draw_my_project: {
      options: {
        //templateFiles: ['template/d3.html', 'template/d3.js', 'template/d3.css']
        templateFiles: [
          'template/**/*'
        ]
      },
      simple: {
        options: {
          nbNodeByFile: 3
        },
        files: {
          'tmp/simple': ['test/fixtures/simple.js']
        }
      },
      complexe: {
        files: {
          'tmp/complexe': ['test/fixtures/complexe/**/*.js']
        }
      },
      skimbo: {
        options: {
          title: 'Skimbo',
          description: 'Manage your social life !',
          link: 'http://blog.skimbo.fr',
          favicon: 'assets/img/skimbo.png',
          urlLogo: 'assets/img/skimbo.png'
        },
        files: {
          'tmp/skimbo': ['test/fixtures/skimbo/**/*.js']
        }
      },
      sturvive: {
        options: {
          type: 'requirejs'
        },
        files: {
          'tmp/sturvive': ['test/fixtures/sturvive/**/*.js']
        }
      },
      goo: {
        options: {
          type: 'requirejs',
          nbNodeByFile: -1
        },
        files: {
          'tmp/goo': ['test/fixtures/goo-require.js']
        }
      },
      timeChecking: {
        options: {
          type: 'nodejs'
        },
        files: {
          'tmp/timeChecking': ['test/fixtures/timeChecking/**/*.js']
        }
      }

    }

  };

  grunt.loadTasks('tasks');

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-angular-templates');

  //TODO : mincss, minhtml, angularjstpl2js

  grunt.initConfig(grunt.util._.extend(taskConfig, gruntConfig));

  grunt.registerTask('test', ['draw_my_project', 'nodeunit']);
  grunt.registerTask('build', ['clean', 'copy:build', 'index:build', 'test']);
  grunt.registerTask('dev', ['jshint', 'build', 'watch']);
  grunt.registerTask('compile', ['jshint', 'build', 'ngtemplates', 'concat:compile_js', 'concat:compile_css', 'copy:compile', 'uglify:compile', 'index:compile', 'test']);
  grunt.registerTask('default', ['jshint', 'test']);

  grunt.registerMultiTask( 'index', 'Process index.html template', function () {
    var dirRE = new RegExp( '^('+this.data.dir+')\/', 'g' );

    function filterForJS ( files ) {
      return files.filter( function ( file ) {
        return file.match( /\.js$/ );
      });
    }

    function filterForCSS ( files ) {
      return files.filter( function ( file ) {
        return file.match( /\.css$/ );
      });
    }

    var jsFiles = filterForJS( this.filesSrc ).map( function ( file ) {
      return file.replace('template_src/', '').replace( dirRE, '' );
    });

    var cssFiles = filterForCSS( this.filesSrc ).map( function ( file ) {
      return file.replace( dirRE, '' );
    });

    var index = -1;
    for(var i=0, len=cssFiles.length; i<len && index === -1; i++) {
      if(cssFiles[i] === 'stylesheet/reset.css') {
        index = i;
      }
    }
    if(index > -1) {
      cssFiles.splice(index, 1);
      cssFiles.splice(0, 0, 'stylesheet/reset.css');
    }

    grunt.file.copy('template_src/index.tpl.html', this.data.dir + '/index.html', {
      process: function ( contents, path ) {
        return grunt.template.process( contents, {
          data: {
            scripts: jsFiles,
            styles: cssFiles,
            nojs_sentence: grunt.config('nojs_sentence')
          }
        });
      }
    });
  });

};
<commit_msg>add tpl files to watch task<commit_after>/*
 * grunt-draw-my-project
 * http://manland.github.io/draw-my-project
 *
 * Copyright (c) 2014 Romain Maneschi
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  var gruntConfig = require( './gruntConfig.js' );

  var taskConfig = {
    pkg: grunt.file.readJSON("package.json"),
    meta: {
      banner:
        '/**\n' +
        ' * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
        ' * <%= pkg.homepage %>\n' +
        ' *\n' +
        ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> : <%= pkg.author.url %>\n' +
        ' * Licensed <%= pkg.licenses[0].type %> <%= pkg.licenses[0].url %>\n' +
        ' */\n'
    },

    nodeunit: {
      tests: ['test/*_test.js'],
    },

    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js',
        '<%= app_files.js %>',
        '<%= test_files.js %>',
        '<%= nodeunit.tests %>'
      ],
      options: {
        jshintrc: '.jshintrc',
      },
    },

    // Before generating any new files, remove any previously-created files.
    clean: [
      'tmp',
      '<%= build_dir %>',
      '<%= compile_dir %>'
    ],

    copy: {
      build: {
        files: [
          {
            src: [
              '<%= app_files.js %>',
              '<%= app_files.tplHtml %>',
              '<%= vendor_files.js %>',
              '<%= app_files.assets %>',
              '<%= app_files.stylesheet %>'
            ],
            dest: '<%= build_dir %>/',
            cwd: '.',
            expand: true
          }
        ]
      },
      compile: {
        files: [
          {
            src: [ '**/*' ],
            dest: '<%= compile_dir %>/assets',
            cwd: '<%= build_dir %>/template_src/assets',
            expand: true
          }
        ]
      }
    },

    concat: {
      compile_js: {
        options: {
          banner: '<%= meta.banner %>'
        },
        src: [
          '<%= vendor_files.js %>',
          '<%= build_dir %>/template_src/src/**/*.js'
        ],
        dest: '<%= compile_dir %>/<%= pkg.name %>-<%= pkg.version %>.js'
      },
      compile_css: {
        options: {
          banner: '<%= meta.banner %>'
        },
        src: [
          'template_src/stylesheet/reset.css',
          '<%= app_files.stylesheet %>',
        ],
        dest: '<%= compile_dir %>/stylesheet/<%= pkg.name %>-<%= pkg.version %>.css'
      }
    },

    uglify: {
      compile: {
        options: {
          banner: '<%= meta.banner %>'
        },
        files: {
          '<%= concat.compile_js.dest %>': '<%= concat.compile_js.dest %>'
        }
      }
    },

    index: {
      build: {
        dir: '<%= build_dir %>/template_src',
        src: [
          '<%= vendor_files.js %>',
          '<%= app_files.js %>',
          '<%= build_dir %>/**/*.css'
        ]
      },
      compile: {
        dir: '<%= compile_dir %>',
        src: [
          '<%= concat.compile_js.dest %>',
          '<%= vendor_files.css %>',
          '<%= concat.compile_css.dest %>'
        ]
      }
    },

    watch: {
      files: [
        'tasks/*.js',
        '<%= app_files.html %>',
        '<%= app_files.js %>',
        '<%= app_files.tplHtml %>',
        '<%= vendor_files.js %>',
        '<%= app_files.assets %>',
        '<%= app_files.stylesheet %>',
        '<%= test_files.js %>'
      ],
      tasks: ['jshint', /*'karma:build:run',*/ 'build']
    },

    ngtemplates: {
      app: {
        src: 'src/**/*.tpl.html',
        cwd: 'template_src/',
        dest: '<%= build_dir %>/template_src/src/templates.js'
      }
    },

    // Configuration to be run (and then tested).
    draw_my_project: {
      options: {
        //templateFiles: ['template/d3.html', 'template/d3.js', 'template/d3.css']
        templateFiles: [
          'template/**/*'
        ]
      },
      simple: {
        options: {
          nbNodeByFile: 3
        },
        files: {
          'tmp/simple': ['test/fixtures/simple.js']
        }
      },
      complexe: {
        files: {
          'tmp/complexe': ['test/fixtures/complexe/**/*.js']
        }
      },
      skimbo: {
        options: {
          title: 'Skimbo',
          description: 'Manage your social life !',
          link: 'http://blog.skimbo.fr',
          favicon: 'assets/img/skimbo.png',
          urlLogo: 'assets/img/skimbo.png'
        },
        files: {
          'tmp/skimbo': ['test/fixtures/skimbo/**/*.js']
        }
      },
      sturvive: {
        options: {
          type: 'requirejs'
        },
        files: {
          'tmp/sturvive': ['test/fixtures/sturvive/**/*.js']
        }
      },
      goo: {
        options: {
          type: 'requirejs',
          nbNodeByFile: -1
        },
        files: {
          'tmp/goo': ['test/fixtures/goo-require.js']
        }
      },
      timeChecking: {
        options: {
          type: 'nodejs'
        },
        files: {
          'tmp/timeChecking': ['test/fixtures/timeChecking/**/*.js']
        }
      }

    }

  };

  grunt.loadTasks('tasks');

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-angular-templates');

  //TODO : mincss, minhtml, angularjstpl2js

  grunt.initConfig(grunt.util._.extend(taskConfig, gruntConfig));

  grunt.registerTask('test', ['draw_my_project', 'nodeunit']);
  grunt.registerTask('build', ['clean', 'copy:build', 'index:build', 'test']);
  grunt.registerTask('dev', ['jshint', 'build', 'watch']);
  grunt.registerTask('compile', ['jshint', 'build', 'ngtemplates', 'concat:compile_js', 'concat:compile_css', 'copy:compile', 'uglify:compile', 'index:compile', 'test']);
  grunt.registerTask('default', ['jshint', 'test']);

  grunt.registerMultiTask( 'index', 'Process index.html template', function () {
    var dirRE = new RegExp( '^('+this.data.dir+')\/', 'g' );

    function filterForJS ( files ) {
      return files.filter( function ( file ) {
        return file.match( /\.js$/ );
      });
    }

    function filterForCSS ( files ) {
      return files.filter( function ( file ) {
        return file.match( /\.css$/ );
      });
    }

    var jsFiles = filterForJS( this.filesSrc ).map( function ( file ) {
      return file.replace('template_src/', '').replace( dirRE, '' );
    });

    var cssFiles = filterForCSS( this.filesSrc ).map( function ( file ) {
      return file.replace( dirRE, '' );
    });

    var index = -1;
    for(var i=0, len=cssFiles.length; i<len && index === -1; i++) {
      if(cssFiles[i] === 'stylesheet/reset.css') {
        index = i;
      }
    }
    if(index > -1) {
      cssFiles.splice(index, 1);
      cssFiles.splice(0, 0, 'stylesheet/reset.css');
    }

    grunt.file.copy('template_src/index.tpl.html', this.data.dir + '/index.html', {
      process: function ( contents, path ) {
        return grunt.template.process( contents, {
          data: {
            scripts: jsFiles,
            styles: cssFiles,
            nojs_sentence: grunt.config('nojs_sentence')
          }
        });
      }
    });
  });

};
<|endoftext|>


<commit_before>'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// '<%= config.src %>/templates/pages/{,*/}*.hbs'
// use this if you want to match all subfolders:
// '<%= config.src %>/templates/pages/**/*.hbs'

module.exports = function(grunt) {

  require('time-grunt')(grunt);
  var dateVar = grunt.template.today('dddd, mmmm dS, yyyy, h:MM:ss TT');

  //jit-grunt loads only the npm tasks required for the grunt task.
  //makes livereload much faster.
  require('load-grunt-config')(grunt, {
    jitGrunt: {
      staticMappings: {
        replace: 'grunt-text-replace',
        handlebars: 'grunt-contrib-handlebars',
        resemble: 'grunt-resemble-cli',
        sass: 'grunt-sass',
        connect: 'grunt-contrib-connect',
        jasmine_node: 'grunt-jasmine-node',
        assemble: 'grunt/assemble/',
        mochaTest: 'grunt-mocha-test',
        open: 'grunt-open'
      }
    },
    data: {
      dateVar: dateVar,
      marketingDistName: 'website-stable'
    },
    init: true
  });

  grunt.registerTask('om-test', [
    'open'
  ]);

  grunt.registerTask('staging-deploy', [
    'gitinfo',
    'config:staging',
    'jshint:clientDev',
    'jshint:server',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:prod',
    'autoprefixer',
    'copy',
    'uglify',
    's3:staging',
    'clean:postBuild'
  ]);

  grunt.registerTask('smartling-staging-deploy', [
    'gitinfo',
    'config:smartlingStaging',
    'jshint:clientDev',
    'jshint:server',
    'clean:preBuild',
    'assemble:smartling-staging-deploy',
    'handlebars',
    'modernizr',
    'concat',
    'sass:prod',
    'autoprefixer',
    'copy',
    'uglify',
    's3:smartling',
    'clean:postBuild'
  ]);

  var serverTasks = [
    'config:dev',
    'jshint:clientDev',
    'jshint:server',
    'jshint:test',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:dev',
    'replace',
    'autoprefixer',
    'copy',
    'clean:postBuild',
    'connect:livereload',
    'watch'
  ];

  grunt.registerTask('server', function(which) {
    var cachedI;
    var assembleTask = serverTasks.filter(function(task, i) {
      if(/assemble/.test(task)) {
        cachedI = i;
        return true;
      }
    })[0];

    if(which) {
      assembleTask += (':' + which);
      serverTasks[cachedI] = assembleTask;
    }

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

  grunt.registerTask('build', [
    'config:production',
    'jshint:clientProd',
    'jshint:server',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:prod',
    'autoprefixer',
    'copy',
    'uglify',
    'filerev',
    'userevvd',
    'clean:postBuild'
  ]);

  grunt.registerTask('ui-test', function(which) {
    var mochaTest = 'mochaTest',
        tasks = [
          'config:dev',
          'jshint:test'
        ];

    if(which){
      if(which !== 'om'){
        mochaTest += ':' + which;
        tasks.push(mochaTest);
      } else if(which === 'om'){
        tasks.push('om-test');
      }
    } else {
      tasks.push('om-test');
      tasks.push(mochaTest);
    }

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

  grunt.registerTask('test', [
    'config:dev',
    'jshint:clientProd',
    'jshint:server',
    'jshint:test',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:dev',
    'replace',
    'autoprefixer',
    'copy',
    'clean:postBuild',
    'om-test',
    'connect:resemble',
    'mochaTest',
  ]);

  grunt.registerTask('default', [
    'build'
  ]);
  grunt.loadNpmTasks('grunt-github-releaser');
  grunt.loadNpmTasks('grunt-git');

  grunt.registerTask('forceoff', 'Forces the force flag off', function() {
    grunt.option('force', false);
  });

  grunt.registerTask('forceon', 'Forces the force flag on', function() {
    grunt.option('force', true);
  });

  grunt.registerTask('release', 'makes a release to github', function() {
    // Use the forceon option for all tasks that need to continue executing in case of error
    var prepare = ['prompt', 'build'];
    var compress = ['compress'];
    var git_release_tasks = ['gitfetch', 'forceon', 'gittag', 'gitpush', 'forceoff', 'github-release'];

    grunt.task.run(prepare);
    grunt.task.run(compress);
    grunt.task.run(git_release_tasks);
  });

};
<commit_msg>remove jasmine from jitGrunt<commit_after>'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// '<%= config.src %>/templates/pages/{,*/}*.hbs'
// use this if you want to match all subfolders:
// '<%= config.src %>/templates/pages/**/*.hbs'

module.exports = function(grunt) {

  require('time-grunt')(grunt);
  var dateVar = grunt.template.today('dddd, mmmm dS, yyyy, h:MM:ss TT');

  //jit-grunt loads only the npm tasks required for the grunt task.
  //makes livereload much faster.
  require('load-grunt-config')(grunt, {
    jitGrunt: {
      staticMappings: {
        replace: 'grunt-text-replace',
        handlebars: 'grunt-contrib-handlebars',
        resemble: 'grunt-resemble-cli',
        sass: 'grunt-sass',
        connect: 'grunt-contrib-connect',
        assemble: 'grunt/assemble/',
        mochaTest: 'grunt-mocha-test',
        open: 'grunt-open'
      }
    },
    data: {
      dateVar: dateVar,
      marketingDistName: 'website-stable'
    },
    init: true
  });

  grunt.registerTask('om-test', [
    'open'
  ]);

  grunt.registerTask('staging-deploy', [
    'gitinfo',
    'config:staging',
    'jshint:clientDev',
    'jshint:server',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:prod',
    'autoprefixer',
    'copy',
    'uglify',
    's3:staging',
    'clean:postBuild'
  ]);

  grunt.registerTask('smartling-staging-deploy', [
    'gitinfo',
    'config:smartlingStaging',
    'jshint:clientDev',
    'jshint:server',
    'clean:preBuild',
    'assemble:smartling-staging-deploy',
    'handlebars',
    'modernizr',
    'concat',
    'sass:prod',
    'autoprefixer',
    'copy',
    'uglify',
    's3:smartling',
    'clean:postBuild'
  ]);

  var serverTasks = [
    'config:dev',
    'jshint:clientDev',
    'jshint:server',
    'jshint:test',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:dev',
    'replace',
    'autoprefixer',
    'copy',
    'clean:postBuild',
    'connect:livereload',
    'watch'
  ];

  grunt.registerTask('server', function(which) {
    var cachedI;
    var assembleTask = serverTasks.filter(function(task, i) {
      if(/assemble/.test(task)) {
        cachedI = i;
        return true;
      }
    })[0];

    if(which) {
      assembleTask += (':' + which);
      serverTasks[cachedI] = assembleTask;
    }

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

  grunt.registerTask('build', [
    'config:production',
    'jshint:clientProd',
    'jshint:server',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:prod',
    'autoprefixer',
    'copy',
    'uglify',
    'filerev',
    'userevvd',
    'clean:postBuild'
  ]);

  grunt.registerTask('ui-test', function(which) {
    var mochaTest = 'mochaTest',
        tasks = [
          'config:dev',
          'jshint:test'
        ];

    if(which){
      if(which !== 'om'){
        mochaTest += ':' + which;
        tasks.push(mochaTest);
      } else if(which === 'om'){
        tasks.push('om-test');
      }
    } else {
      tasks.push('om-test');
      tasks.push(mochaTest);
    }

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

  grunt.registerTask('test', [
    'config:dev',
    'jshint:clientProd',
    'jshint:server',
    'jshint:test',
    'clean:preBuild',
    'assemble',
    'handlebars',
    'modernizr',
    'concat',
    'sass:dev',
    'replace',
    'autoprefixer',
    'copy',
    'clean:postBuild',
    'om-test',
    'connect:resemble',
    'mochaTest',
  ]);

  grunt.registerTask('default', [
    'build'
  ]);
  grunt.loadNpmTasks('grunt-github-releaser');
  grunt.loadNpmTasks('grunt-git');

  grunt.registerTask('forceoff', 'Forces the force flag off', function() {
    grunt.option('force', false);
  });

  grunt.registerTask('forceon', 'Forces the force flag on', function() {
    grunt.option('force', true);
  });

  grunt.registerTask('release', 'makes a release to github', function() {
    // Use the forceon option for all tasks that need to continue executing in case of error
    var prepare = ['prompt', 'build'];
    var compress = ['compress'];
    var git_release_tasks = ['gitfetch', 'forceon', 'gittag', 'gitpush', 'forceoff', 'github-release'];

    grunt.task.run(prepare);
    grunt.task.run(compress);
    grunt.task.run(git_release_tasks);
  });

};
<|endoftext|>


<commit_before>module.exports = function (grunt) {

    'use strict';

    var jsSrcFile = 'src/bullet.js';
    var jsDistDir = 'dist/';
    var testDir = 'test/spec/';

    grunt.initConfig({

        watch : {

            js: {
                files: [
                    jsSrcFile,
                    testDir + '**/*.js'
                ],

                tasks: ['dist']
            }
        },

        simplemocha : {

            options: {
                timeout: 3000,
                ignoreLeaks: false,
            },

            testAll : {
                src: testDir + '**/*.js'
            }
        },

        uglify : {

            options : {
                compress : {
                    drop_console: true
                },
                mangle : true,
                sourceMap : false,
                preserveComments : false,
                report : 'gzip' // TODO : does this report option still work?
            },

            dist : {
                src : jsSrcFile,
                dest : jsDistDir + 'bullet.min.js'
            }
        },

        copy : {

            dist : {
                src : jsSrcFile,
                dest : jsDistDir + 'bullet.js'
            }
        }
    });

    require('load-grunt-tasks')(grunt, {pattern: ['grunt-*']});

    grunt.registerTask('default', ['simplemocha', 'uglify', 'copy', 'watch']);
    grunt.registerTask('dist', ['simplemocha', 'uglify', 'copy']);
    grunt.registerTask('test', ['simplemocha']);
};<commit_msg>Make Grunt copy bullet.js into example js libs dir<commit_after>module.exports = function (grunt) {

    'use strict';

    var jsSrcFile = 'src/bullet.js';
    var jsDistDir = 'dist/';
    var jsExampleLibsDir = 'example/js/libs/';
    var testDir = 'test/spec/';

    grunt.initConfig({

        watch : {

            js: {
                files: [
                    jsSrcFile,
                    testDir + '**/*.js'
                ],

                tasks: ['dist']
            }
        },

        simplemocha : {

            options: {
                timeout: 3000,
                ignoreLeaks: false,
            },

            testAll : {
                src: testDir + '**/*.js'
            }
        },

        uglify : {

            options : {
                compress : {
                    drop_console: true
                },
                mangle : true,
                sourceMap : false,
                preserveComments : false,
                report : 'gzip' // TODO : does this report option still work?
            },

            dist : {
                src : jsSrcFile,
                dest : jsDistDir + 'bullet.min.js'
            }
        },

        copy : {

            dist : {
                src : jsSrcFile,
                dest : jsDistDir + 'bullet.js'
            },

            example : {
                src : jsSrcFile,
                dest : jsExampleLibsDir + 'bullet.js'
            }
        }
    });

    require('load-grunt-tasks')(grunt, {pattern: ['grunt-*']});

    grunt.registerTask('default', ['simplemocha', 'uglify', 'copy', 'watch']);
    grunt.registerTask('dist', ['simplemocha', 'uglify', 'copy']);
    grunt.registerTask('test', ['simplemocha']);
};<|endoftext|>


<commit_before>// Generated on 2013-08-05 using generator-webapp 0.2.7
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

// # 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 all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        src: 'src',
        dist: 'dist'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            compass: {
                files: ['<%= yeoman.src %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= yeoman.src %>/styles/{,*/}*.css'],
                tasks: ['copy:styles', 'autoprefixer']
            },
            //TODO reload concat
            livereload: {
                options: {
                    livereload: LIVERELOAD_PORT
                },
                files: [
                    'examples/index.html',
                    '.tmp/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.src %>}/scripts/{,*/}*.js',
                    '<%= yeoman.src %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ]
            }
        },
        connect: {
            options: {
                port: 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'// 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.src),
                            mountFolder(connect, 'examples')
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test'),
                            mountFolder(connect, yeomanConfig.src)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, yeomanConfig.dist)
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.src %>/scripts/{,*/}*.js',
                '!<%= yeoman.src %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    log: true,
                    reporter: 'Spec',
                    urls: ['http://localhost:<%= connect.options.port %>/index.html']
                }
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.src %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= yeoman.src %>/images',
                javascriptsDir: '<%= yeoman.src %>/scripts',
                fontsDir: '<%= yeoman.src %>/styles/fonts',
                importPath: '<%= yeoman.src %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false
            },
            dist: {
                options: {
                    generatedImagesDir: '<%= yeoman.dist %>/images/generated'
                }
            },
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        autoprefixer: {
            options: {
                browsers: ['last 1 version']
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },
        dot: {
            all: {
                options: {
                    root: __dirname + '/src'
                },
                files: {
                    '.tmp/templates/dialog.js': '<%= yeoman.src %>/templates/dialog.jst'
                }
            }
        },
        concat: {
            vanilla: {
                src: [
                    '<%= yeoman.src %>/scripts/wrap/intro.js',
                    '<%= yeoman.src %>/scripts/akno.js',
                    '.tmp/templates/dialog.js',
                    '<%= yeoman.src %>/scripts/wrap/outro.js'

                ],
                dest: '.tmp/scripts/akno.js'
            }/*TODO,
            jquery: {
                '.tmp/scripts/akno.jquery.js': [
                    '<%= yeoman.src %>/wrap/jquery-intro.js',
                    '<%= yeoman.src %>/akno.js',
                    '.tmp/templates/akno.js',
                    '<%= yeoman.src %>/wrap/jquery-outro.js'

                ]
            }*/
        },
        uglify: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/scripts/akno.min.js': ['.tmp/scripts/akno.js']
                }
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/akno.min.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.src %>/styles/{,*/}*.css'
                    ]
                }
            }
        },
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.src %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,png,txt}',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/*'
                    ]
                }, {
                    '<%= yeoman.dist %>/scripts/akno.js': '.tmp/scripts/akno.js'
                }, {
                    '<%= yeoman.dist %>/styles/akno.css': '.tmp/styles/akno.css'
                }]
            }
        },
        concurrent: {
            server: [
                'compass',
                'concat:vanilla'
            ],
            test: [
                'compass',
                'concat:vanilla'
            ],
            dist: [
                'compass',
                'concat:vanilla'
            ]
        }
    });

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

        if (target === 'test') {
            return grunt.task.run([
                'clean:server',
                'dot',
                'concurrent:test',
                'autoprefixer',
                'connect:test:keepalive'
            ]);
        }

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

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

    grunt.registerTask('build', [
        'clean:dist',
        'dot',
        'concurrent:dist',
        'autoprefixer',
        'concat',
        'copy:dist',
        'cssmin',
        'uglify'
    ]);

    grunt.registerTask('default', [
        'jshint',
        'test',
        'build'
    ]);
};
<commit_msg>grunt to watch after js files to concat and templates to compile<commit_after>// Generated on 2013-08-05 using generator-webapp 0.2.7
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

// # 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 all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        src: 'src',
        dist: 'dist'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            compass: {
                files: ['<%= yeoman.src %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= yeoman.src %>/styles/{,*/}*.css'],
                tasks: ['copy:styles', 'autoprefixer']
            },
            js: {
                files: [
                    '<%= yeoman.src %>/scripts/{,*/}*.js',
                    '.tmp/templates/{,*/}*.js'
                ],
                tasks: ['concat']
            },
            templates: {
                files: ['<%= yeoman.src %>/templates/{,*/}*.jst'],
                tasks: ['dot']
            },
            livereload: {
                options: {
                    livereload: LIVERELOAD_PORT
                },
                files: [
                    'examples/index.html',
                    '.tmp/styles/{,*/}*.css',
                    '.tmp/scripts/{,*/}*.js'
                ]
            }
        },
        connect: {
            options: {
                port: 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'// 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.src),
                            mountFolder(connect, 'examples')
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test'),
                            mountFolder(connect, yeomanConfig.src)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, yeomanConfig.dist)
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.src %>/scripts/{,*/}*.js',
                '!<%= yeoman.src %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    log: true,
                    reporter: 'Spec',
                    urls: ['http://localhost:<%= connect.options.port %>/index.html']
                }
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.src %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= yeoman.src %>/images',
                javascriptsDir: '<%= yeoman.src %>/scripts',
                fontsDir: '<%= yeoman.src %>/styles/fonts',
                importPath: '<%= yeoman.src %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false
            },
            dist: {
                options: {
                    generatedImagesDir: '<%= yeoman.dist %>/images/generated'
                }
            },
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        autoprefixer: {
            options: {
                browsers: ['last 1 version']
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },
        dot: {
            all: {
                options: {
                    root: __dirname + '/src'
                },
                files: {
                    '.tmp/templates/dialog.js': '<%= yeoman.src %>/templates/dialog.jst'
                }
            }
        },
        concat: {
            vanilla: {
                src: [
                    '<%= yeoman.src %>/scripts/wrap/intro.js',
                    '<%= yeoman.src %>/scripts/akno.js',
                    '.tmp/templates/dialog.js',
                    '<%= yeoman.src %>/scripts/wrap/outro.js'

                ],
                dest: '.tmp/scripts/akno.js'
            }/*TODO,
            jquery: {
                '.tmp/scripts/akno.jquery.js': [
                    '<%= yeoman.src %>/wrap/jquery-intro.js',
                    '<%= yeoman.src %>/akno.js',
                    '.tmp/templates/akno.js',
                    '<%= yeoman.src %>/wrap/jquery-outro.js'

                ]
            }*/
        },
        uglify: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/scripts/akno.min.js': ['.tmp/scripts/akno.js']
                }
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/akno.min.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.src %>/styles/{,*/}*.css'
                    ]
                }
            }
        },
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.src %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,png,txt}',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/*'
                    ]
                }, {
                    '<%= yeoman.dist %>/scripts/akno.js': '.tmp/scripts/akno.js'
                }, {
                    '<%= yeoman.dist %>/styles/akno.css': '.tmp/styles/akno.css'
                }]
            }
        },
        concurrent: {
            server: [
                'compass',
                'concat:vanilla'
            ],
            test: [
                'compass',
                'concat:vanilla'
            ],
            dist: [
                'compass',
                'concat:vanilla'
            ]
        }
    });

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

        if (target === 'test') {
            return grunt.task.run([
                'clean:server',
                'dot',
                'concurrent:test',
                'autoprefixer',
                'connect:test:keepalive'
            ]);
        }

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

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

    grunt.registerTask('build', [
        'clean:dist',
        'dot',
        'concurrent:dist',
        'autoprefixer',
        'concat',
        'copy:dist',
        'cssmin',
        'uglify'
    ]);

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


<commit_before>// Generated on 2014-04-19 using generator-webapp 0.4.9
'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);

    // Configurable paths
    var config = {
        app: 'app',
        dist: 'dist'
    };

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

        // Project settings
        config: config,

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            bower: {
                files: ['bower.json'],
                tasks: ['bowerInstall']
            },
            js: {
                files: ['<%= config.app %>/scripts/{,*/}*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            jstest: {
                files: ['test/spec/{,*/}*.js'],
                tasks: ['test:watch']
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            sass: {
                files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['sass:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= config.app %>/styles/{,*/}*.css'],
                tasks: ['newer:copy:styles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '<%= config.app %>/{,*/}*.html',
                    '.tmp/styles/{,*/}*.css',
                    '<%= config.app %>/images/{,*/}*'
                ]
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                open: true,
                livereload: 35729,
                // Change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    middleware: function(connect) {
                        return [
                            connect.static('.tmp'),
                            connect().use('/bower_components', connect.static('./bower_components')),
                            connect.static(config.app)
                        ];
                    }
                }
            },
            test: {
                options: {
                    open: false,
                    port: 9001,
                    middleware: function(connect) {
                        return [
                            connect.static('.tmp'),
                            connect.static('test'),
                            connect().use('/bower_components', connect.static('./bower_components')),
                            connect.static(config.app)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    base: '<%= config.dist %>',
                    livereload: false
                }
            }
        },

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

        // 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',
                '<%= config.app %>/scripts/{,*/}*.js',
                '!<%= config.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },

        // Mocha testing framework configuration options
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
                }
            }
        },

        // Compiles Sass to CSS and generates necessary files if requested
        sass: {
            options: {
                loadPath: [
                    'bower_components'
                ]
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/styles',
                    src: ['*.scss'],
                    dest: '.tmp/styles',
                    ext: '.css'
                }]
            },
            server: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/styles',
                    src: ['*.scss'],
                    dest: '.tmp/styles',
                    ext: '.css'
                }]
            }
        },

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

        // Automatically inject Bower components into the HTML file
        bowerInstall: {
            app: {
                src: ['<%= config.app %>/index.html'],
                exclude: ['bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap.js']
            },
            sass: {
                src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}']
            }
        },

        // Renames files for browser caching purposes
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= config.dist %>/scripts/{,*/}*.js',
                        '<%= config.dist %>/styles/{,*/}*.css',
                        '<%= config.dist %>/images/{,*/}*.*',
                        '<%= config.dist %>/styles/fonts/{,*/}*.*',
                        '<%= config.dist %>/*.{ico,png}'
                    ]
                }
            }
        },

        // 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: {
            options: {
                dest: '<%= config.dist %>'
            },
            html: '<%= config.app %>/index.html'
        },

        // Performs rewrites based on rev and the useminPrepare configuration
        usemin: {
            options: {
                assetsDirs: ['<%= config.dist %>', '<%= config.dist %>/images']
            },
            html: ['<%= config.dist %>/{,*/}*.html'],
            css: ['<%= config.dist %>/styles/{,*/}*.css']
        },

        // The following *-min tasks produce minified files in the dist folder
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/images',
                    src: '{,*/}*.{gif,jpeg,jpg,png}',
                    dest: '<%= config.dist %>/images'
                }]
            }
        },

        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= config.dist %>/images'
                }]
            }
        },

        htmlmin: {
            dist: {
                options: {
                    collapseBooleanAttributes: true,
                    collapseWhitespace: true,
                    removeAttributeQuotes: true,
                    removeCommentsFromCDATA: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= config.dist %>',
                    src: '{,*/}*.html',
                    dest: '<%= config.dist %>'
                }]
            }
        },

        // 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: {
        //             '<%= config.dist %>/styles/main.css': [
        //                 '.tmp/styles/{,*/}*.css',
        //                 '<%= config.app %>/styles/{,*/}*.css'
        //             ]
        //         }
        //     }
        // },
        // uglify: {
        //     dist: {
        //         files: {
        //             '<%= config.dist %>/scripts/scripts.js': [
        //                 '<%= config.dist %>/scripts/scripts.js'
        //             ]
        //         }
        //     }
        // },
        // concat: {
        //     dist: {}
        // },

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

        // Run some tasks in parallel to speed up build process
        concurrent: {
            server: [
                'sass:server',
                'copy:styles'
            ],
            test: [
                'copy:styles'
            ],
            dist: [
                'sass',
                'copy:styles',
                'imagemin',
                'svgmin'
            ]
        }
    });

    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',
            'watch'
        ]);
    });

    grunt.registerTask('server', function (target) {
        grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
        grunt.task.run([target ? ('serve:' + target) : 'serve']);
    });

    grunt.registerTask('test', function (target) {
        if (target !== 'watch') {
            grunt.task.run([
                'clean:server',
                'concurrent:test',
                'autoprefixer'
            ]);
        }

        grunt.task.run([
            'connect:test',
            'mocha'
        ]);
    });

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

    grunt.registerTask('default', [
        'newer:jshint',
        'test',
        'build'
    ]);
};
<commit_msg>Disable bowerInstall for bootstrap-sass<commit_after>// Generated on 2014-04-19 using generator-webapp 0.4.9
'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);

    // Configurable paths
    var config = {
        app: 'app',
        dist: 'dist'
    };

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

        // Project settings
        config: config,

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            bower: {
                files: ['bower.json'],
                tasks: ['bowerInstall']
            },
            js: {
                files: ['<%= config.app %>/scripts/{,*/}*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            jstest: {
                files: ['test/spec/{,*/}*.js'],
                tasks: ['test:watch']
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            sass: {
                files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['sass:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= config.app %>/styles/{,*/}*.css'],
                tasks: ['newer:copy:styles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '<%= config.app %>/{,*/}*.html',
                    '.tmp/styles/{,*/}*.css',
                    '<%= config.app %>/images/{,*/}*'
                ]
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                open: true,
                livereload: 35729,
                // Change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    middleware: function(connect) {
                        return [
                            connect.static('.tmp'),
                            connect().use('/bower_components', connect.static('./bower_components')),
                            connect.static(config.app)
                        ];
                    }
                }
            },
            test: {
                options: {
                    open: false,
                    port: 9001,
                    middleware: function(connect) {
                        return [
                            connect.static('.tmp'),
                            connect.static('test'),
                            connect().use('/bower_components', connect.static('./bower_components')),
                            connect.static(config.app)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    base: '<%= config.dist %>',
                    livereload: false
                }
            }
        },

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

        // 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',
                '<%= config.app %>/scripts/{,*/}*.js',
                '!<%= config.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },

        // Mocha testing framework configuration options
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
                }
            }
        },

        // Compiles Sass to CSS and generates necessary files if requested
        sass: {
            options: {
                loadPath: [
                    'bower_components'
                ]
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/styles',
                    src: ['*.scss'],
                    dest: '.tmp/styles',
                    ext: '.css'
                }]
            },
            server: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/styles',
                    src: ['*.scss'],
                    dest: '.tmp/styles',
                    ext: '.css'
                }]
            }
        },

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

        // Automatically inject Bower components into the HTML file
        bowerInstall: {
            app: {
                src: ['<%= config.app %>/index.html'],
                exclude: ['bower_components/bootstrap-sass-official', 'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap.js']
            },
            sass: {
                src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
                exclude: ['bower_components/bootstrap-sass-official']
            }
        },

        // Renames files for browser caching purposes
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= config.dist %>/scripts/{,*/}*.js',
                        '<%= config.dist %>/styles/{,*/}*.css',
                        '<%= config.dist %>/images/{,*/}*.*',
                        '<%= config.dist %>/styles/fonts/{,*/}*.*',
                        '<%= config.dist %>/*.{ico,png}'
                    ]
                }
            }
        },

        // 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: {
            options: {
                dest: '<%= config.dist %>'
            },
            html: '<%= config.app %>/index.html'
        },

        // Performs rewrites based on rev and the useminPrepare configuration
        usemin: {
            options: {
                assetsDirs: ['<%= config.dist %>', '<%= config.dist %>/images']
            },
            html: ['<%= config.dist %>/{,*/}*.html'],
            css: ['<%= config.dist %>/styles/{,*/}*.css']
        },

        // The following *-min tasks produce minified files in the dist folder
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/images',
                    src: '{,*/}*.{gif,jpeg,jpg,png}',
                    dest: '<%= config.dist %>/images'
                }]
            }
        },

        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= config.dist %>/images'
                }]
            }
        },

        htmlmin: {
            dist: {
                options: {
                    collapseBooleanAttributes: true,
                    collapseWhitespace: true,
                    removeAttributeQuotes: true,
                    removeCommentsFromCDATA: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= config.dist %>',
                    src: '{,*/}*.html',
                    dest: '<%= config.dist %>'
                }]
            }
        },

        // 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: {
        //             '<%= config.dist %>/styles/main.css': [
        //                 '.tmp/styles/{,*/}*.css',
        //                 '<%= config.app %>/styles/{,*/}*.css'
        //             ]
        //         }
        //     }
        // },
        // uglify: {
        //     dist: {
        //         files: {
        //             '<%= config.dist %>/scripts/scripts.js': [
        //                 '<%= config.dist %>/scripts/scripts.js'
        //             ]
        //         }
        //     }
        // },
        // concat: {
        //     dist: {}
        // },

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

        // Run some tasks in parallel to speed up build process
        concurrent: {
            server: [
                'sass:server',
                'copy:styles'
            ],
            test: [
                'copy:styles'
            ],
            dist: [
                'sass',
                'copy:styles',
                'imagemin',
                'svgmin'
            ]
        }
    });

    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',
            'watch'
        ]);
    });

    grunt.registerTask('server', function (target) {
        grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
        grunt.task.run([target ? ('serve:' + target) : 'serve']);
    });

    grunt.registerTask('test', function (target) {
        if (target !== 'watch') {
            grunt.task.run([
                'clean:server',
                'concurrent:test',
                'autoprefixer'
            ]);
        }

        grunt.task.run([
            'connect:test',
            'mocha'
        ]);
    });

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

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


<commit_before>/*global module:false*/
module.exports = function(grunt) {
	// Load grunt helpers
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-contrib-csslint');
	grunt.loadNpmTasks('grunt-replace');

	// Project configuration.
	grunt.initConfig({
		// Package properties
		pkg: grunt.file.readJSON('package.json'),

		// So meta...
		meta: {
			banners: {
				full: '/*\n * <%= pkg.title || pkg.name %> - @@vVERSION\n' +
					' * <%=pkg.homepage%>\n' +
					' *\n' +
					' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
					' * Released under the <%= _.pluck(pkg.licenses, "type").join(", ") %> licenses\n' +
					' * http://jquery.org/license\n' +
					' *\n' +
					' * Date: <%= grunt.template.today("ddd mmm d yyyy hh:MM Zo", true) %>\n' +
					'@@BUILDPROPS */\n',

				uglify:'/* <%= pkg.name %> @@vVERSION @@PLUGINS | <%= pkg.homepage.replace("http://","") %> | '+
					'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> | <%=grunt.template.today() %> */\n',

				cssmin:'/* <%= pkg.name %> @@vVERSION @@STYLES | <%= pkg.homepage.replace("http://","") %> | '+
					'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> | <%=grunt.template.today() %> */'
			}
		},

		// Directories (dist changed in init())
		dirs: { src: 'src', dist: 'dist', libs: 'libs' },

		// Styles and plugins map
		styles: {
			basic: '<%=dirs.src%>/basic.css',
			css3: '<%=dirs.src%>/css3.css'
		},
		plugins: {
			svg: { js: '<%=dirs.src%>/svg/svg.js' },
			ajax: { js: '<%=dirs.src%>/ajax/ajax.js' },
			tips: { js: '<%=dirs.src%>/tips/tips.js', css: '<%=dirs.src%>/tips/tips.css' },
			modal: { js: '<%=dirs.src%>/modal/modal.js', css: '<%=dirs.src%>/modal/modal.css' },
			viewport: { js: '<%=dirs.src%>/viewport/viewport.js' },
			imagemap: { js: '<%=dirs.src%>/imagemap/imagemap.js' },
			ie6: { js: '<%=dirs.src%>/ie6/ie6.js', css: '<%=dirs.src%>/ie6/ie6.css' }
		},

		// Clean dist/ folder
		clean: ['<%=dirs.dist%>/**/*'],

		// Concatenation
		concat: {
			options: {
				stripBanners: true,
				separator: ';',
				banner: '<%=meta.banners.full%>'
			},
			dist: {
				// See "init" task for src
				dest: '<%=dirs.dist%>/jquery.qtip.js'
			},
			css: {
				// See "init" task for src
				options: { separator: '\n\n' },
				dest: '<%=dirs.dist%>/jquery.qtip.css'
			},
			libs: {
				options: {
					stripBanners: false,
					separator: '\n\n',
					banner: ''
				},
				files: {
					'<%=dirs.dist%>/jquery.qtip.js': [
						'<%=dirs.dist%>/jquery.qtip.js',
						'<%=dirs.libs%>/imagesloaded/jquery.imagesloaded.js'
					],
					'<%=dirs.dist%>/jquery.qtip.min.js': [
						'<%=dirs.dist%>/jquery.qtip.min.js',
						'<%=dirs.libs%>/imagesloaded/jquery.imagesloaded.min.js'
					]
				}
			}
		},

		// Minification
		uglify: {
			options: {
				preserveComments: 'some',
				banner: '<%=meta.banners.uglify%>'
			},
			dist: {
				files: {
					'<%=dirs.dist%>/jquery.qtip.min.js': ['<%=dirs.dist%>/jquery.qtip.js']
				}
			}
		},
		cssmin: {
			options: {
				keepSpecialComments: 0,
				banner: '<%=meta.banners.cssmin%>'
			},
			dist: {
				files: {
					'<%=dirs.dist%>/jquery.qtip.min.css': '<%=dirs.dist%>/jquery.qtip.css'
				}
			}
		},

		replace: {
			dist: {
				files: [
					 { expand: true, flatten: true, src: ['<%=dirs.dist%>/**/*'], dest: '<%=dirs.dist%>/' }
				]
			}
		},

		// Linting
		csslint: {
			options: {
				'empty-rules': false,
				important: false,
				ids: false
			},
			strict: {
				src: ['<%=dirs.src%>/**/*.css']
			}
		},
		jshint: {
			options: {
				strict: false,
				curly: true,
				eqeqeq: true,
				immed: true,
				latedef: true,
				newcap: true,
				noarg: true,
				sub: true,
				boss: true,
				eqnull: true,
				browser: true,
				undef: false,
				expr: true,
				globals: {
					jQuery: true,
					'$': true
				}
			},
			beforeconcat: ['grunt.js', '<%=dirs.src%>/core.js', '<%=dirs.src%>/*/*.js']
		}
	});

	// Parse command line options
	grunt.registerTask('init', 'Default build', function() {
		if(grunt.config('concat.dist.src')) { return; } // Only do it once

		// Grab command-line options, using valid defaults if not given
		var done = this.async(),
			stable = grunt.option('stable') === true,
			plugins = (grunt.option('plugins') || Object.keys( grunt.config('plugins')).join(' ')).replace(/ /g, ' ').split(' '),
			styles = (grunt.option('styles') || Object.keys( grunt.config('styles')).join(' ')).replace(/ /g, ' ').split(' '),
			valid, lib;

		// Setup JS/CSS arrays
		var js = ['<banner:meta.banners.full>', '<%=dirs.src%>/intro.js', '<%=dirs.src%>/core.js'],
			css = ['<banner:meta.banners.full>', '<%=dirs.src%>/core.css'],
			dist = grunt.option('dist') || 'dist';

		// Parse 'dist' option (decides which directory to build into)
		grunt.config('dirs.dist', dist);

		// Parse 'styles' option (decides which stylesheets are included)
		if(grunt.option('styles') !== 0) {
			styles.forEach(function(style, i) {
				if( (valid = grunt.config('styles.'+style)) ) {
					css.push(valid);
				}
				else { styles[i] = style+('*'.red); }
			});
		}
		else { styles = ['None']; }

		// Parse 'plugins' option (decides which plugins are included)
		if(grunt.option('plugins') !== 0) {
			plugins.forEach(function(plugin, i) {
				if( (valid = grunt.config('plugins.'+plugin)) ) {
					if(valid.js) { js.push(valid.js); }
					if(valid.css) { css.push(valid.css); }
				}
				else { plugins[i] = plugin+('*'.red); }
			});
		}
		else { plugins = ['None']; }

		// Add outro
		js.push('<%=dirs.src%>/outro.js');

		// Update concatenation config
		grunt.config('concat.dist.src', js);
		grunt.config('concat.css.src', css);

		// Setup in-file text replacements (version, date etc)
		grunt.util.spawn({ cmd: 'git', args: ['describe'] }, function(err, data) {
			// Ensyure it succeed
			if(data.code > 1) {
				grunt.log.write('Uhoh... couldn\'t grab Git repository description. Somethings up!');
				return done();
			}

			var version = stable ? grunt.config('pkg.version') : data.stdout.substr(0,10),
				strStyles = styles.length ? styles.join(' ') : '',
				strPlugins = plugins.length ? plugins.join(' ') : '';

			var buildprops = (plugins.length ? ' * Plugins: '+strPlugins+'\n' : '') +
				(styles.length ? ' * Styles: '+strStyles+'\n' : '');

			var minbuildprops = plugins[0] !== 'None' || styles[0] !== 'None' ?
				'(includes: ' +
					(plugins[0] !== 'None' ? strPlugins : '') +
					(styles[0] !== 'None' ? ' / ' + strStyles : '') + ') '
				: '';

			grunt.config('replace.dist.options.variables', {
				'BUILDPROPS': buildprops,
				'MINBUILDPROPS': minbuildprops,
				'VERSION': stable ? version : version.substr(1),
				'vVERSION': stable ? 'v'+version : version,
				'DATE': grunt.template.today("dd-mm-yyyy"),
				'STYLES': strStyles,
				'PLUGINS': strPlugins
			});

			// Output current build properties
			grunt.log.write("\nBuilding " + "qTip2".green + " "+version+" with " +
				"plugins " + plugins.join(' ').green + " and " +
				"styles "  +styles.join(' ').green + "\n"
			);

			done(version);
		});
	});

	// Setup all other tasks
	grunt.registerTask('css', ['init', 'clean', 'csslint', 'concat:css', 'cssmin:dist', 'replace']);
	grunt.registerTask('default', ['init', 'clean', 'concat:dist', 'concat:distcss', 'uglify', 'cssmin', 'concat:libs', 'replace']);
	grunt.registerTask('dev', ['init', 'clean', 'jshint', 'csslint', 'concat:dist', 'concat:css', 'uglify', 'cssmin', 'concat:libs', 'replace']);
};<commit_msg>Re-add basic grunt task and add new all task<commit_after>/*global module:false*/
module.exports = function(grunt) {
	// Load grunt helpers
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-contrib-csslint');
	grunt.loadNpmTasks('grunt-replace');

	// Project configuration.
	grunt.initConfig({
		// Package properties
		pkg: grunt.file.readJSON('package.json'),

		// So meta...
		meta: {
			banners: {
				full: '/*\n * <%= pkg.title || pkg.name %> - @@vVERSION\n' +
					' * <%=pkg.homepage%>\n' +
					' *\n' +
					' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
					' * Released under the <%= _.pluck(pkg.licenses, "type").join(", ") %> licenses\n' +
					' * http://jquery.org/license\n' +
					' *\n' +
					' * Date: <%= grunt.template.today("ddd mmm d yyyy hh:MM Zo", true) %>\n' +
					'@@BUILDPROPS */\n',

				uglify:'/* <%= pkg.name %> @@vVERSION @@PLUGINS | <%= pkg.homepage.replace("http://","") %> | '+
					'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> | <%=grunt.template.today() %> */\n',

				cssmin:'/* <%= pkg.name %> @@vVERSION @@STYLES | <%= pkg.homepage.replace("http://","") %> | '+
					'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> | <%=grunt.template.today() %> */'
			}
		},

		// Directories (dist changed in init())
		dirs: { src: 'src', dist: 'dist', libs: 'libs' },

		// Styles and plugins map
		styles: {
			basic: '<%=dirs.src%>/basic.css',
			css3: '<%=dirs.src%>/css3.css'
		},
		plugins: {
			svg: { js: '<%=dirs.src%>/svg/svg.js' },
			ajax: { js: '<%=dirs.src%>/ajax/ajax.js' },
			tips: { js: '<%=dirs.src%>/tips/tips.js', css: '<%=dirs.src%>/tips/tips.css' },
			modal: { js: '<%=dirs.src%>/modal/modal.js', css: '<%=dirs.src%>/modal/modal.css' },
			viewport: { js: '<%=dirs.src%>/viewport/viewport.js' },
			imagemap: { js: '<%=dirs.src%>/imagemap/imagemap.js' },
			ie6: { js: '<%=dirs.src%>/ie6/ie6.js', css: '<%=dirs.src%>/ie6/ie6.css' }
		},

		// Clean dist/ folder
		clean: ['<%=dirs.dist%>/**/*'],

		// Concatenation
		concat: {
			options: {
				stripBanners: true,
				separator: ';',
				banner: '<%=meta.banners.full%>'
			},
			dist: {
				// See "init" task for src
				dest: '<%=dirs.dist%>/jquery.qtip.js'
			},
			css: {
				// See "init" task for src
				options: { separator: '\n\n' },
				dest: '<%=dirs.dist%>/jquery.qtip.css'
			},
			libs: {
				options: {
					stripBanners: false,
					separator: '\n\n',
					banner: ''
				},
				files: {
					'<%=dirs.dist%>/jquery.qtip.js': [
						'<%=dirs.dist%>/jquery.qtip.js',
						'<%=dirs.libs%>/imagesloaded/jquery.imagesloaded.js'
					],
					'<%=dirs.dist%>/jquery.qtip.min.js': [
						'<%=dirs.dist%>/jquery.qtip.min.js',
						'<%=dirs.libs%>/imagesloaded/jquery.imagesloaded.min.js'
					]
				}
			}
		},

		// Minification
		uglify: {
			options: {
				preserveComments: 'some',
				banner: '<%=meta.banners.uglify%>'
			},
			dist: {
				files: {
					'<%=dirs.dist%>/jquery.qtip.min.js': ['<%=dirs.dist%>/jquery.qtip.js']
				}
			}
		},
		cssmin: {
			options: {
				keepSpecialComments: 0,
				banner: '<%=meta.banners.cssmin%>'
			},
			dist: {
				files: {
					'<%=dirs.dist%>/jquery.qtip.min.css': '<%=dirs.dist%>/jquery.qtip.css'
				}
			}
		},

		replace: {
			dist: {
				files: [
					 { expand: true, flatten: true, src: ['<%=dirs.dist%>/**/*'], dest: '<%=dirs.dist%>/' }
				]
			}
		},

		// Linting
		csslint: {
			options: {
				'empty-rules': false,
				important: false,
				ids: false
			},
			strict: {
				src: ['<%=dirs.src%>/**/*.css']
			}
		},
		jshint: {
			options: {
				strict: false,
				curly: true,
				eqeqeq: true,
				immed: true,
				latedef: true,
				newcap: true,
				noarg: true,
				sub: true,
				boss: true,
				eqnull: true,
				browser: true,
				undef: false,
				expr: true,
				globals: {
					jQuery: true,
					'$': true
				}
			},
			beforeconcat: ['grunt.js', '<%=dirs.src%>/core.js', '<%=dirs.src%>/*/*.js']
		}
	});

	// Parse command line options
	grunt.registerTask('init', 'Initialise build configuration.', function(basic) {
		// Grab command-line options, using valid defaults if not given
		var done = this.async(),
			stable = grunt.option('stable') === true,
			plugins = (grunt.option('plugins') || Object.keys( grunt.config('plugins')).join(' ')).replace(/ /g, ' ').split(' '),
			styles = (grunt.option('styles') || Object.keys( grunt.config('styles')).join(' ')).replace(/ /g, ' ').split(' '),
			valid, lib;

		// Setup JS/CSS arrays
		var js = ['<banner:meta.banners.full>', '<%=dirs.src%>/intro.js', '<%=dirs.src%>/core.js'],
			css = ['<banner:meta.banners.full>', '<%=dirs.src%>/core.css'],
			dist = grunt.option('dist') || 'dist';

		// If basic... go into dist/basic
		if(basic) { dist += '/basic'; }

		// Parse 'dist' option (decides which directory to build into)
		grunt.config('dirs.dist', dist);

		// Parse 'styles' option (decides which stylesheets are included)
		if(!basic && grunt.option('styles') !== 0) {
			styles.forEach(function(style, i) {
				if( (valid = grunt.config('styles.'+style)) ) {
					css.push(valid);
				}
				else { styles[i] = style+('*'.red); }
			});
		}
		else { styles = ['None']; }

		// Parse 'plugins' option (decides which plugins are included)
		if(!basic && grunt.option('plugins') !== 0) {
			plugins.forEach(function(plugin, i) {
				if( (valid = grunt.config('plugins.'+plugin)) ) {
					if(valid.js) { js.push(valid.js); }
					if(valid.css) { css.push(valid.css); }
				}
				else { plugins[i] = plugin+('*'.red); }
			});
		}
		else { plugins = ['None']; }

		// Add outro
		js.push('<%=dirs.src%>/outro.js');

		// Update concatenation config
		grunt.config('concat.dist.src', js);
		grunt.config('concat.css.src', css);

		// Setup in-file text replacements (version, date etc)
		grunt.util.spawn({ cmd: 'git', args: ['describe'] }, function(err, data) {
			// Ensyure it succeed
			if(data.code > 1) {
				grunt.log.write('Uhoh... couldn\'t grab Git repository description. Somethings up!');
				return done();
			}

			var version = stable ? grunt.config('pkg.version') : data.stdout.substr(0,10),
				strStyles = styles.length ? styles.join(' ') : '',
				strPlugins = plugins.length ? plugins.join(' ') : '';

			var buildprops = (plugins.length ? ' * Plugins: '+strPlugins+'\n' : '') +
				(styles.length ? ' * Styles: '+strStyles+'\n' : '');

			var minbuildprops = plugins[0] !== 'None' || styles[0] !== 'None' ?
				'(includes: ' +
					(plugins[0] !== 'None' ? strPlugins : '') +
					(styles[0] !== 'None' ? ' / ' + strStyles : '') + ') '
				: '';

			grunt.config('replace.dist.options.variables', {
				'BUILDPROPS': buildprops,
				'MINBUILDPROPS': minbuildprops,
				'VERSION': stable ? version : version.substr(1),
				'vVERSION': stable ? 'v'+version : version,
				'DATE': grunt.template.today("dd-mm-yyyy"),
				'STYLES': strStyles,
				'PLUGINS': strPlugins
			});

			// Output current build properties
			grunt.log.write("\nBuilding " + "qTip2".green + " "+version+" with " +
				"plugins " + plugins.join(' ').green + " and " +
				"styles "  +styles.join(' ').green + "\n"
			);

			done(version);
		});
	});

	var defaultTasks = ['concat:dist', 'concat:css', 'uglify', 'cssmin', 'concat:libs', 'replace'];

	// Setup tasks
	grunt.registerTask('basic', ['init:basic', 'clean'].concat(defaultTasks));
	grunt.registerTask('default', ['init', 'clean'].concat(defaultTasks));
	grunt.registerTask('dev', ['init', 'clean', 'jshint', 'csslint'].concat(defaultTasks));
	grunt.registerTask('css', ['init', 'clean', 'csslint', 'concat:css', 'cssmin', 'replace']);
	grunt.registerTask('all', ['init', 'clean'].concat(defaultTasks).concat(['init:basic']).concat(defaultTasks));
};
<|endoftext|>


<commit_before>require('es6-promise').polyfill();

module.exports = function(grunt) {

  var sauceLaunchers = require('./test/sauceLaunchers');

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      options: {
        jshintrc: true
      }
    },
    mochaTest: {
      test: {
        src: ['test/**/*.spec.js']
      }
    },
    browserify: {
      dist: {
        src: ['src/index.js'],
        dest: 'dist/<%= pkg.name %>.js',
        options: {
          browserifyOptions: {
            standalone: 'Reflux'
          }
        },
      }
    },
    uglify: {
      dist: {
        src: 'dist/reflux.js',
        dest: 'dist/reflux.min.js'
      }
    },
    watch: {
      files: ['<%= jshint.files %>'],
      tasks: ['build']
    },
    karma: {
      local: {
        configFile: 'karma.conf.js',
        options: {
            browsers: ['PhantomJS']
        }
      },
      sauce: {
        configFile: 'karma.conf.js',
        options: {
          reporters: ['dots', 'saucelabs'],
          sauceLabs: {
            public: 'public',
            testName: 'RefluxJS Karma Tests',
            recordVideo: false,
            recordScreenshot: false
          },
          customLaunchers: sauceLaunchers,
          browsers: Object.keys(sauceLaunchers),
          captureTimeout: 120000
        }
      }
    }
  });

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.registerTask('test', ['jshint', 'mochaTest', 'karma:local']);

  grunt.registerTask('travis', ['test', 'karma:sauce']);

  grunt.registerTask('build', ['test', 'browserify', 'uglify']);

  grunt.registerTask('default', ['watch']);

};
<commit_msg>Test conf fiddling<commit_after>require('es6-promise').polyfill();

module.exports = function(grunt) {

  var sauceLaunchers = require('./test/sauceLaunchers');

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      options: {
        jshintrc: true
      }
    },
    mochaTest: {
      test: {
        src: ['test/**/*.spec.js']
      }
    },
    browserify: {
      dist: {
        src: ['src/index.js'],
        dest: 'dist/<%= pkg.name %>.js',
        options: {
          browserifyOptions: {
            standalone: 'Reflux'
          }
        },
      }
    },
    uglify: {
      dist: {
        src: 'dist/reflux.js',
        dest: 'dist/reflux.min.js'
      }
    },
    watch: {
      files: ['<%= jshint.files %>'],
      tasks: ['build']
    },
    karma: {
      local: {
        configFile: 'karma.conf.js',
        options: {
            browsers: ['PhantomJS']
        }
      },
      sauce: {
        configFile: 'karma.conf.js',
        options: {
          reporters: ['saucelabs', 'dots'],
          sauceLabs: {
            "public": "public",
            testName: 'RefluxJS Karma Tests',
            recordVideo: false,
            recordScreenshot: false,
            tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
          },
          customLaunchers: sauceLaunchers,
          browsers: Object.keys(sauceLaunchers),
          captureTimeout: 120000
        },
      }
    }
  });

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.registerTask('test', ['jshint', 'mochaTest', 'karma:local']);

  grunt.registerTask('travis', ['jshint', 'karma:sauce']);

  grunt.registerTask('build', ['test', 'browserify', 'uglify']);

  grunt.registerTask('default', ['watch']);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

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

    clean: {
      bin: ['<%= pkg.project.directories.bin %>'],
      build: ['<%= pkg.project.directories.build %>']
    },

    mkdir: {
      all: {
        options: {
          create: [
            '<%= pkg.project.directories.build %>/core',
            '<%= pkg.project.directories.build %>/watchdog',
            '<%= pkg.project.directories.build %>/jsengine'
          ]
        }
      }
    },

    shell: {
      cmake_core: {
        command: 'cmake -DPOCO_INCLUDE_DIR=../../node_modules/poco/include -DSOCI_INCLUDE_DIR=../../node_modules/soci/include/soci -DCMAKE_LIBRARY_PATH=../../node_modules/ ../../<%= pkg.project.directories.core %>',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/core'
          }
        }
      },
      cmake_jsengine: {
        command: 'cmake -DPOCO_INCLUDE_DIR=../../node_modules/poco/include -DSOCI_INCLUDE_DIR=../../node_modules/soci/include/soci -DCMAKE_LIBRARY_PATH=../../node_modules/ ../../<%= pkg.project.directories.jsengine %>',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/jsengine'
          }
        }
      },
      cmake_watchdog: {
        command: 'cmake ../../<%= pkg.project.directories.watchdog %>',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/watchdog'
          }
        }
      },
      make_core: {
        command: 'make -j4',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/core'
          }
        }
      },
      make_jsengine: {
        command: 'make -j4',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/jsengine'
          }
        }
      },
      make_watchdog: {
        command: 'make -j4',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/watchdog'
          }
        }
      },
      test_core: {
        command: './susi_test --gtest_filter="'+(grunt.option("filter")||"*")+'"',
        options: {
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/core'
          }
        }
      }
    },

    copy: {
      core: {
        options: {
          mode: true
        },
        files: [
          {
            expand: true,
            flatten: true,
            src: [
              '<%= pkg.project.directories.build %>/core/susi',
              '<%= pkg.project.directories.build %>/core/libsusi.so'
            ],
            dest: '<%= pkg.project.directories.bin %>'
          }
        ]
      },
      jsengine: {
        options: {
          mode: true
        },
        files: [
          {
            expand: true,
            flatten: true,
            src: ['<%= pkg.project.directories.build %>/jsengine/susi-jsengine'],
            dest: '<%= pkg.project.directories.bin %>'
          }
        ]
      },
      watchdog: {
        options: {
          mode: true
        },
        files: [
          {
            expand: true,
            flatten: true,
            src: ['<%= pkg.project.directories.build %>/watchdog/watchdog'],
            dest: '<%= pkg.project.directories.bin %>'
          }
        ]
      }
    },
    watch: {
      sources: {
        files: ['**/*.cpp','**/*.h'],
        tasks: ['development','watch:sources']
      }
    },
  });

  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-mkdir');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-newer');
  grunt.loadNpmTasks('grunt-debian-package');

  var register = function(name){
    grunt.registerTask(name,'build '+name,[
      'mkdir',
      'shell:cmake_'+name,
      'shell:make_'+name,
      'newer:copy:'+name
    ]);
  };

  register('core');
  register('jsengine');
  register('watchdog');

  grunt.registerTask('test', 'run the susi tests', ['development','shell:test_core']);

  grunt.registerTask('development', ['core','jsengine','watchdog']);
  grunt.registerTask('build', ['clean','core','jsengine','watchdog']);

  grunt.registerTask('dev',['development']);
  grunt.registerTask('default', ['development']);

};
<commit_msg>[watchdog] removed from grunt;<commit_after>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

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

    clean: {
      bin: ['<%= pkg.project.directories.bin %>'],
      build: ['<%= pkg.project.directories.build %>']
    },

    mkdir: {
      all: {
        options: {
          create: [
            '<%= pkg.project.directories.build %>/core',
            '<%= pkg.project.directories.build %>/watchdog',
            '<%= pkg.project.directories.build %>/jsengine'
          ]
        }
      }
    },

    shell: {
      cmake_core: {
        command: 'cmake -DPOCO_INCLUDE_DIR=../../node_modules/poco/include -DSOCI_INCLUDE_DIR=../../node_modules/soci/include/soci -DCMAKE_LIBRARY_PATH=../../node_modules/ ../../<%= pkg.project.directories.core %>',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/core'
          }
        }
      },
      cmake_jsengine: {
        command: 'cmake -DPOCO_INCLUDE_DIR=../../node_modules/poco/include -DSOCI_INCLUDE_DIR=../../node_modules/soci/include/soci -DCMAKE_LIBRARY_PATH=../../node_modules/ ../../<%= pkg.project.directories.jsengine %>',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/jsengine'
          }
        }
      },
      make_core: {
        command: 'make -j4',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/core'
          }
        }
      },
      make_jsengine: {
        command: 'make -j4',
        options: {
          stderr: false,
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/jsengine'
          }
        }
      },
      test_core: {
        command: './susi_test --gtest_filter="'+(grunt.option("filter")||"*")+'"',
        options: {
          execOptions: {
            cwd: '<%= pkg.project.directories.build %>/core'
          }
        }
      }
    },

    copy: {
      core: {
        options: {
          mode: true
        },
        files: [
          {
            expand: true,
            flatten: true,
            src: [
              '<%= pkg.project.directories.build %>/core/susi',
              '<%= pkg.project.directories.build %>/core/libsusi.so'
            ],
            dest: '<%= pkg.project.directories.bin %>'
          }
        ]
      },
      jsengine: {
        options: {
          mode: true
        },
        files: [
          {
            expand: true,
            flatten: true,
            src: ['<%= pkg.project.directories.build %>/jsengine/susi-jsengine'],
            dest: '<%= pkg.project.directories.bin %>'
          }
        ]
      }
    },
    watch: {
      sources: {
        files: ['**/*.cpp','**/*.h'],
        tasks: ['development','watch:sources']
      }
    },
  });

  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-mkdir');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-newer');
  grunt.loadNpmTasks('grunt-debian-package');

  var register = function(name){
    grunt.registerTask(name,'build '+name,[
      'mkdir',
      'shell:cmake_'+name,
      'shell:make_'+name,
      'newer:copy:'+name
    ]);
  };

  register('core');
  register('jsengine');

  grunt.registerTask('test', 'run the susi tests', ['development','shell:test_core']);

  grunt.registerTask('development', ['core','jsengine']);
  grunt.registerTask('build', ['clean','core','jsengine']);

  grunt.registerTask('dev',['development']);
  grunt.registerTask('default', ['development']);

};
<|endoftext|>