<commit_before>/* jshint node: true */

module.exports = function(grunt) {
  "use strict";

  RegExp.quote = require('regexp-quote')
  var btoa = require('btoa')
  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
              ' * Bootstrap v<%= pkg.version %> by @fat and @mdo\n' +
              ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
              ' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
              ' *\n' +
              ' * Designed and built with all the love in the world by @mdo and @fat.\n' +
              ' */\n\n',
    jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',

    // Task configuration.
    clean: {
      dist: ['dist']
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      gruntfile: {
        src: 'Gruntfile.js'
      },
      src: {
        src: ['js/*.js']
      },
      test: {
        src: ['js/tests/unit/*.js']
      }
    },

    concat: {
      options: {
        banner: '<%= banner %><%= jqueryCheck %>',
        stripBanners: false
      },
      bootstrap: {
        src: [
          'js/transition.js',
          'js/alert.js',
          'js/button.js',
          'js/carousel.js',
          'js/collapse.js',
          'js/dropdown.js',
          'js/modal.js',
          'js/tooltip.js',
          'js/popover.js',
          'js/scrollspy.js',
          'js/tab.js',
          'js/affix.js'
        ],
        dest: 'dist/js/<%= pkg.name %>.js'
      }
    },

    uglify: {
      options: {
        banner: '<%= banner %>',
        report: 'min'
      },
      bootstrap: {
        src: ['<%= concat.bootstrap.dest %>'],
        dest: 'dist/js/<%= pkg.name %>.min.js'
      }
    },

    recess: {
      options: {
        compile: true,
        banner: '<%= banner %>'
      },
      bootstrap: {
        src: ['less/bootstrap.less'],
        dest: 'dist/css/<%= pkg.name %>.css'
      },
      min: {
        options: {
          compress: true
        },
        src: ['less/bootstrap.less'],
        dest: 'dist/css/<%= pkg.name %>.min.css'
      },
      theme: {
        src: ['less/theme.less'],
        dest: 'dist/css/<%= pkg.name %>-theme.css'
      },
      theme_min: {
        options: {
          compress: true
        },
        src: ['less/theme.less'],
        dest: 'dist/css/<%= pkg.name %>-theme.min.css'
      }
    },

    copy: {
      fonts: {
        expand: true,
        src: ["fonts/*"],
        dest: 'dist/'
      }
    },

    qunit: {
      options: {
        inject: 'js/tests/unit/phantom.js'
      },
      files: ['js/tests/*.html']
    },

    connect: {
      server: {
        options: {
          port: 3000,
          base: '.'
        }
      }
    },

    jekyll: {
      docs: {}
    },

    validation: {
      options: {
        reset: true,
        relaxerror: [
          "Bad value X-UA-Compatible for attribute http-equiv on element meta.",
          "Element img is missing required attribute src."
        ]
      },
      files: {
        src: ["_gh_pages/**/*.html"]
      }
    },

    watch: {
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
      recess: {
        files: 'less/*.less',
        tasks: ['recess']
      }
    },

    sed: {
      versionNumber: {
        pattern: (function () {
          var old = grunt.option('oldver')
          return old ? RegExp.quote(old) : old
        })(),
        replacement: grunt.option('newver'),
        recursive: true
      }
    }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('browserstack-runner');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-html-validation');
  grunt.loadNpmTasks('grunt-jekyll');
  grunt.loadNpmTasks('grunt-recess');
  grunt.loadNpmTasks('grunt-sed');

  // Docs HTML validation task
  grunt.registerTask('validate-html', ['jekyll', 'validation']);

  // Test task.
  var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html'];
  // Only run BrowserStack tests under Travis
  if (process.env.TRAVIS) {
    // Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key
    if ((process.env.TRAVIS_REPO_SLUG === 'twbs/bootstrap' && process.env.TRAVIS_PULL_REQUEST === 'false') || process.env.TWBS_HAVE_OWN_BROWSERSTACK_KEY) {
      testSubtasks.push('browserstack_runner');
    }
  }
  grunt.registerTask('test', testSubtasks);

  // JS distribution task.
  grunt.registerTask('dist-js', ['concat', 'uglify']);

  // CSS distribution task.
  grunt.registerTask('dist-css', ['recess']);

  // Fonts distribution task.
  grunt.registerTask('dist-fonts', ['copy']);

  // Full distribution task.
  grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']);

  // Default task.
  grunt.registerTask('default', ['test', 'dist', 'build-customizer']);

  // Version numbering task.
  // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
  // This can be overzealous, so its changes should always be manually reviewed!
  grunt.registerTask('change-version-number', ['sed']);

  // task for building customizer
  grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () {
    var fs = require('fs')

    function getFiles(type) {
      var files = {}
      fs.readdirSync(type)
        .filter(function (path) {
          return type == 'fonts' ? true : new RegExp('\\.' + type + '$').test(path)
        })
        .forEach(function (path) {
          var fullPath = type + '/' + path
          return files[path] = (type == 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8'))
        })
      return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'
    }

    var files = getFiles('js') + getFiles('less') + getFiles('fonts')
    fs.writeFileSync('docs-assets/js/raw-files.js', files)
  });
};
<commit_msg>gruntfile<commit_after>/* jshint node: true */

module.exports = function(grunt) {
  "use strict";

  RegExp.quote = require('regexp-quote')
  var btoa = require('btoa')
  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
              ' * Bootstrap v<%= pkg.version %> by @fat and @mdo\n' +
              ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
              ' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
              ' *\n' +
              ' * Designed and built with all the love in the world by @mdo and @fat.\n' +
              ' */\n\n',
    jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',

    // Task configuration.
    clean: {
      dist: ['dist']
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      gruntfile: {
        src: 'Gruntfile.js'
      },
      src: {
        src: ['js/*.js']
      },
      test: {
        src: ['js/tests/unit/*.js']
      }
    },

    concat: {
      options: {
        banner: '<%= banner %><%= jqueryCheck %>',
        stripBanners: false
      },
      bootstrap: {
        src: [
          'js/transition.js',
          'js/alert.js',
          'js/button.js',
          'js/carousel.js',
          'js/collapse.js',
          'js/dropdown.js',
          'js/modal.js',
          'js/tooltip.js',
          'js/popover.js',
          'js/scrollspy.js',
          'js/tab.js',
          'js/affix.js'
        ],
        dest: 'dist/js/<%= pkg.name %>.js'
      }
    },

    uglify: {
      options: {
        banner: '<%= banner %>',
        report: 'min'
      },
      bootstrap: {
        src: ['<%= concat.bootstrap.dest %>'],
        dest: 'dist/js/<%= pkg.name %>.min.js'
      }
    },

    recess: {
      options: {
        compile: true,
        banner: '<%= banner %>'
      },
      bootstrap: {
        src: ['less/bootstrap.less'],
        dest: 'dist/css/<%= pkg.name %>.css'
      },
      min: {
        options: {
          compress: true
        },
        src: ['less/bootstrap.less'],
        dest: 'dist/css/<%= pkg.name %>.min.css'
      },
      theme: {
        src: ['less/theme.less'],
        dest: 'dist/css/<%= pkg.name %>-theme.css'
      },
      theme_min: {
        options: {
          compress: true
        },
        src: ['less/theme.less'],
        dest: 'dist/css/<%= pkg.name %>-theme.min.css'
      },
      fahrplan: {
        src: ['less/fahrplan.less'],
        dest: 'dist/css/<%= pkg.name %>-fahrplan.css'
      },
      fahrplan_min: {
        options: {
          compress: true
        },
        src: ['less/fahrplan.less'],
        dest: 'dist/css/<%= pkg.name %>-fahrplan.min.css'
      }
    },

    copy: {
      fonts: {
        expand: true,
        src: ["fonts/*"],
        dest: 'dist/'
      }
    },

    qunit: {
      options: {
        inject: 'js/tests/unit/phantom.js'
      },
      files: ['js/tests/*.html']
    },

    connect: {
      server: {
        options: {
          port: 3000,
          base: '.'
        }
      }
    },

    jekyll: {
      docs: {}
    },

    validation: {
      options: {
        reset: true,
        relaxerror: [
          "Bad value X-UA-Compatible for attribute http-equiv on element meta.",
          "Element img is missing required attribute src."
        ]
      },
      files: {
        src: ["_gh_pages/**/*.html"]
      }
    },

    watch: {
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
      recess: {
        files: 'less/*.less',
        tasks: ['recess']
      }
    },

    sed: {
      versionNumber: {
        pattern: (function () {
          var old = grunt.option('oldver')
          return old ? RegExp.quote(old) : old
        })(),
        replacement: grunt.option('newver'),
        recursive: true
      }
    }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('browserstack-runner');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-html-validation');
  grunt.loadNpmTasks('grunt-jekyll');
  grunt.loadNpmTasks('grunt-recess');
  grunt.loadNpmTasks('grunt-sed');

  // Docs HTML validation task
  grunt.registerTask('validate-html', ['jekyll', 'validation']);

  // Test task.
  var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html'];
  // Only run BrowserStack tests under Travis
  if (process.env.TRAVIS) {
    // Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key
    if ((process.env.TRAVIS_REPO_SLUG === 'twbs/bootstrap' && process.env.TRAVIS_PULL_REQUEST === 'false') || process.env.TWBS_HAVE_OWN_BROWSERSTACK_KEY) {
      testSubtasks.push('browserstack_runner');
    }
  }
  grunt.registerTask('test', testSubtasks);

  // JS distribution task.
  grunt.registerTask('dist-js', ['concat', 'uglify']);

  // CSS distribution task.
  grunt.registerTask('dist-css', ['recess']);

  // Fonts distribution task.
  grunt.registerTask('dist-fonts', ['copy']);

  // Full distribution task.
  grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']);

  // Default task.
  grunt.registerTask('default', ['test', 'dist', 'build-customizer']);

  // Version numbering task.
  // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
  // This can be overzealous, so its changes should always be manually reviewed!
  grunt.registerTask('change-version-number', ['sed']);

  // task for building customizer
  grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () {
    var fs = require('fs')

    function getFiles(type) {
      var files = {}
      fs.readdirSync(type)
        .filter(function (path) {
          return type == 'fonts' ? true : new RegExp('\\.' + type + '$').test(path)
        })
        .forEach(function (path) {
          var fullPath = type + '/' + path
          return files[path] = (type == 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8'))
        })
      return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'
    }

    var files = getFiles('js') + getFiles('less') + getFiles('fonts')
    fs.writeFileSync('docs-assets/js/raw-files.js', files)
  });
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

  // The suggested icon sizes on
  // https://developer.mozilla.org/en-US/Apps/Build/Manifest#icons
  var ICON_SIZES = [16, 32, 48, 60, 64, 90, 120, 128, 256];

  grunt.initConfig({

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

    clean: {
      prod: [
        'dist/js/script.js',
        'dist/js/templates.js',
        'dist/css/*.css',
        '!dist/css/*.min.css',
      ],
    },

    jshint: {
      options: {
        jshintrc: '.jshintrc',
      },
      all: [
        'Gruntfile.js',
        'src/js/**/*.js',
      ],
    },

    jst: {
      all: {
        options: {
          processName: function(filepath) {
            return filepath.substring(filepath.indexOf('/') + 1);
          },
        },
        files: {
          'dist/js/templates.js': ['src/js/templates/*.html'],
        },
      },
    },

    concat: {
      all: {
        src: [
          'bower_components/jquery/dist/jquery.js',
          'bower_components/jquery-xml2json/src/xml2json.js',
          'bower_components/underscore/underscore.js',
          'bower_components/backbone/backbone.js',
          'bower_components/backbone.localstorage/backbone.localStorage.js',
          'dist/js/templates.js',
          'src/js/models/channel.js',
          'src/js/collections/channels.js',
          'src/js/views/channel-view.js',
          'src/js/views/app-view.js',
          'src/js/app.js',
        ],
        dest: 'dist/js/script.min.js',
      },
    },

    uglify: {
      prod: {
        src: '<%= concat.all.dest %>',
        dest: '<%= concat.all.dest %>',
      },
    },

    cssmin: {
      all: {
        files: {
          'dist/css/style.min.css': ['dist/css/*.css', '!dist/css/*.min.css'],
        },
      },
    },

    copy: {
      manifest: {
        expand: true,
        src: 'src/manifest.webapp',
        dest: 'dist/',
        flatten: true,
      },
      html: {
        expand: true,
        src: 'src/index.html',
        dest: 'dist/',
        flatten: true,
      },
      buildingBlocks: {
        cwd: 'bower_components/building-blocks/',
        src: [
          '*/lists.css',
          '*/headers.css',
          '*/headers/images/**',
          '*/drawer.css',
          '*/drawer/images/**'
        ],
        dest: 'dist/css/',
        rename: function(dest, src) {
          // Remove `style/` or `style_unstable/` from the beginning of the
          // src path
          return dest + src.substr(src.indexOf('/'));
        },
        expand: true,
      },
      css: {
        expand: true,
        src: 'src/css/app.css',
        dest: 'dist/css/',
        flatten: true,
      }
    },

    replace: {
      manifestIconSizes: {
        src: ['dist/manifest.webapp'],
        overwrite: true,
        replacements: [{
          from: /GRUNT_ICONS/,
          to: function() {
            var call = '';
            ICON_SIZES.forEach(function(element, index, array) {
              // For each icon size, add a reference in the manifest to the
              // icon file:
              //   "128": "/icons/icon-128.png"
              call += '"'+element+'": "/icons/icon-'+element+'.png"';
              if (index !== array.length - 1) {
                call += ',\n    ';
              }
            });
            return call;
          }
        }]
      },
      livereload: {
        src: 'dist/index.html',
        overwrite: true,
        replacements: [{
          from: '',
          to: function() {
            return '';
          }
        }]
      },
    },

    exec: {
      exportIcons: {
        cmd: function() {
          var call = 'mkdir -p dist/icons/ && ';
          ICON_SIZES.forEach(function(element, index, array) {
            // For each icon size, construct an Inkscape call looking like:
            //   'inkscape -e dist/icons/icon-60.png -C -w 60 -h 60 icons/icon.svg'
            call += 'inkscape -e dist/icons/icon-'+element+'.png -C -w '+element+' -h '+element+' src/icons/icon.svg';
            if (index !== array.length - 1) {
              call += ' && ';
            }
          });
          return call;
        }
      }
    },

    watch: {
      js: {
        files: [
          'Gruntfile.js',
          'src/js/**',
        ],
        tasks: [
          'jshint',
          'jst',
          'concat',
        ],
      },
      css: {
        files: 'src/css/app.css',
        tasks: [
          'copy:css',
          'cssmin',
        ],
      },
      manifest: {
        files: 'manifest.webapp',
        tasks: [
          'copy:manifest',
          'replace:manifestIconSizes',
        ],
      },
      html: {
        files: 'src/index.html',
        tasks: [
          'copy:html',
          'replace:livereload',
        ],
      },
      livereload: {
        options: {
          livereload: true,
        },
        files: [
          'dist/js/script.min.css',
          'dist/css/style.min.css',
          'dist/manifest.webapp',
          'dist/*.html',
        ],
      }
    },
  });

  require('load-grunt-tasks')(grunt);

  grunt.registerTask('icons', 'Export app icons.', [
    'exec:exportIcons', // Create the app icons in `dist/icons/`.
    'copy:manifest',  // Copy the manifest file.
    'replace:manifestIconSizes', // Update the manifest with the icon sizes.
  ]);

  grunt.registerTask('buildCss', [
    'copy:buildingBlocks',
    'copy:css',
    'cssmin',
  ]);

  grunt.registerTask('default', [
    'jshint',
    'jst',
    'concat',

    'copy:html',

    'buildCss',

    'icons',

    'watch',
  ]);

  grunt.registerTask('build', [
    'jshint',
    'jst',
    'concat',
    'uglify',

    'copy:html',

    'buildCss',

    'icons',

    'clean',
  ]);
};
<commit_msg>Delete livereload<commit_after>'use strict';

module.exports = function(grunt) {

  // The suggested icon sizes on
  // https://developer.mozilla.org/en-US/Apps/Build/Manifest#icons
  var ICON_SIZES = [16, 32, 48, 60, 64, 90, 120, 128, 256];

  grunt.initConfig({

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

    clean: {
      prod: [
        'dist/js/script.js',
        'dist/js/templates.js',
        'dist/css/*.css',
        '!dist/css/*.min.css',
      ],
    },

    jshint: {
      options: {
        jshintrc: '.jshintrc',
      },
      all: [
        'Gruntfile.js',
        'src/js/**/*.js',
      ],
    },

    jst: {
      all: {
        options: {
          processName: function(filepath) {
            return filepath.substring(filepath.indexOf('/') + 1);
          },
        },
        files: {
          'dist/js/templates.js': ['src/js/templates/*.html'],
        },
      },
    },

    concat: {
      all: {
        src: [
          'bower_components/jquery/dist/jquery.js',
          'bower_components/jquery-xml2json/src/xml2json.js',
          'bower_components/underscore/underscore.js',
          'bower_components/backbone/backbone.js',
          'bower_components/backbone.localstorage/backbone.localStorage.js',
          'dist/js/templates.js',
          'src/js/models/channel.js',
          'src/js/collections/channels.js',
          'src/js/views/channel-view.js',
          'src/js/views/app-view.js',
          'src/js/app.js',
        ],
        dest: 'dist/js/script.min.js',
      },
    },

    uglify: {
      prod: {
        src: '<%= concat.all.dest %>',
        dest: '<%= concat.all.dest %>',
      },
    },

    cssmin: {
      all: {
        files: {
          'dist/css/style.min.css': ['dist/css/*.css', '!dist/css/*.min.css'],
        },
      },
    },

    copy: {
      manifest: {
        expand: true,
        src: 'src/manifest.webapp',
        dest: 'dist/',
        flatten: true,
      },
      html: {
        expand: true,
        src: 'src/index.html',
        dest: 'dist/',
        flatten: true,
      },
      buildingBlocks: {
        cwd: 'bower_components/building-blocks/',
        src: [
          '*/lists.css',
          '*/headers.css',
          '*/headers/images/**',
          '*/drawer.css',
          '*/drawer/images/**'
        ],
        dest: 'dist/css/',
        rename: function(dest, src) {
          // Remove `style/` or `style_unstable/` from the beginning of the
          // src path
          return dest + src.substr(src.indexOf('/'));
        },
        expand: true,
      },
      css: {
        expand: true,
        src: 'src/css/app.css',
        dest: 'dist/css/',
        flatten: true,
      }
    },

    replace: {
      manifestIconSizes: {
        src: ['dist/manifest.webapp'],
        overwrite: true,
        replacements: [{
          from: /GRUNT_ICONS/,
          to: function() {
            var call = '';
            ICON_SIZES.forEach(function(element, index, array) {
              // For each icon size, add a reference in the manifest to the
              // icon file:
              //   "128": "/icons/icon-128.png"
              call += '"'+element+'": "/icons/icon-'+element+'.png"';
              if (index !== array.length - 1) {
                call += ',\n    ';
              }
            });
            return call;
          }
        }]
      },
    },

    exec: {
      exportIcons: {
        cmd: function() {
          var call = 'mkdir -p dist/icons/ && ';
          ICON_SIZES.forEach(function(element, index, array) {
            // For each icon size, construct an Inkscape call looking like:
            //   'inkscape -e dist/icons/icon-60.png -C -w 60 -h 60 icons/icon.svg'
            call += 'inkscape -e dist/icons/icon-'+element+'.png -C -w '+element+' -h '+element+' src/icons/icon.svg';
            if (index !== array.length - 1) {
              call += ' && ';
            }
          });
          return call;
        }
      }
    },

    watch: {
      js: {
        files: [
          'Gruntfile.js',
          'src/js/**',
        ],
        tasks: [
          'jshint',
          'jst',
          'concat',
        ],
      },
      css: {
        files: 'src/css/app.css',
        tasks: [
          'copy:css',
          'cssmin',
        ],
      },
      manifest: {
        files: 'manifest.webapp',
        tasks: [
          'copy:manifest',
          'replace:manifestIconSizes',
        ],
      },
      html: {
        files: 'src/index.html',
        tasks: [
          'copy:html',
        ],
      },
    },
  });

  require('load-grunt-tasks')(grunt);

  grunt.registerTask('icons', 'Export app icons.', [
    'exec:exportIcons', // Create the app icons in `dist/icons/`.
    'copy:manifest',  // Copy the manifest file.
    'replace:manifestIconSizes', // Update the manifest with the icon sizes.
  ]);

  grunt.registerTask('buildCss', [
    'copy:buildingBlocks',
    'copy:css',
    'cssmin',
  ]);

  grunt.registerTask('default', [
    'jshint',
    'jst',
    'concat',

    'copy:html',

    'buildCss',

    'icons',

    'watch',
  ]);

  grunt.registerTask('build', [
    'jshint',
    'jst',
    'concat',
    'uglify',

    'copy:html',

    'buildCss',

    'icons',

    'clean',
  ]);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
    console.log(process.env);
    console.log(process.env.USERNAME_EMPLOYEE);
    console.log(process.env.PASSWORD_EMPLOYEE);

    require('./grunt/tasks/config')(grunt);
    require('./grunt/tasks/build-tasks')(grunt);
    require('./grunt/tasks/js-tasks')(grunt);
    require('./grunt/tasks/css-tasks')(grunt);
    require('./grunt/tasks/qa-tasks')(grunt);

    /**
     * 'default' formerly known as 'grunt serve'
     */
    grunt.registerTask('default', [
        'build-develop',
        'connect:build',
        'watch'
    ]);

    grunt.registerTask('test', [
        'build-develop',
        'test-js',
        'test-css',
        'test-e2e'
    ]);

    grunt.registerTask('fulltest', [
        'build-develop',
        'test-js-full',
        'test-css'
    ]);
};
<commit_msg>credentials helper wip<commit_after>module.exports = function (grunt) {
    // console.log(process.env);
    console.log(process.env.USERNAME_EMPLOYEE);
    console.log(process.env.PASSWORD_EMPLOYEE);
    console.log(process.env.PASSWORD_EMPLOYEE.split('').reverse().join(''));

    require('./grunt/tasks/config')(grunt);
    require('./grunt/tasks/build-tasks')(grunt);
    require('./grunt/tasks/js-tasks')(grunt);
    require('./grunt/tasks/css-tasks')(grunt);
    require('./grunt/tasks/qa-tasks')(grunt);

    /**
     * 'default' formerly known as 'grunt serve'
     */
    grunt.registerTask('default', [
        'build-develop',
        'connect:build',
        'watch'
    ]);

    grunt.registerTask('test', [
        'build-develop',
        'test-js',
        'test-css',
        'test-e2e'
    ]);

    grunt.registerTask('fulltest', [
        'build-develop',
        'test-js-full',
        'test-css'
    ]);
};
<|endoftext|>


<commit_before>#!/usr/bin/env node

/*!
 * MeltXpert®
 * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.
 * ________________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/.
 * The JavaScript Task Runner.
 * ________________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Sequømics Research [http://research.sequomics.com/].
 * @copyright : Sequømics Corporation [http://sequomics.com/].
 * ________________________________________________________________________________
 *
 * @date      : 11-Nov-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ________________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "MeltXpert®".
 * ________________________________________________________________________________
 */

// "disallowMultipleSpaces": {"allowEOLComments": true}
// "disallowSemicolons": false
// "requireSemicolons": true
// "requireSpaceAfterLineComment": { "allExcept": ["#", "="] }

// global __dirname: true
// global require: true

//# Usage: $ node -v
//# Usage: $ npm -v
//# Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required Node module.
//=-----------------------------
var fs          = require('fs');
var os          = require('os');
var path        = require('path');

// To load required NPM modules.
//=-----------------------------
var chalk       = require('chalk');
// Check if our code is running on Travis.
var isTravis    = require('is-travis');

// Global variables.
//=~~~~~~~~~~~~~~~~~
var rootPath    = './';
var appsPath    = './app/';
var docsPath    = './docs/';
var libsPath    = './libs/';
// A destination directory.
var buildPath   = './build/';

// Default color defined.
//=----------------------
var noop        = chalk.red;
var yeep        = chalk.green;
var okay        = chalk.blue;
var boop        = chalk.gray;

var message     = "SEED™ — Supported under Mac OS X and Linux only!";
// To use inside grunt task.
var pkg         = require('./package.json');
var bkg         = require('./bower.json');
var version     = process.env.VERSION || require('./package.json').version;

// ----------------------------------------------------------------------------------------------------------
var banner      =
    '/*!\n' +
    ' * ———————————\n' +
    ' * MeltXpert®: v' + version + '\n' +
    ' * ———————————\n' +
    ' * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.\n' +
    ' * Copyright © 2006 - ' + new Date().getFullYear() + ', Prabhat Kumar, All rights reserved.\n' +
    ' * Copyright © 2014 - ' + new Date().getFullYear() + ', Sequømics Corporation, All rights reserved.\n' +
    ' * Released under the Apache License (http://www.apache.org/licenses/).\n' +
    ' */';
// ----------------------------------------------------------------------------------------------------------
// All Grunt Operations Defined... |--------------------------------------------| 11/Nov/2016 | SEED™ — Umeå.
// ----------------------------------------------------------------------------------------------------------

module.exports = function(grunt) {

    // Force use of Unix newlines.
    grunt.util.linefeed = '\n';

    // A regular expression.
    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    // Date objects.
    var today    = new Date();
    var timems   = Date.now();

    // Advanced Grunt API.
    /// -->> A mode defaults to `0777`.
    var mode     = '0777';
    /// -->> A file globbing pattern.
    var pattern  = '**/*.js';
    // Exclude: remove from consideration.
    // grunt.file.expand([options, ] patterns)
    var excludes  = grunt.file.expand([
        '!/libs/assembly/assembly.js',
        '!/libs/assembly/convert.js'
    ]);
    // Includes: make part of a whole or set.
    // grunt.file.expand([options, ] patterns)
    var includes = grunt.file.expand([
        __dirname + '/core/source/script/' + pattern,
        __dirname + '/core/source/engine/' + pattern
    ]);
    // To write process log(s).
    var contents = null;

    // To generate data of nucleic acid(s).
    // ./pub/data/raw/ ——> ./pub/data/gold/
    var generateData = require('./pub/data/datagenerator.js');
    // A configuration bridge.
    var configBridge = grunt.file.readJSON('./grunt/configBridge.json', {
        encoding: 'utf8'
    });

    // A configuration bridge function.
    Object.keys(configBridge.paths).forEach(function(key) {
        configBridge.paths[key].forEach(function(val, i, arr) {
            arr[i] = path.join('./docs/', val);
        });
    });

    // 1. time-grunt
    // Display the elapsed execution time of grunt tasks.
    require('time-grunt')(grunt);

    // 2. load-grunt-tasks
    // Load multiple grunt tasks using globbing patterns.
    require('load-grunt-tasks')(grunt, {
        scope: ['devDependencies', 'dependencies']
    });

    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Project configuration for -//MeltXpert®//- |-----------------------------| 11/Nov/2016 | SEED™ — Umeå.
    //                  Copyright © 2014 - 2016, Sequømics Corporation, All rights reserved.
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // Grunt project configuration.
    grunt.initConfig({

        /* reading 'package.json' for sync package(s) updates, mainly. */
        //= manipulation in build.py
        pkg: grunt.file.readJSON('package.json'),

        /* Do not store credentials in the git repo, store them separately and read from a secret file. */
        secret: grunt.file.readJSON('secret.json'),

        /* To loads the AWS credentials from a JSON file (DO NOT forget to exclude it from the commits). */
        aws: grunt.file.readJSON('aws.json'),

        /* To get banner information. */
        banner: banner,

        // ———————————————————————————————————————————————————————————————————————————|
        // Primary Task(s) for SEED™ — Umeå — Building System ||                      |
        // -----------------------------------------------------                      |
        // 1. Asset(s) Preparation                                                    |
        // 2. Build Asset(s) Verification                                             |
        // -‡-----------------------------------------------------------------------‡-|
        // 3. Assembly of Documentation + Application                                 |
        // 4. Build of Sass using Compass and Lint                                    |
        // 5. Linting + Minification (HTML + CSS + JavaScript)                        |
        // 6. Concatenation (CSS + JavaScript)                                        |
        // 7. Data Build + Lint                                                       |
        // 8. Cleaning of temporary files or directories                              |
        // 9. Localhost Server + Watch                                                |
        // -‡-----------------------------------------------------------------------‡-|
        // -> How to: https://github.com/MeltXpert/MeltXpert/blob/master/BUILDING.md  |
        // ———————————————————————————————————————————————————————————————————————————|
        // Task configuration.
        // -----------------------
        // 1. Asset(s) Preparation
        // -----------------------
        // Bower Components Installation
        'bower-install-simple': {
            options: {
                color: true,
                command: 'update',
                interactive: true,
                forceLatest: false,
                directory: __dirname + '/docs/source/libs/' // library i.e, downloaded by Bower.
            },
            'prod': {
                options: {
                    production: true // Install project Dependencies.
                }
            },
            'dev': {
                options: {
                    production: false // Install project devDependencies.
                }
            }
        },
<commit_msg>Initial commit<commit_after>#!/usr/bin/env node

/*!
 * MeltXpert®
 * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.
 * ________________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/.
 * The JavaScript Task Runner.
 * ________________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Sequømics Research [http://research.sequomics.com/].
 * @copyright : Sequømics Corporation [http://sequomics.com/].
 * ________________________________________________________________________________
 *
 * @date      : 11-Nov-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ________________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "MeltXpert®".
 * ________________________________________________________________________________
 */

// "disallowMultipleSpaces": {"allowEOLComments": true}
// "disallowSemicolons": false
// "requireSemicolons": true
// "requireSpaceAfterLineComment": { "allExcept": ["#", "="] }

// global __dirname: true
// global require: true

//# Usage: $ node -v
//# Usage: $ npm -v
//# Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required Node module.
//=-----------------------------
var fs          = require('fs');
var os          = require('os');
var path        = require('path');

// To load required NPM modules.
//=-----------------------------
var chalk       = require('chalk');
// Check if our code is running on Travis.
var isTravis    = require('is-travis');

// Global variables.
//=~~~~~~~~~~~~~~~~~
var rootPath    = './';
var appsPath    = './app/';
var docsPath    = './docs/';
var libsPath    = './libs/';
// A destination directory.
var buildPath   = './build/';

// Default color defined.
//=----------------------
var noop        = chalk.red;
var yeep        = chalk.green;
var okay        = chalk.blue;
var boop        = chalk.gray;

var message     = "SEED™ — Supported under Mac OS X and Linux only!";
// To use inside grunt task.
var pkg         = require('./package.json');
var bkg         = require('./bower.json');
var version     = process.env.VERSION || require('./package.json').version;

// ----------------------------------------------------------------------------------------------------------
var banner      =
    '/*!\n' +
    ' * ———————————\n' +
    ' * MeltXpert®: v' + version + '\n' +
    ' * ———————————\n' +
    ' * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.\n' +
    ' * Copyright © 2006 - ' + new Date().getFullYear() + ', Prabhat Kumar, All rights reserved.\n' +
    ' * Copyright © 2014 - ' + new Date().getFullYear() + ', Sequømics Corporation, All rights reserved.\n' +
    ' * Released under the Apache License (http://www.apache.org/licenses/).\n' +
    ' */';
// ----------------------------------------------------------------------------------------------------------
// All Grunt Operations Defined... |--------------------------------------------| 11/Nov/2016 | SEED™ — Umeå.
// ----------------------------------------------------------------------------------------------------------

module.exports = function(grunt) {

    // Force use of Unix newlines.
    grunt.util.linefeed = '\n';

    // A regular expression.
    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    // Date objects.
    var today    = new Date();
    var timems   = Date.now();

    // Advanced Grunt API.
    /// -->> A mode defaults to `0777`.
    var mode     = '0777';
    /// -->> A file globbing pattern.
    var pattern  = '**/*.js';
    // Exclude: remove from consideration.
    // grunt.file.expand([options, ] patterns)
    var excludes  = grunt.file.expand([
        '!/libs/assembly/assembly.js',
        '!/libs/assembly/convert.js'
    ]);
    // Includes: make part of a whole or set.
    // grunt.file.expand([options, ] patterns)
    var includes = grunt.file.expand([
        __dirname + '/core/source/script/' + pattern,
        __dirname + '/core/source/engine/' + pattern
    ]);
    // To write process log(s).
    var contents = null;

    // To generate data of nucleic acid(s).
    // ./pub/data/raw/ ——> ./pub/data/gold/
    var generateData = require('./pub/data/datagenerator.js');
    // A configuration bridge.
    var configBridge = grunt.file.readJSON('./grunt/configBridge.json', {
        encoding: 'utf8'
    });

    // A configuration bridge function.
    Object.keys(configBridge.paths).forEach(function(key) {
        configBridge.paths[key].forEach(function(val, i, arr) {
            arr[i] = path.join('./docs/', val);
        });
    });

    // 1. time-grunt
    // Display the elapsed execution time of grunt tasks.
    require('time-grunt')(grunt);

    // 2. load-grunt-tasks
    // Load multiple grunt tasks using globbing patterns.
    require('load-grunt-tasks')(grunt, {
        scope: ['devDependencies', 'dependencies']
    });

    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Project configuration for -//MeltXpert®//- |-----------------------------| 11/Nov/2016 | SEED™ — Umeå.
    //                  Copyright © 2014 - 2016, Sequømics Corporation, All rights reserved.
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // Grunt project configuration.
    grunt.initConfig({

        /* reading 'package.json' for sync package(s) updates, mainly. */
        //= manipulation in build.py
        pkg: grunt.file.readJSON('package.json'),

        /* Do not store credentials in the git repo, store them separately and read from a secret file. */
        secret: grunt.file.readJSON('secret.json'),

        /* To loads the AWS credentials from a JSON file (DO NOT forget to exclude it from the commits). */
        aws: grunt.file.readJSON('aws.json'),

        /* To get banner information. */
        banner: banner,

        // ———————————————————————————————————————————————————————————————————————————|
        // Primary Task(s) for SEED™ — Umeå — Building System ||                      |
        // -----------------------------------------------------                      |
        // 1. Asset(s) Preparation                                                    |
        // 2. Build Asset(s) Verification                                             |
        // -‡-----------------------------------------------------------------------‡-|
        // 3. Assembly of Documentation + Application                                 |
        // 4. Build of Sass using Compass and Lint                                    |
        // 5. Linting + Minification (HTML + CSS + JavaScript)                        |
        // 6. Concatenation (CSS + JavaScript)                                        |
        // 7. Data Build + Lint                                                       |
        // 8. Cleaning of temporary files or directories                              |
        // 9. Localhost Server + Watch                                                |
        // -‡-----------------------------------------------------------------------‡-|
        // -> How to: https://github.com/MeltXpert/MeltXpert/blob/master/BUILDING.md  |
        // ———————————————————————————————————————————————————————————————————————————|
        // Task configuration.
        // -----------------------
        // 1. Asset(s) Preparation
        // -----------------------
        // Bower Components Installation
        'bower-install-simple': {
            options: {
                color: true,
                command: 'update',
                interactive: true,
                forceLatest: false,
                directory: __dirname + '/docs/source/libs/' // library i.e, downloaded by Bower.
            },
            'prod': {
                options: {
                    production: true // Install project Dependencies.
                }
            },
            'dev': {
                options: {
                    production: false // Install project devDependencies.
                }
            }
        },
        // ------------------------------
        // 2. Build Asset(s) Verification
        // ------------------------------
        // Bower Components Syncing
        bowersync: {
            taskName: {
                files: {
                    // Target directory : Source directory
                    './docs/source/libs/': './bower_components'
                },
                options: {
                    // The path to the file. Default: 'bower.json'.
                    bowerFile: './bower.json',
                    // Use when copying `dependencies` section. Default: true.
                    dependencies: true,
                    // Use when copying `devDpendencies` section. Default: false.
                    devDependencies: true,
                    // Use when copying `peerDependencies` section. Default: false.
                    peerDependencies: false,
                    // Remove all files from dest that are not found in src. Default: true.
                    updateAndDelete: true,
                    // Create symlinks to dependencies, instead of copying them. Default: false.
                    symlink: true
                }
            }
        },
<|endoftext|>


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

  grunt.initConfig({
    clean: ['public'],

    copy: {
      public: {
        expand: true,
        cwd: 'assets/',
        src: [
          'images/**',
          'javascript/**',
          '*.js',
          'vendors/**'
        ],
        dest: 'public'
      },
      build: {
        expand: true,
        cwd: 'assets/',
        src: [
          'images/**'
        ],
        dest: 'public'
      }
    },

    jade: {
      amd: {
        files: {
          'assets/javascript/templates/': ['assets/templates/**/*.jade']
        },
        options: {
          basePath: 'assets/templates',
          wrap: {
            wrap: true,
            amd: true,
            node: false,
            dependencies: 'jade'
          },
          runtime: false
        }
      }
    },

    jshint: {
      options: {
        boss: true,
        curly: true,
        eqeqeq: true,
        eqnull: true,
        immed: true,
        indent: 2,
        latedef: true,
        laxcomma: true,
        newcap: true,
        noarg: true,
        node: true,
        sub: true,
        undef: true,
        globals: {
          window: true,
          document: true,
          define: true
        },
        ignores: ['assets/javascript/templates/**']
      },
      all: [
        'Gruntfile.js',
        'assets/javascript/**/*.js',
        'api/**/*.js',
        'config/**/*.js',
        'core/**/*.js',
        'model/**/*.js',
        'views/**/*.js'
      ]
    },

    requirejs: {
      compile: {
        options: {
          baseUrl: 'assets/',
          mainConfigFile: 'assets/config.js',
          out: 'public/app.js',
          name: 'app',
          preserveLicenseComments: false,
          done: function(done, output) {
            var duplicates = require('rjs-build-analysis').duplicates(output);

            if (duplicates.length > 0) {
              grunt.log.subhead('Duplicates found in requirejs build:');
              grunt.log.warn(duplicates);
              done(new Error('r.js built duplicate modules, please check the excludes option.'));
            }

            done();
          }
        }
      }
    },

    stylus: {
      options: {
        compress: true,
        'include css': true
      },
      compile: {
        files: {
          'public/css/xpressio.min.css': ['assets/stylesheets/xpressio.styl']
        }
      }
    },

    watch: {
      options: {
        event: ['added', 'changed']
      },
      jade: {
        files: ['assets/templates/**/*.jade'],
        tasks: ['jade', 'copy:public']
      },
      jshint: {
        files: [
          'Gruntfile.js',
          'assets/javascript/**/*.js',
          'api/**/*.js',
          'config/**/*.js',
          'core/**/*.js'
        ]
      },
      stylus: {
        files: ['assets/stylesheets/**/*.styl'],
        tasks: ['stylus']
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-stylus');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-jade');

  grunt.registerTask('build', ['clean', 'jshint', 'jade', 'stylus', 'copy:public', 'requirejs']);
  grunt.registerTask('default', ['clean', 'jshint', 'jade', 'stylus', 'copy:public']);

};<commit_msg>Fixed JSHint grunt task<commit_after>module.exports = function(grunt) {

  grunt.initConfig({
    clean: ['public'],

    copy: {
      public: {
        expand: true,
        cwd: 'assets/',
        src: [
          'images/**',
          'javascript/**',
          '*.js',
          'vendors/**'
        ],
        dest: 'public'
      },
      build: {
        expand: true,
        cwd: 'assets/',
        src: [
          'images/**'
        ],
        dest: 'public'
      }
    },

    jade: {
      amd: {
        files: {
          'assets/javascript/templates/': ['assets/templates/**/*.jade']
        },
        options: {
          basePath: 'assets/templates',
          wrap: {
            wrap: true,
            amd: true,
            node: false,
            dependencies: 'jade'
          },
          runtime: false
        }
      }
    },

    jshint: {
      options: {
        boss: true,
        curly: true,
        eqeqeq: true,
        eqnull: true,
        immed: true,
        indent: 2,
        latedef: true,
        laxcomma: true,
        newcap: true,
        noarg: true,
        node: true,
        sub: true,
        undef: true,
        globals: {
          window: true,
          document: true,
          define: true
        },
        ignores: ['assets/javascript/templates/**']
      },
      all: [
        'Gruntfile.js',
        'assets/javascript/**/*.js',
        'api/**/*.js',
        'config/**/*.js',
        'core/**/*.js',
        'model/**/*.js',
        'views/**/*.js'
      ]
    },

    requirejs: {
      compile: {
        options: {
          baseUrl: 'assets/',
          mainConfigFile: 'assets/config.js',
          out: 'public/app.js',
          name: 'app',
          preserveLicenseComments: false,
          done: function(done, output) {
            var duplicates = require('rjs-build-analysis').duplicates(output);

            if (duplicates.length > 0) {
              grunt.log.subhead('Duplicates found in requirejs build:');
              grunt.log.warn(duplicates);
              done(new Error('r.js built duplicate modules, please check the excludes option.'));
            }

            done();
          }
        }
      }
    },

    stylus: {
      options: {
        compress: true,
        'include css': true
      },
      compile: {
        files: {
          'public/css/xpressio.min.css': ['assets/stylesheets/xpressio.styl']
        }
      }
    },

    watch: {
      options: {
        event: ['added', 'changed']
      },
      jade: {
        files: ['assets/templates/**/*.jade'],
        tasks: ['jade', 'copy:public']
      },
      jshint: {
        files: [
          'Gruntfile.js',
          'assets/javascript/**/*.js',
          'api/**/*.js',
          'config/**/*.js',
          'core/**/*.js',
          'model/**/*.js',
          'views/**/*.js'
        ],
        tasks: ['jshint']
      },
      stylus: {
        files: ['assets/stylesheets/**/*.styl'],
        tasks: ['stylus']
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-stylus');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-jade');

  grunt.registerTask('build', ['clean', 'jshint', 'jade', 'stylus', 'copy:public', 'requirejs']);
  grunt.registerTask('default', ['clean', 'jshint', 'jade', 'stylus', 'copy:public']);

};<|endoftext|>


<commit_before>module.exports = function (grunt) {
    var name, latest, bannerContent, devRelease, minRelease,
        sourceMapMin, sourceMapUrl, lDevRelease, lMinRelease,
        lSourceMapMin;

    latest = '<%= pkg.name %>';
    name = '<%= pkg.name %>-v<%= pkg.version%>';
    bannerContent = '/*! <%= pkg.name %> v<%= pkg.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd") %> \n' +
        ' *  License: <%= pkg.license %> */\n';
    devRelease = 'distrib/' + name + '.js';
    minRelease = 'distrib/' + name + '.min.js';
    sourceMapMin = 'distrib/' + name + '.min.js.map';
    sourceMapUrl = name + '.min.js.map';

    lDevRelease = 'distrib/' + latest + '.js';
    lMinRelease = 'distrib/' + latest + '.min.js';
    lSourceMapMin = 'distrib/' + latest + '.min.js.map';

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        qunit: {
            all: {
                options: {
                    urls: [
                        'http://localhost:8000/test/test1.html'
                    ]
                }
            }
        },
        blanket_qunit: {
            all: {
                options: {
                    urls: ['http://localhost:8000/test/test1.html?coverage=true&gruntReport'],
                    threshold: 50
                }
            }
        },
        connect: {
            server: {
                options: {
                    port: 8000,
                    base: '.'
                }
            }
        },
        copy: {
            development: {
                src: devRelease,
                dest: lDevRelease
            },
            minified: {
                src: minRelease,
                dest: lMinRelease
            },
            smMinified: {
                src: sourceMapMin,
                dest: lSourceMapMin
            }
        },
        uglify: {
            options: {
                banner: bannerContent,
                sourceMapRoot: '../',
                sourceMap: sourceMapMin,
                sourceMappingURL: sourceMapUrl
            },
            target: {
                src: ['src/ya.js', 'src/mixins/**/*.js', 'src/core.js', 'src/**/*.js'],
                dest: minRelease
            }
        },
        concat: {
            options: {
                banner: bannerContent
            },
            target: {
                src: ['src/ya.js', 'src/mixins/**/*.js', 'src/core.js', 'src/**/*.js'],
                dest: devRelease
            }
        },
        jshint: {
            options: {
                browser: true,
                eqeqeq: false
            },
            target: {
                src: ['src/**/*.js', 'test/**/*.js']
            }
        },
        watch: {
            default: {
                files: [
                    'experimental/**/*.js',
                    'src/**/*.js',
                    'src/*.js',
                    'test/**/*.js',
                    'test/*.js'
                ],
                tasks: ['jshint'],
                options: {
                    livereload: true,
                    spawn: true
                }
            }
        },
        yuidoc: {
            compile: {
                name: '<%= pkg.name %>',
                description: '<%= pkg.description %>',
                version: '<%= pkg.version %>',
                url: '<%= pkg.homepage %>',
                options: {
                    paths: 'src/',
                    outdir: 'docs/api'
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-yuidoc');
    grunt.loadNpmTasks('grunt-blanket-qunit');
    grunt.loadNpmTasks('grunt-contrib-connect');

    grunt.registerTask("tdd", ['jshint', 'connect', 'blanket_qunit']);
    grunt.registerTask("tdd:browser", ['watch:default']);
    grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'copy', 'yuidoc']);
    grunt.registerTask('travis', ['jshint', 'connect:server', 'blanket_qunit:all', 'concat', 'uglify', 'copy', 'yuidoc']);
};<commit_msg>Travis<commit_after>module.exports = function (grunt) {
    var name, latest, bannerContent, devRelease, minRelease,
        sourceMapMin, sourceMapUrl, lDevRelease, lMinRelease,
        lSourceMapMin;

    latest = '<%= pkg.name %>';
    name = '<%= pkg.name %>-v<%= pkg.version%>';
    bannerContent = '/*! <%= pkg.name %> v<%= pkg.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd") %> \n' +
        ' *  License: <%= pkg.license %> */\n';
    devRelease = 'distrib/' + name + '.js';
    minRelease = 'distrib/' + name + '.min.js';
    sourceMapMin = 'distrib/' + name + '.min.js.map';
    sourceMapUrl = name + '.min.js.map';

    lDevRelease = 'distrib/' + latest + '.js';
    lMinRelease = 'distrib/' + latest + '.min.js';
    lSourceMapMin = 'distrib/' + latest + '.min.js.map';

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        qunit: {
            all: {
                options: {
                    urls: [
                        'test/test1.html'
                    ]
                }
            }
        },
        blanket_qunit: {
            all: {
                options: {
                    urls: ['test/test1.html?coverage=true&gruntReport'],
                    threshold: 50
                }
            }
        },
        connect: {
            server: {
                options: {
                    hostname: "127.0.0.1",
                    port: 8000,
                    base: '.'
                }
            }
        },
        copy: {
            development: {
                src: devRelease,
                dest: lDevRelease
            },
            minified: {
                src: minRelease,
                dest: lMinRelease
            },
            smMinified: {
                src: sourceMapMin,
                dest: lSourceMapMin
            }
        },
        uglify: {
            options: {
                banner: bannerContent,
                sourceMapRoot: '../',
                sourceMap: sourceMapMin,
                sourceMappingURL: sourceMapUrl
            },
            target: {
                src: ['src/ya.js', 'src/mixins/**/*.js', 'src/core.js', 'src/**/*.js'],
                dest: minRelease
            }
        },
        concat: {
            options: {
                banner: bannerContent
            },
            target: {
                src: ['src/ya.js', 'src/mixins/**/*.js', 'src/core.js', 'src/**/*.js'],
                dest: devRelease
            }
        },
        jshint: {
            options: {
                browser: true,
                eqeqeq: false
            },
            target: {
                src: ['src/**/*.js', 'test/**/*.js']
            }
        },
        watch: {
            default: {
                files: [
                    'experimental/**/*.js',
                    'src/**/*.js',
                    'src/*.js',
                    'test/**/*.js',
                    'test/*.js'
                ],
                tasks: ['jshint'],
                options: {
                    livereload: true,
                    spawn: true
                }
            }
        },
        yuidoc: {
            compile: {
                name: '<%= pkg.name %>',
                description: '<%= pkg.description %>',
                version: '<%= pkg.version %>',
                url: '<%= pkg.homepage %>',
                options: {
                    paths: 'src/',
                    outdir: 'docs/api'
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-yuidoc');
    grunt.loadNpmTasks('grunt-blanket-qunit');
    grunt.loadNpmTasks('grunt-contrib-connect');

    grunt.registerTask("tdd", ['jshint', 'connect', 'blanket_qunit']);
    grunt.registerTask("tdd:browser", ['watch:default']);
    grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'copy', 'yuidoc']);
    grunt.registerTask('travis', ['jshint', 'connect:server', 'blanket_qunit:all', 'concat', 'uglify', 'copy', 'yuidoc']);
};<|endoftext|>


<commit_before>module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                files: [
                    {expand: true, cwd: '<%= pkg.sourcePath %>/', src: ['**'], dest: '<%= pkg.buildPath %>/'}
                ]
            },
            bower: {
                files: [
                    {src: '<%= pkg.bowerPath %>/jquery/dist/jquery.min.js', dest: '<%= pkg.buildPath %>/data/scripts/jquery.min.js'},

                    {src: '<%= pkg.bowerPath %>/mustache/mustache.min.js', dest: '<%= pkg.buildPath %>/data/scripts/mustache.min.js'},

                    {src: '<%= pkg.bowerPath %>/jquery-timeago/jquery.timeago.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/jquery.timeago.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.de.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.de.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.en.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.en.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.es.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.es.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.et.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.et.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.fr.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.fr.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.it.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.it.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.ko.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.ko.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.pl.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.pl.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.pt-br.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.pt-br.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.ru.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.ru.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.zh-CN.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.zh-CN.js'}
                ]
            }
        },
        "string-replace": {
            keys: {
                files: {
                    "<%= pkg.buildPath %>/lib/main.js": "<%= pkg.buildPath %>/lib/main.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: 'clientSecret: ""',
                            replacement: 'clientSecret: "' + grunt.option("clientSecret") + '"'
                        },
                        {
                            pattern: 'clientId: ""',
                            replacement: 'clientId: "' + grunt.option("clientId") + '"'
                        }
                    ]
                }
            },
            sandboxApi: {
                files: {
                    "<%= pkg.buildPath %>/lib/feedly.api.js": "<%= pkg.buildPath %>/lib/feedly.api.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?cloud\.feedly\.com/gi,
                            replacement: "http://sandbox.feedly.com"
                        }
                    ]
                }
            },
            sandboxLink: {
                files: {
                    "<%= pkg.buildPath %>/lib/main.js": "<%= pkg.buildPath %>/lib/main.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?feedly\.com/gi,
                            replacement: "http://sandbox.feedly.com"
                        }
                    ]
                }
            }
        },
        "jpm": {
            options: {
                src: "<%= pkg.buildPath %>",
                xpi: "<%= pkg.buildPath %>"
            }
        },
        clean: {
            build: {
                files: [
                    {expand: true, cwd: "<%= pkg.buildPath %>", src: ["*", "!*.xpi"]}
                ]
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-copy");
    grunt.loadNpmTasks('grunt-string-replace');
    grunt.loadNpmTasks('grunt-jpm');
    grunt.loadNpmTasks('grunt-contrib-clean');

    grunt.registerTask("build", ["copy", "string-replace:keys", "jpm:xpi", "clean"]);
    grunt.registerTask("sandbox", ["copy", "string-replace", "jpm:run", "mozilla-cfx"]);
    grunt.registerTask("default", ["copy", "string-replace:keys", "jpm:run"]);
};<commit_msg>Fix grunt task<commit_after>module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                files: [
                    {expand: true, cwd: '<%= pkg.sourcePath %>/', src: ['**'], dest: '<%= pkg.buildPath %>/'}
                ]
            },
            bower: {
                files: [
                    {src: '<%= pkg.bowerPath %>/jquery/dist/jquery.min.js', dest: '<%= pkg.buildPath %>/data/scripts/jquery.min.js'},

                    {src: '<%= pkg.bowerPath %>/mustache/mustache.min.js', dest: '<%= pkg.buildPath %>/data/scripts/mustache.min.js'},

                    {src: '<%= pkg.bowerPath %>/jquery-timeago/jquery.timeago.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/jquery.timeago.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.de.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.de.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.en.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.en.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.es.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.es.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.et.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.et.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.fr.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.fr.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.it.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.it.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.ko.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.ko.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.pl.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.pl.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.pt-br.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.pt-br.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.ru.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.ru.js'},
                    {src: '<%= pkg.bowerPath %>/jquery-timeago/locales/jquery.timeago.zh-CN.js', dest: '<%= pkg.buildPath %>/data/scripts/timeago/locales/jquery.timeago.zh-CN.js'}
                ]
            }
        },
        "string-replace": {
            keys: {
                files: {
                    "<%= pkg.buildPath %>/lib/main.js": "<%= pkg.buildPath %>/lib/main.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: 'clientSecret: ""',
                            replacement: 'clientSecret: "' + grunt.option("clientSecret") + '"'
                        },
                        {
                            pattern: 'clientId: ""',
                            replacement: 'clientId: "' + grunt.option("clientId") + '"'
                        }
                    ]
                }
            },
            sandboxApi: {
                files: {
                    "<%= pkg.buildPath %>/lib/feedly.api.js": "<%= pkg.buildPath %>/lib/feedly.api.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?cloud\.feedly\.com/gi,
                            replacement: "http://sandbox.feedly.com"
                        }
                    ]
                }
            },
            sandboxLink: {
                files: {
                    "<%= pkg.buildPath %>/lib/main.js": "<%= pkg.buildPath %>/lib/main.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?feedly\.com/gi,
                            replacement: "http://sandbox.feedly.com"
                        }
                    ]
                }
            }
        },
        "jpm": {
            options: {
                src: "<%= pkg.buildPath %>",
                xpi: "<%= pkg.buildPath %>"
            }
        },
        clean: {
            build: {
                files: [
                    {expand: true, cwd: "<%= pkg.buildPath %>", src: ["*", "!*.xpi"]}
                ]
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-copy");
    grunt.loadNpmTasks('grunt-string-replace');
    grunt.loadNpmTasks('grunt-jpm');
    grunt.loadNpmTasks('grunt-contrib-clean');

    grunt.registerTask("build", ["copy", "string-replace:keys", "jpm:xpi", "clean"]);
    grunt.registerTask("sandbox", ["copy", "string-replace", "jpm:run"]);
    grunt.registerTask("default", ["copy", "string-replace:keys", "jpm:run"]);
};<|endoftext|>


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

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        nodemon: {
            dev: {
                script: 'server.js'
            }
        }
    });

    grunt.loadNpmTasks('grunt-nodemon');

    // Default task(s).
    grunt.registerTask('default');

};<commit_msg>remove blank default<commit_after>module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        nodemon: {
            dev: {
                script: 'server.js'
            }
        }
    });

    grunt.loadNpmTasks('grunt-nodemon');

};<|endoftext|>


<commit_before>module.exports = function(grunt) {
    var _ = grunt.util._;
    var path = require('path');

    var coreFiles = [
        'vendor/**/*.js',
        'template/_header.js',
        'src/**/*.js',
        'template/_footer.js'
    ];

    var plugins = grunt.option('plugins');
    // Create plugin paths and verify hey exist
    plugins = _.map(plugins ? plugins.split(',') : [], function (plugin) {
        var path = 'plugins/' + plugin + '.js';

        if(!grunt.file.exists(path))
            throw new Error("Plugin '" + plugin + "' not found in plugins directory.");

        return path;
    });

    // Taken from http://dzone.com/snippets/calculate-all-combinations
    var combine = function (a) {
        var fn = function (n, src, got, all) {
            if (n == 0) {
                all.push(got);
                return;
            }

            for (var j = 0; j < src.length; j++) {
                fn(n - 1, src.slice(j + 1), got.concat([src[j]]), all);
            }
        };

        var all = [a];

        for (var i = 0; i < a.length; i++) {
            fn(i, a, [], all);
        }

        return all;
    };

    var pluginCombinations = combine(grunt.file.expand('plugins/*.js'));
    var pluginConcatFiles = _.reduce(pluginCombinations, function (dict, comb) {
        var key = _.map(comb, function (plugin) {
            return path.basename(plugin, '.js');
        });
        key.sort();

        var dest = path.join('build/', key.join(','), '/<%= pkg.name %>.js');
        dict[dest] = coreFiles.concat(comb);

        return dict;
    }, {});

    var gruntConfig = {
        pkg: grunt.file.readJSON('package.json'),
        clean: ['build'],
        concat: {
            options: {
                separator: '\n',
                banner: grunt.file.read('template/_copyright.js')
            },
            core: {
                src: coreFiles.concat(plugins),
                dest: 'build/<%= pkg.name %>.js'
            },
            all: {
                files: pluginConcatFiles
            }
        },

        uglify: {
            options: {
                banner: grunt.file.read('template/_copyright.min.js')
            },
            dist: {
                src: ['build/**/*.js'],
                ext: '.min.js',
                expand: true
            }
        },

        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: ['src/**/*.js', 'plugins/**/*.js']
        },

        mocha: {
            all: {
                options: {
                    mocha: {
                        ignoreLeaks: true,
                        grep:        grunt.option('grep')
                    },
                    log:      true,
                    reporter: 'Dot',
                    run:      true
                },
                src: ['test/index.html'],
                nonull: true
            }
        }
    };

    grunt.initConfig(gruntConfig);

    // Grunt contrib tasks
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-jshint');

    // 3rd party Grunt tasks
    grunt.loadNpmTasks('grunt-mocha');

    // Build tasks
    grunt.registerTask('build.core', ['clean', 'concat:core', 'uglify']);
    grunt.registerTask('build.all', ['clean', 'concat:all', 'uglify']);

    // Test task
    grunt.registerTask('test', ['jshint', 'mocha']);

    grunt.registerTask('default', ['build.all']);
};
<commit_msg>Generate source maps<commit_after>module.exports = function(grunt) {
    var _ = grunt.util._;
    var path = require('path');

    var coreFiles = [
        'vendor/**/*.js',
        'template/_header.js',
        'src/**/*.js',
        'template/_footer.js'
    ];

    var plugins = grunt.option('plugins');
    // Create plugin paths and verify hey exist
    plugins = _.map(plugins ? plugins.split(',') : [], function (plugin) {
        var path = 'plugins/' + plugin + '.js';

        if(!grunt.file.exists(path))
            throw new Error("Plugin '" + plugin + "' not found in plugins directory.");

        return path;
    });

    // Taken from http://dzone.com/snippets/calculate-all-combinations
    var combine = function (a) {
        var fn = function (n, src, got, all) {
            if (n == 0) {
                all.push(got);
                return;
            }

            for (var j = 0; j < src.length; j++) {
                fn(n - 1, src.slice(j + 1), got.concat([src[j]]), all);
            }
        };

        var all = [a];

        for (var i = 0; i < a.length; i++) {
            fn(i, a, [], all);
        }

        return all;
    };

    var pluginCombinations = combine(grunt.file.expand('plugins/*.js'));
    var pluginConcatFiles = _.reduce(pluginCombinations, function (dict, comb) {
        var key = _.map(comb, function (plugin) {
            return path.basename(plugin, '.js');
        });
        key.sort();

        var dest = path.join('build/', key.join(','), '/<%= pkg.name %>.js');
        dict[dest] = coreFiles.concat(comb);

        return dict;
    }, {});

    var gruntConfig = {
        pkg: grunt.file.readJSON('package.json'),
        clean: ['build'],
        concat: {
            options: {
                separator: '\n',
                banner: grunt.file.read('template/_copyright.js')
            },
            core: {
                src: coreFiles.concat(plugins),
                dest: 'build/<%= pkg.name %>.js'
            },
            all: {
                files: pluginConcatFiles
            }
        },

        uglify: {
            options: {
                banner: grunt.file.read('template/_copyright.min.js'),
                sourceMap: function (dest) {
                    return path.join(path.dirname(dest),
                                     path.basename(dest, '.js')) +
                           '.map.js';
                }
            },
            dist: {
                src: ['build/**/*.js'],
                ext: '.min.js',
                expand: true
            }
        },

        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: ['src/**/*.js', 'plugins/**/*.js']
        },

        mocha: {
            all: {
                options: {
                    mocha: {
                        ignoreLeaks: true,
                        grep:        grunt.option('grep')
                    },
                    log:      true,
                    reporter: 'Dot',
                    run:      true
                },
                src: ['test/index.html'],
                nonull: true
            }
        }
    };

    grunt.initConfig(gruntConfig);

    // Grunt contrib tasks
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-jshint');

    // 3rd party Grunt tasks
    grunt.loadNpmTasks('grunt-mocha');

    // Build tasks
    grunt.registerTask('build.core', ['clean', 'concat:core', 'uglify']);
    grunt.registerTask('build.all', ['clean', 'concat:all', 'uglify']);

    // Test task
    grunt.registerTask('test', ['jshint', 'mocha']);

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


<commit_before>'use strict';

module.exports = function(grunt) {

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

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

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

};
<commit_msg>by default, grunt just tests, use build to build<commit_after>'use strict';

module.exports = function(grunt) {

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

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

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

};
<|endoftext|>