<commit_before>/*
 * The Web project Gruntfile.
 *
 * Copyright 2013 Palantir Technologies, Inc. All rights reserved.
 */

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

  var path = require("path");
  var cwd = process.cwd();

  var tsJSON = {
    dev: {
      src: ["src/**/*.ts", "typings/**/*.d.ts"],
      outDir: "build/",
      options: {
        target: 'es5',
        noImplicitAny: true,
        sourceMap: false,
        declaration: true,
        removeComments: false
      }
    },
    prod: {
      src: ["src/**/*.ts", "typings/**/*.d.ts"],
      out: "plottable.js",
      // watch: "src",
      options: {
        target: 'es5',
        noImplicitAny: true,
        sourceMap: false,
        declaration: true,
        removeComments: false
      }
    },
    test: {
      src: ["test/*.ts", "typings/**/*.d.ts", "plottable.d.ts"],
      out: "test/tests.js",
      // watch: "test",
      options: {
        target: 'es5',
        sourceMap: false,
        noImplicitAny: true,
        declaration: false,
        removeComments: false
      }
    }
  };

  var bumpJSON = {
    options: {
      files: ['package.json', 'bower.json'],
      updateConfigs: ['pkg'],
      commit: false,
      createTag: false,
      push: false
    }
  }

  var FILES_TO_COMMIT = ['plottable.js',
                         'plottable.min.js',
                         'plottable.d.ts',
                         'examples/exampleUtil.js',
                         'test/tests.js',
                         "plottable.css",
                         "plottable.zip",
                         "bower.json",
                         "package.json"];

  var prefixMatch = "\\n *";
  var varNameMatch = "[^(:;]*(\\([^)]*\\))?"; // catch function args too
  var nestedBraceMatch = ": \\{[^{}]*\\}";
  var typeNameMatch = ": [^;]*";
  var finalMatch = "((" + nestedBraceMatch + ")|(" + typeNameMatch + "))?\\n?;"
  var jsdoc_init = "\\n *\\/\\*\\* *\\n";
  var jsdoc_mid = "( *\\*[^\\n]*\\n)+";
  var jsdoc_end = " *\\*\\/ *";
  var jsdoc = "(" + jsdoc_init + jsdoc_mid + jsdoc_end + ")?";

  var sedJSON = {
    private_definitions: {
      pattern: jsdoc + prefixMatch + "private " + varNameMatch + finalMatch,
      replacement: "",
      path: "plottable.d.ts",
    },
    protected_definitions: {
      pattern: jsdoc + prefixMatch + "public _" + varNameMatch + finalMatch,
      replacement: "",
      path: "plottable.d.ts",
    },
    header: {
      pattern: "VERSION",
      replacement: "<%= pkg.version %>",
      path: "license_header.tmp",
    },
    public_member_vars: {
      pattern: jsdoc + prefixMatch + "public " + "[^(;]*;",
      replacement: "",
      path: "plottable.d.ts",
    },
    plottable_multifile: {
      pattern: '/// *<reference path="([^."]*).ts" */>',
      replacement: 'synchronousRequire("../build/$1.js");',
      path: "plottable_multifile.js",
    },
  };

  var configJSON = {
    pkg: grunt.file.readJSON("package.json"),
    bump: bumpJSON,
    concat: {
      header: {
        src: ["license_header.tmp", "plottable.js"],
        dest: "plottable.js",
      },
      plottable_multifile: {
        src: ["synchronousRequire.js", "src/reference.ts"],
        // src: ["synchronousRequire.js", "build/files.txt"],
        dest: "plottable_multifile.js",
      },
    },
    ts: tsJSON,
    tslint: {
      options: {
        configuration: grunt.file.readJSON("tslint.json")
      },
      files: ["src/**/*.ts", "test/**.ts"]
    },
    watch: {
      "options": {
        livereload: true
      },
      "rebuild": {
        "tasks": ["dev-compile"],
        "files": ["src/**/*.ts"]
      },
      "tests": {
        "tasks": ["ts:test"],
        "files": ["test/**.ts"]
      }
    },
    blanket_mocha: {
      all: ['test/coverage.html'],
      options: {
        threshold: 80
      }
    },
    connect: {
      server: {
        options: {
          port: 7007,
          livereload: true
        }
      }
    },
    clean: {tscommand: ["tscommand*.tmp.txt"], header: ["license_header.tmp"]},
    sed: sedJSON,
    copy: {
      header: {
        files: [{src: "license_header.txt", dest: "license_header.tmp"}]
      }
    },
    gitcommit: {
      version: {
        options: {
          message: "Release version <%= pkg.version %>"
        },
        files: {
          src: FILES_TO_COMMIT
        }
      },
      built: {
        options: {
          message: "Update built files"
        },
        files: {
          src: FILES_TO_COMMIT
        }
      }
    },
    compress: {
      main: {
        options: {
          archive: 'plottable.zip'
        },
        files: [
        {src: 'plottable.js'  , dest: '.'},
        {src: 'plottable.min.js', dest: '.'},
        {src: 'plottable.d.ts', dest: '.'},
        {src: 'plottable.css' , dest: '.'},
        {src: 'README.md'     , dest: '.'},
        {src: 'LICENSE'       , dest: '.'}]
      }
    },
    uglify: {
      main: {
        files: {'plottable.min.js': ['plottable.js']}
      }
    }
  };

  // project configuration
  grunt.initConfig(configJSON);

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

  // default task (this is what runs when a task isn't specified)
  grunt.registerTask("handle-header",
            ["copy:header", "sed:header", "concat:header", "clean:header"]);
  grunt.registerTask("default", "launch");
  grunt.registerTask("dev-compile", [
                                  "ts:dev",
                                  "tslint",
                                  "ts:prod",
                                  "sed:private_definitions",
                                  "ts:test",
                                  "handle-header",
                                  "sed:protected_definitions",
                                  "sed:public_member_vars",
                                  "concat:plottable_multifile",
                                  "sed:plottable_multifile",
                                  "clean:tscommand"]);

  grunt.registerTask("release:patch", ["bump:patch", "dist-compile", "gitcommit:version"]);
  grunt.registerTask("release:minor", ["bump:minor", "dist-compile", "gitcommit:version"]);
  grunt.registerTask("release:major", ["bump:major", "dist-compile", "gitcommit:version"]);

  grunt.registerTask("dist-compile", [
                                  "dev-compile",
                                  "tslint",
                                  "blanket_mocha",
                                  "uglify",
                                  "compress"
                                  ]);

  grunt.registerTask("commitjs", ["dist-compile", "gitcommit:built"]);

  grunt.registerTask("launch", ["connect", "dev-compile", "watch"]);
  grunt.registerTask("test", ["dev-compile", "blanket_mocha"]);
  grunt.registerTask("bm", ["blanket_mocha"]);
};
<commit_msg>lower coverage threshold<commit_after>/*
 * The Web project Gruntfile.
 *
 * Copyright 2013 Palantir Technologies, Inc. All rights reserved.
 */

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

  var path = require("path");
  var cwd = process.cwd();

  var tsJSON = {
    dev: {
      src: ["src/**/*.ts", "typings/**/*.d.ts"],
      outDir: "build/",
      options: {
        target: 'es5',
        noImplicitAny: true,
        sourceMap: false,
        declaration: true,
        removeComments: false
      }
    },
    prod: {
      src: ["src/**/*.ts", "typings/**/*.d.ts"],
      out: "plottable.js",
      // watch: "src",
      options: {
        target: 'es5',
        noImplicitAny: true,
        sourceMap: false,
        declaration: true,
        removeComments: false
      }
    },
    test: {
      src: ["test/*.ts", "typings/**/*.d.ts", "plottable.d.ts"],
      out: "test/tests.js",
      // watch: "test",
      options: {
        target: 'es5',
        sourceMap: false,
        noImplicitAny: true,
        declaration: false,
        removeComments: false
      }
    }
  };

  var bumpJSON = {
    options: {
      files: ['package.json', 'bower.json'],
      updateConfigs: ['pkg'],
      commit: false,
      createTag: false,
      push: false
    }
  }

  var FILES_TO_COMMIT = ['plottable.js',
                         'plottable.min.js',
                         'plottable.d.ts',
                         'examples/exampleUtil.js',
                         'test/tests.js',
                         "plottable.css",
                         "plottable.zip",
                         "bower.json",
                         "package.json"];

  var prefixMatch = "\\n *";
  var varNameMatch = "[^(:;]*(\\([^)]*\\))?"; // catch function args too
  var nestedBraceMatch = ": \\{[^{}]*\\}";
  var typeNameMatch = ": [^;]*";
  var finalMatch = "((" + nestedBraceMatch + ")|(" + typeNameMatch + "))?\\n?;"
  var jsdoc_init = "\\n *\\/\\*\\* *\\n";
  var jsdoc_mid = "( *\\*[^\\n]*\\n)+";
  var jsdoc_end = " *\\*\\/ *";
  var jsdoc = "(" + jsdoc_init + jsdoc_mid + jsdoc_end + ")?";

  var sedJSON = {
    private_definitions: {
      pattern: jsdoc + prefixMatch + "private " + varNameMatch + finalMatch,
      replacement: "",
      path: "plottable.d.ts",
    },
    protected_definitions: {
      pattern: jsdoc + prefixMatch + "public _" + varNameMatch + finalMatch,
      replacement: "",
      path: "plottable.d.ts",
    },
    header: {
      pattern: "VERSION",
      replacement: "<%= pkg.version %>",
      path: "license_header.tmp",
    },
    public_member_vars: {
      pattern: jsdoc + prefixMatch + "public " + "[^(;]*;",
      replacement: "",
      path: "plottable.d.ts",
    },
    plottable_multifile: {
      pattern: '/// *<reference path="([^."]*).ts" */>',
      replacement: 'synchronousRequire("../build/$1.js");',
      path: "plottable_multifile.js",
    },
  };

  var configJSON = {
    pkg: grunt.file.readJSON("package.json"),
    bump: bumpJSON,
    concat: {
      header: {
        src: ["license_header.tmp", "plottable.js"],
        dest: "plottable.js",
      },
      plottable_multifile: {
        src: ["synchronousRequire.js", "src/reference.ts"],
        // src: ["synchronousRequire.js", "build/files.txt"],
        dest: "plottable_multifile.js",
      },
    },
    ts: tsJSON,
    tslint: {
      options: {
        configuration: grunt.file.readJSON("tslint.json")
      },
      files: ["src/**/*.ts", "test/**.ts"]
    },
    watch: {
      "options": {
        livereload: true
      },
      "rebuild": {
        "tasks": ["dev-compile"],
        "files": ["src/**/*.ts"]
      },
      "tests": {
        "tasks": ["ts:test"],
        "files": ["test/**.ts"]
      }
    },
    blanket_mocha: {
      all: ['test/coverage.html'],
      options: {
        threshold: 70
      }
    },
    connect: {
      server: {
        options: {
          port: 7007,
          livereload: true
        }
      }
    },
    clean: {tscommand: ["tscommand*.tmp.txt"], header: ["license_header.tmp"]},
    sed: sedJSON,
    copy: {
      header: {
        files: [{src: "license_header.txt", dest: "license_header.tmp"}]
      }
    },
    gitcommit: {
      version: {
        options: {
          message: "Release version <%= pkg.version %>"
        },
        files: {
          src: FILES_TO_COMMIT
        }
      },
      built: {
        options: {
          message: "Update built files"
        },
        files: {
          src: FILES_TO_COMMIT
        }
      }
    },
    compress: {
      main: {
        options: {
          archive: 'plottable.zip'
        },
        files: [
        {src: 'plottable.js'  , dest: '.'},
        {src: 'plottable.min.js', dest: '.'},
        {src: 'plottable.d.ts', dest: '.'},
        {src: 'plottable.css' , dest: '.'},
        {src: 'README.md'     , dest: '.'},
        {src: 'LICENSE'       , dest: '.'}]
      }
    },
    uglify: {
      main: {
        files: {'plottable.min.js': ['plottable.js']}
      }
    }
  };

  // project configuration
  grunt.initConfig(configJSON);

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

  // default task (this is what runs when a task isn't specified)
  grunt.registerTask("handle-header",
            ["copy:header", "sed:header", "concat:header", "clean:header"]);
  grunt.registerTask("default", "launch");
  grunt.registerTask("dev-compile", [
                                  "ts:dev",
                                  "tslint",
                                  "ts:prod",
                                  "sed:private_definitions",
                                  "ts:test",
                                  "handle-header",
                                  "sed:protected_definitions",
                                  "sed:public_member_vars",
                                  "concat:plottable_multifile",
                                  "sed:plottable_multifile",
                                  "clean:tscommand"]);

  grunt.registerTask("release:patch", ["bump:patch", "dist-compile", "gitcommit:version"]);
  grunt.registerTask("release:minor", ["bump:minor", "dist-compile", "gitcommit:version"]);
  grunt.registerTask("release:major", ["bump:major", "dist-compile", "gitcommit:version"]);

  grunt.registerTask("dist-compile", [
                                  "dev-compile",
                                  "tslint",
                                  "blanket_mocha",
                                  "uglify",
                                  "compress"
                                  ]);

  grunt.registerTask("commitjs", ["dist-compile", "gitcommit:built"]);

  grunt.registerTask("launch", ["connect", "dev-compile", "watch"]);
  grunt.registerTask("test", ["dev-compile", "blanket_mocha"]);
  grunt.registerTask("bm", ["blanket_mocha"]);
};
<|endoftext|>


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

  grunt.initConfig({
    pkg: grunt.file.readJSON( 'package.json' ),
    jshint: {
      options: {
        'globals': {
          'module': false,
          'angular': false,
          'console': false,
          'google': false,
          'WebmakerAuthClient': false
        },
        'bitwise': true,
        'browser': true,
        'curly': true,
        'eqeqeq': true,
        'freeze': true,
        'immed': true,
        'indent': 2,
        'latedef': true,
        'node': true,
        'newcap': true,
        'noempty': true,
        'quotmark': 'single',
        'trailing': true,
        'undef': true,
        'unused': 'vars'
      },
      files: [
        'Gruntfile.js',
        '*.js',
        'bin/*.js'
      ]
    },

    express: {
      dev: {
        options: {
          script: './server.js',
          args: [ '--debug' ],
          node_env: 'development',
          port: 4321
        }
      }
    },

    stylus: {
      compile: {
        files: {
          'public/asset/css/eisenhower.css': 'public/asset/styl/eisenhower.styl'
        }
      }
    },

    // running `grunt watch` will watch for changes
    watch: {
      files: [
        '*.js',
        'models/*.js',
        'routes/*.js',
        'routes/*/*.js',
        'public/asset/js/*.js',
        'public/asset/styl/*.styl'
      ],
      tasks: [ 'jshint', 'stylus', 'express:dev' ],
      express: {
        files: [ '*.js', 'models/*.js', 'routes/*.js', 'routes/*/*.js' ],
        tasks:  [ 'express:dev' ],
        options: {
          spawn: false
        }
      }
    }
  });

  grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  grunt.loadNpmTasks( 'grunt-contrib-stylus' );
  grunt.loadNpmTasks( 'grunt-express-server' );
  grunt.loadNpmTasks( 'grunt-contrib-watch' );

  grunt.registerTask( 'default', [ 'jshint', 'stylus', 'express:dev', 'watch' ] );
  grunt.registerTask( 'test', [ 'jshint' ] );
};
<commit_msg>add grunt-bump love<commit_after>module.exports = function( grunt ) {
  'use strict';

  grunt.initConfig({
    pkg: grunt.file.readJSON( 'package.json' ),
    jshint: {
      options: {
        'globals': {
          'module': false,
          'angular': false,
          'console': false,
          'google': false,
          'WebmakerAuthClient': false
        },
        'bitwise': true,
        'browser': true,
        'curly': true,
        'eqeqeq': true,
        'freeze': true,
        'immed': true,
        'indent': 2,
        'latedef': true,
        'node': true,
        'newcap': true,
        'noempty': true,
        'quotmark': 'single',
        'trailing': true,
        'undef': true,
        'unused': 'vars'
      },
      files: [
        'Gruntfile.js',
        '*.js',
        'bin/*.js'
      ]
    },

    express: {
      dev: {
        options: {
          script: './server.js',
          args: [ '--debug' ],
          node_env: 'development',
          port: 4321
        }
      }
    },

    stylus: {
      compile: {
        files: {
          'public/asset/css/eisenhower.css': 'public/asset/styl/eisenhower.styl'
        }
      }
    },

    watch: {
      files: [
        '*.js',
        'models/*.js',
        'routes/*.js',
        'routes/*/*.js',
        'public/asset/js/*.js',
        'public/asset/styl/*.styl'
      ],
      tasks: [ 'jshint', 'stylus', 'express:dev' ],
      express: {
        files: [ '*.js', 'models/*.js', 'routes/*.js', 'routes/*/*.js' ],
        tasks:  [ 'express:dev' ],
        options: {
          spawn: false
        }
      }
    },

    bump: {
      options: {
        files: [ 'package.json', 'bower.json' ],
        commit: true,
        commitMessage: 'version bump to v%VERSION%',
        commitFiles: [ 'package.json', 'bower.json' ],
        createTag: true,
        tagName: 'v%VERSION%',
        push: false
      }
    }
  });

  grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  grunt.loadNpmTasks( 'grunt-contrib-stylus' );
  grunt.loadNpmTasks( 'grunt-express-server' );
  grunt.loadNpmTasks( 'grunt-contrib-watch' );
  grunt.loadNpmTasks('grunt-bump');

  grunt.registerTask( 'default', [ 'jshint', 'stylus', 'express:dev', 'watch' ] );
  grunt.registerTask( 'test', [ 'jshint' ] );
};
<|endoftext|>


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

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

  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
    ' * Bootstrap-select v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
    ' *\n' +
    ' * Copyright 2013-<%= grunt.template.today(\'yyyy\') %> bootstrap-select\n' +
    ' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
    ' */\n',

    // Task configuration.

    clean: {
      css: 'dist/css',
      js: 'dist/js'
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      gruntfile: {
        options: {
          'node': true
        },
        src: 'Gruntfile.js'
      },
      main: {
        src: 'js/*.js'
      },
      i18n: {
        src: 'js/i18n/*.js'
      }
    },

    concat: {
      options: {
        stripBanners: true
      },
      main: {
        src: '<%= jshint.main.src %>',
        dest: 'dist/js/<%= pkg.name %>.js'
      },
      i18n: {
        expand: true,
        src: '<%= jshint.i18n.src %>',
        dest: 'dist/'
      }
    },

    umd: {
      main: {
        options: {
          deps: {
            args: ['jQuery'],
            amd: ['jquery'],
            cjs: ['jquery'],
            global: ['jQuery']
          }
        },
        src: '<%= concat.main.dest %>'
      },
      i18n: {
        options: {
          deps: {
            args: ['jQuery'],
            amd: ['jquery'],
            cjs: ['jquery'],
            global: ['jQuery']
          }
        },
        src: 'dist/<%= jshint.i18n.src %>',
        dest: '.'
      }
    },

    uglify: {
      options: {
        preserveComments: 'some'
      },
      main: {
        src: '<%= concat.main.dest %>',
        dest: 'dist/js/<%= pkg.name %>.min.js',
        options: {
          sourceMap: true,
          sourceMapName: 'dist/js/<%= pkg.name %>.js.map'
        }
      },
      i18n: {
        expand: true,
        src: 'dist/<%= jshint.i18n.src %>',
        ext: '.min.js'
      }
    },

    less: {
      options: {
        strictMath: true,
        sourceMap: true,
        outputSourceFiles: true,
        sourceMapURL: '<%= pkg.name %>.css.map',
        sourceMapFilename: '<%= less.css.dest %>.map'
      },
      css: {
        src: 'less/bootstrap-select.less',
        dest: 'dist/css/<%= pkg.name %>.css'
      }
    },

    usebanner: {
      css: {
        options: {
          banner: '<%= banner %>'
        },
        src: '<%= less.css.dest %>'
      },
      js: {
        options: {
          banner: '<%= banner %>'
        },
        src: [
          '<%= concat.main.dest %>',
          '<%= uglify.main.dest %>',
          'dist/<%= jshint.i18n.src %>',
        ]
      }
    },

    cssmin: {
      options: {
        compatibility: 'ie8',
        keepSpecialComments: '*',
        advanced: false
      },
      css: {
        src: '<%= less.css.dest %>',
        dest: 'dist/css/<%= pkg.name %>.min.css'
      }
    },

    csslint: {
      options: {
        'adjoining-classes': false,
        'box-sizing': false,
        'box-model': false,
        'compatible-vendor-prefixes': false,
        'floats': false,
        'font-sizes': false,
        'gradients': false,
        'important': false,
        'known-properties': false,
        'outline-none': false,
        'qualified-headings': false,
        'regex-selectors': false,
        'shorthand': false,
        'text-indent': false,
        'unique-headings': false,
        'universal-selector': false,
        'unqualified-attributes': false,
        'overqualified-elements': false
      },
      css: {
        src: '<%= less.css.dest %>'
      }
    },

    sed: {
      versionNumber: {
        path: [
          'js/<%= pkg.name %>.js',
          'bower.json',
          'composer.json',
          'package.json'
        ],
        pattern: (function () {
          var old = grunt.option('old');
          return old ? RegExp.quote(old) : old;
        })(),
        replacement: grunt.option('new'),
        recursive: true
      }
    },

    autoprefixer: {
      options: {
        browsers: [
          'Android 2.3',
          'Android >= 4',
          'Chrome >= 20',
          'Firefox >= 24', // Firefox 24 is the latest ESR
          'Explorer >= 8',
          'iOS >= 6',
          'Opera >= 12',
          'Safari >= 6'
        ]
      },
      css: {
        options: {
          map: true
        },
        src: '<%= less.css.dest %>'
      }
    },

    compress: {
      zip: {
        options: {
          archive: 'bootstrap-select-<%= pkg.version %>.zip',
          mode: 'zip'
        },
        files: [
          {
            expand: true,
            cwd: 'dist/',
            src: '**',
            dest: 'bootstrap-select-<%= pkg.version %>/'
          }, {
            src: ['bower.json', 'composer.json', 'package.json'],
            dest: 'bootstrap-select-<%= pkg.version %>/'
          }
        ]
      }
    },

    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: 'jshint:gruntfile'
      },
      js: {
        files: ['<%= jshint.main.src %>', '<%= jshint.i18n.src %>'],
        tasks: 'build-js'
      },
      less: {
        files: 'less/*.less',
        tasks: 'build-css'
      }
    }
  });

  // These plugins provide necessary tasks.
  require('load-grunt-tasks')(grunt, {
    scope: 'devDependencies'
  });

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

  // CSS distribution
  grunt.registerTask('build-css', ['clean:css', 'less', 'autoprefixer', 'usebanner:css', 'cssmin']);

  // JS distribution
  grunt.registerTask('build-js', ['clean:js', 'concat', 'umd', 'usebanner:js', 'uglify']);

  // Development watch
  grunt.registerTask('dev-watch', ['build-css', 'build-js', 'watch']);

  // Full distribution
  grunt.registerTask('dist', ['build-css', 'build-js', 'compress']);

  // Default task.
  grunt.registerTask('default', ['build-css', 'build-js']);

};
<commit_msg>Fix the wrong argument name of GH-866.<commit_after>module.exports = function (grunt) {

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

  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
    ' * Bootstrap-select v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
    ' *\n' +
    ' * Copyright 2013-<%= grunt.template.today(\'yyyy\') %> bootstrap-select\n' +
    ' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
    ' */\n',

    // Task configuration.

    clean: {
      css: 'dist/css',
      js: 'dist/js'
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      gruntfile: {
        options: {
          'node': true
        },
        src: 'Gruntfile.js'
      },
      main: {
        src: 'js/*.js'
      },
      i18n: {
        src: 'js/i18n/*.js'
      }
    },

    concat: {
      options: {
        stripBanners: true
      },
      main: {
        src: '<%= jshint.main.src %>',
        dest: 'dist/js/<%= pkg.name %>.js'
      },
      i18n: {
        expand: true,
        src: '<%= jshint.i18n.src %>',
        dest: 'dist/'
      }
    },

    umd: {
      main: {
        options: {
          deps: {
            'default': ['jQuery'],
            amd: ['jquery'],
            cjs: ['jquery'],
            global: ['jQuery']
          }
        },
        src: '<%= concat.main.dest %>'
      },
      i18n: {
        options: {
          deps: {
            'default': ['jQuery'],
            amd: ['jquery'],
            cjs: ['jquery'],
            global: ['jQuery']
          }
        },
        src: 'dist/<%= jshint.i18n.src %>',
        dest: '.'
      }
    },

    uglify: {
      options: {
        preserveComments: 'some'
      },
      main: {
        src: '<%= concat.main.dest %>',
        dest: 'dist/js/<%= pkg.name %>.min.js',
        options: {
          sourceMap: true,
          sourceMapName: 'dist/js/<%= pkg.name %>.js.map'
        }
      },
      i18n: {
        expand: true,
        src: 'dist/<%= jshint.i18n.src %>',
        ext: '.min.js'
      }
    },

    less: {
      options: {
        strictMath: true,
        sourceMap: true,
        outputSourceFiles: true,
        sourceMapURL: '<%= pkg.name %>.css.map',
        sourceMapFilename: '<%= less.css.dest %>.map'
      },
      css: {
        src: 'less/bootstrap-select.less',
        dest: 'dist/css/<%= pkg.name %>.css'
      }
    },

    usebanner: {
      css: {
        options: {
          banner: '<%= banner %>'
        },
        src: '<%= less.css.dest %>'
      },
      js: {
        options: {
          banner: '<%= banner %>'
        },
        src: [
          '<%= concat.main.dest %>',
          '<%= uglify.main.dest %>',
          'dist/<%= jshint.i18n.src %>',
        ]
      }
    },

    cssmin: {
      options: {
        compatibility: 'ie8',
        keepSpecialComments: '*',
        advanced: false
      },
      css: {
        src: '<%= less.css.dest %>',
        dest: 'dist/css/<%= pkg.name %>.min.css'
      }
    },

    csslint: {
      options: {
        'adjoining-classes': false,
        'box-sizing': false,
        'box-model': false,
        'compatible-vendor-prefixes': false,
        'floats': false,
        'font-sizes': false,
        'gradients': false,
        'important': false,
        'known-properties': false,
        'outline-none': false,
        'qualified-headings': false,
        'regex-selectors': false,
        'shorthand': false,
        'text-indent': false,
        'unique-headings': false,
        'universal-selector': false,
        'unqualified-attributes': false,
        'overqualified-elements': false
      },
      css: {
        src: '<%= less.css.dest %>'
      }
    },

    sed: {
      versionNumber: {
        path: [
          'js/<%= pkg.name %>.js',
          'bower.json',
          'composer.json',
          'package.json'
        ],
        pattern: (function () {
          var old = grunt.option('old');
          return old ? RegExp.quote(old) : old;
        })(),
        replacement: grunt.option('new'),
        recursive: true
      }
    },

    autoprefixer: {
      options: {
        browsers: [
          'Android 2.3',
          'Android >= 4',
          'Chrome >= 20',
          'Firefox >= 24', // Firefox 24 is the latest ESR
          'Explorer >= 8',
          'iOS >= 6',
          'Opera >= 12',
          'Safari >= 6'
        ]
      },
      css: {
        options: {
          map: true
        },
        src: '<%= less.css.dest %>'
      }
    },

    compress: {
      zip: {
        options: {
          archive: 'bootstrap-select-<%= pkg.version %>.zip',
          mode: 'zip'
        },
        files: [
          {
            expand: true,
            cwd: 'dist/',
            src: '**',
            dest: 'bootstrap-select-<%= pkg.version %>/'
          }, {
            src: ['bower.json', 'composer.json', 'package.json'],
            dest: 'bootstrap-select-<%= pkg.version %>/'
          }
        ]
      }
    },

    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: 'jshint:gruntfile'
      },
      js: {
        files: ['<%= jshint.main.src %>', '<%= jshint.i18n.src %>'],
        tasks: 'build-js'
      },
      less: {
        files: 'less/*.less',
        tasks: 'build-css'
      }
    }
  });

  // These plugins provide necessary tasks.
  require('load-grunt-tasks')(grunt, {
    scope: 'devDependencies'
  });

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

  // CSS distribution
  grunt.registerTask('build-css', ['clean:css', 'less', 'autoprefixer', 'usebanner:css', 'cssmin']);

  // JS distribution
  grunt.registerTask('build-js', ['clean:js', 'concat', 'umd', 'usebanner:js', 'uglify']);

  // Development watch
  grunt.registerTask('dev-watch', ['build-css', 'build-js', 'watch']);

  // Full distribution
  grunt.registerTask('dist', ['build-css', 'build-js', 'compress']);

  // Default task.
  grunt.registerTask('default', ['build-css', 'build-js']);

};
<|endoftext|>


<commit_before>/*
**  ComponentJS -- Component System for JavaScript <http://componentjs.com>
**  Copyright (c) 2009-2013 Ralf S. Engelschall <http://engelschall.com>
**
**  This Source Code Form is subject to the terms of the Mozilla Public
**  License, v. 2.0. If a copy of the MPL was not distributed with this
**  file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/* global module: true */
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        jshint: {
            options: {
                jshintrc: "jshint.json",
                ignores:  [ "app/ui/app/lib-cjscp-grammar.js", "app/ui/app/lib-cjsct-grammar.js" ]
            },
            gruntfile: [ "Gruntfile.js" ],
            sourcefiles: [
                "componentjs-tracing.js",
                "app/sv/*.js",
                "app/ui/app/app-*.js"
            ]
        },
        shell: {
            peephole: {
                command: "pegjs -e app.lib.peephole_constraint_parser app/ui/app/lib-cjscp-grammar.peg app/ui/app/lib-cjscp-grammar.js"
            },
            temporal: {
                command: "pegjs -e app.lib.temporal_constraint_parser app/ui/app/lib-cjsct-grammar.peg app/ui/app/lib-cjsct-grammar.js"
            }
        },
        clean: {
            clean:     [ "app/ui/app/lib-cjscp-grammar.js", "app/ui/app/lib-cjsct-grammar.js" ],
            grammar:   [ "app/ui/app/lib-cjscp-grammar.peg", "app/ui/app/lib-cjsct-grammar.peg" ],
            distclean: [ "node_modules" ]
        },
        "expand-include": {
            temporalGrammar: {
                src: [ "app/ui/app/grammar-fragments/lib-cjsct-grammar.main" ],
                dest: "app/ui/app/lib-cjsct-grammar.peg",
                directiveSyntax: "js"
            },
            peepholeGrammar: {
                src: [ "app/ui/app/grammar-fragments/lib-cjscp-grammar.main" ],
                dest: "app/ui/app/lib-cjscp-grammar.peg",
                directiveSyntax: "js"
            }
        }
    });

    grunt.loadNpmTasks("grunt-expand-include");
    grunt.loadNpmTasks("grunt-shell");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-clean");

    grunt.registerTask("default", [ "grammar", "jshint" ]);
    grunt.registerTask("grammar", [ "expand-include", "shell", "clean:grammar" ]);
}<commit_msg>dirty hack to get it building again<commit_after>/*
**  ComponentJS -- Component System for JavaScript <http://componentjs.com>
**  Copyright (c) 2009-2013 Ralf S. Engelschall <http://engelschall.com>
**
**  This Source Code Form is subject to the terms of the Mozilla Public
**  License, v. 2.0. If a copy of the MPL was not distributed with this
**  file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/* global module: true */
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        jshint: {
            options: {
                jshintrc: "jshint.json",
                ignores:  [ "app/ui/app/lib-cjscp-grammar.js", "app/ui/app/lib-cjsct-grammar.js" ]
            },
            gruntfile: [ "Gruntfile.js" ],
            sourcefiles: [
                "componentjs-tracing.js",
                "app/sv/*.js",
                "app/ui/app/app-*.js"
            ]
        },
        shell: {
            peephole: {
                command: "pegjs -e app.lib.peephole_constraint_parser app/ui/app/lib-cjscp-grammar.peg app/ui/app/lib-cjscp-grammar.js"
            },
            temporal: {
                command: "pegjs -e app.lib.temporal_constraint_parser app/ui/app/lib-cjsct-grammar.peg app/ui/app/lib-cjsct-grammar.js"
            }
        },
        clean: {
            clean:     [ "app/ui/app/lib-cjscp-grammar.js", "app/ui/app/lib-cjsct-grammar.js" ],
            grammar:   [ "app/ui/app/lib-cjscp-grammar.peg", "app/ui/app/lib-cjsct-grammar.peg" ],
            distclean: [ "node_modules" ]
        },
        "expand-include": {
            temporalGrammar: {
                src: [ "app/ui/app/grammar-fragments/lib-cjsct-grammar.main" ],
                dest: "app/ui/app/lib-cjsct-grammar.peg",
                directiveSyntax: "js"
            },
            peepholeGrammar: {
                src: [ "app/ui/app/grammar-fragments/lib-cjscp-grammar.main" ],
                dest: "app/ui/app/lib-cjscp-grammar.peg",
                directiveSyntax: "js"
            }
        }
    });

    grunt.loadNpmTasks("grunt-expand-include");
    grunt.loadNpmTasks("grunt-shell");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-clean");

    grunt.registerTask("default", [ "grammar" /* "jshint" */ ]);
    grunt.registerTask("grammar", [ "expand-include", "shell", "clean:grammar" ]);
}
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  grunt.initConfig({
    ngtemplates: {
      githubStarTagger: {
        cwd: 'src/',
        src: 'templates/*',
        dest: 'build/templates.js',
        options: {
          htmlmin: {
            removeComments: true,
            collapseWhitespace: true
          }
        }
      }
    },
    concat: {
      build: {
        src: ['src/js/app.js', 'src/js/controllers.js', 'src/js/directives.js', 'src/js/services.js', 'src/js/filters.js', 'build/templates.js'],
        dest: 'build/concat.js',
      }
    },
    ngmin: {
      build: {
        src: 'build/concat.js',
        dest: 'build/ngmin.js'
      }
    },
    uglify: {
      options: {
        preserveComments: 'some'
      },
      build: {
        src: 'build/ngmin.js',
        dest: 'dist/js/app.min.js'
      }
    },
    clean: ['build/'],
    htmlmin: {
      build: {
        options: {
          removeComments: true,
          collapseWhitespace: true
        },
        files: {
          'dist/index.html': 'src/index.html'
        }
      }
    },
    cssmin: {
      build: {
        files: {
          'dist/css/app.min.css': 'src/css/app.css'
        }
      }
    },
    bowercopy: {
      options: {
        runBower: false
      },
      css: {
        options: {
          destPrefix: 'public/css'
        },
        files: {
          'bootstrap.min.css': 'bootstrap/dist/css/bootstrap.min.css',
          'font-awesome.min.css': 'fontawesome/css/font-awesome.min.css',
          'selectize.bootstrap3.css': 'selectize/dist/css/selectize.bootstrap3.css'
        }
      },
      js: {
        options: {
          destPrefix: 'public/js'
        },
        files: {
          'bootstrap.min.js': 'bootstrap/dist/js/bootstrap.min.js',
          'angular.min.js': 'angular/angular.min.js',
          'jquery.min.js': 'jquery/dist/jquery.min.js',
          'selectize.min.js': 'selectize/dist/js/standalone/selectize.min.js',
          'ui-bootstrap-tpls.min.js': 'angular-bootstrap/ui-bootstrap-tpls.min.js',
          'ui-bootstrap.min.js': 'angular-bootstrap/ui-bootstrap.min.js'
        }
      },
      fonts: {
        options: {
          destPrefix: 'public/fonts'
        },
        files: {
          '': 'fontawesome/fonts/*'
        }
      }
    },
    copy: {
      install: {
        files: [
          {
            src: 'dist/js/*',
            dest: 'public/js/',
            expand: true,
            flatten: true
          },
          {
            src: 'dist/css/*',
            dest: 'public/css/',
            expand: true,
            flatten: true
          },
          {
            src: 'dist/index.html',
            dest: 'public/index.html'
          }
        ]
      }
    }
  });

  grunt.loadNpmTasks('grunt-angular-templates');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-ngmin');
  grunt.loadNpmTasks('grunt-bowercopy');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('build', ['ngtemplates', 'concat', 'ngmin', 'uglify', 'clean', 'htmlmin', 'cssmin']);
  grunt.registerTask('install', ['bowercopy', 'copy']);
};
<commit_msg>add command line option to grunt install task to set public directory<commit_after>module.exports = function(grunt) {
  var publicDirectory = grunt.option('dir') || 'public';

  grunt.initConfig({
    ngtemplates: {
      githubStarTagger: {
        cwd: 'src/',
        src: 'templates/*',
        dest: 'build/templates.js',
        options: {
          htmlmin: {
            removeComments: true,
            collapseWhitespace: true
          }
        }
      }
    },
    concat: {
      build: {
        src: ['src/js/app.js', 'src/js/controllers.js', 'src/js/directives.js', 'src/js/services.js', 'src/js/filters.js', 'build/templates.js'],
        dest: 'build/concat.js',
      }
    },
    ngmin: {
      build: {
        src: 'build/concat.js',
        dest: 'build/ngmin.js'
      }
    },
    uglify: {
      options: {
        preserveComments: 'some'
      },
      build: {
        src: 'build/ngmin.js',
        dest: 'dist/js/app.min.js'
      }
    },
    clean: ['build/'],
    htmlmin: {
      build: {
        options: {
          removeComments: true,
          collapseWhitespace: true
        },
        files: {
          'dist/index.html': 'src/index.html'
        }
      }
    },
    cssmin: {
      build: {
        files: {
          'dist/css/app.min.css': 'src/css/app.css'
        }
      }
    },
    bowercopy: {
      options: {
        runBower: false
      },
      css: {
        options: {
          destPrefix: publicDirectory + '/css'
        },
        files: {
          'bootstrap.min.css': 'bootstrap/dist/css/bootstrap.min.css',
          'font-awesome.min.css': 'fontawesome/css/font-awesome.min.css',
          'selectize.bootstrap3.css': 'selectize/dist/css/selectize.bootstrap3.css'
        }
      },
      js: {
        options: {
          destPrefix: publicDirectory + '/js'
        },
        files: {
          'bootstrap.min.js': 'bootstrap/dist/js/bootstrap.min.js',
          'angular.min.js': 'angular/angular.min.js',
          'jquery.min.js': 'jquery/dist/jquery.min.js',
          'selectize.min.js': 'selectize/dist/js/standalone/selectize.min.js',
          'ui-bootstrap-tpls.min.js': 'angular-bootstrap/ui-bootstrap-tpls.min.js',
          'ui-bootstrap.min.js': 'angular-bootstrap/ui-bootstrap.min.js'
        }
      },
      fonts: {
        options: {
          destPrefix: publicDirectory + '/fonts'
        },
        files: {
          '': 'fontawesome/fonts/*'
        }
      }
    },
    copy: {
      install: {
        files: [
          {
            src: 'dist/js/*',
            dest: publicDirectory + '/js/',
            expand: true,
            flatten: true
          },
          {
            src: 'dist/css/*',
            dest: publicDirectory + '/css/',
            expand: true,
            flatten: true
          },
          {
            src: 'dist/index.html',
            dest: publicDirectory + '/index.html'
          }
        ]
      }
    }
  });

  grunt.loadNpmTasks('grunt-angular-templates');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-ngmin');
  grunt.loadNpmTasks('grunt-bowercopy');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('build', ['ngtemplates', 'concat', 'ngmin', 'uglify', 'clean', 'htmlmin', 'cssmin']);
  grunt.registerTask('install', ['bowercopy', 'copy']);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
	"use strict";
	// Project configuration.
	grunt.initConfig({
		// Metadata.
		pkg: grunt.file.readJSON('package.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.
		concat: {
			apeye: {
				options: {
					banner: '<%= banner %>',
					stripBanners: true
				},
				src: ['src/apeye.js' ],
				dest: 'dist/apeye.js'
			},
			codemirror: {
				files: {
					'dist/codemirror.js': [
						'src/codemirror/lib/codemirror.js',
						'src/codemirror/mode/javascript/javascript.js',
						'src/codemirror/mode/xml/xml.js',
						'src/codemirror/mode/http/http.js',
						'src/codemirror/lib/util/formatting.js',
						'src/codemirror/lib/util/multiplex.js'
					],
					'dist/codemirror.css': 'src/codemirror/lib/codemirror.css'
				}
			}
		},
		uglify: {
			dist: {
				options: { banner: '<%= banner %>' },
				src: 'dist/apeye.js',
				dest: 'dist/apeye.min.js'
			},
			codemirror: {
				src: 'dist/codemirror.js',
				dest: 'dist/codemirror.min.js'
			}
		},
		qunit: {
			all: ['tests/runner.html']
		},
		jshint: {
			options: {
				curly: false,
				camelcase: true,
				eqnull: true,
				eqeqeq: true,
				undef: true,
				forin: true,
				latedef: true,
				newcap: true,
				unused: true,
				strict: true,
				jquery: true,
				browser: true,
				globals: {
					CodeMirror: false,
					DOMParser: false
				}
			},
			gruntfile: {
				options: { globals: { 'module': false } },
				src: 'Gruntfile.js'
			},
			src: {
				src: 'src/apeye*.js'
			},
			test: {
				options: {
					unused: false,
					strict: false,
					sub: true,
					globals: {
						// we create a global, modifiable APEye instance in tests for simplicity
						apeye: true,
						// following are standard QUnit globals
						module: false,
						assertInvisible: false,
						assertVisible: false,
						assertFieldValue: false,
						sinon: false,
						test: false,
						ok: false,
						strictEqual: false,
						deepEqual: false
					}
				},
				src: 'tests/apeye*.js'
			}
		},
		less: {
			compile: {
				options: {
					compress: true
				},
				files: {
					'dist/apeye.css': 'src/apeye.less'
				}
			}
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: ['jshint:gruntfile']
			},
			src: {
				files: '<%= jshint.src.src %>',
				tasks: ['jshint:src', 'qunit']
			},
			test: {
				files: '<%= jshint.test.src %>',
				tasks: ['jshint:test', 'qunit']
			}
		}
	});

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

	// Default task.
	grunt.registerTask('default', ['jshint', 'less', 'qunit', 'concat', 'uglify']);
};
<commit_msg>Enable Grunt Watch task<commit_after>module.exports = function(grunt) {
	"use strict";
	// Project configuration.
	grunt.initConfig({
		// Metadata.
		pkg: grunt.file.readJSON('package.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.
		concat: {
			apeye: {
				options: {
					banner: '<%= banner %>',
					stripBanners: true
				},
				src: ['src/apeye.js' ],
				dest: 'dist/apeye.js'
			},
			codemirror: {
				files: {
					'dist/codemirror.js': [
						'src/codemirror/lib/codemirror.js',
						'src/codemirror/mode/javascript/javascript.js',
						'src/codemirror/mode/xml/xml.js',
						'src/codemirror/mode/http/http.js',
						'src/codemirror/lib/util/formatting.js',
						'src/codemirror/lib/util/multiplex.js'
					],
					'dist/codemirror.css': 'src/codemirror/lib/codemirror.css'
				}
			}
		},
		uglify: {
			dist: {
				options: { banner: '<%= banner %>' },
				src: 'dist/apeye.js',
				dest: 'dist/apeye.min.js'
			},
			codemirror: {
				src: 'dist/codemirror.js',
				dest: 'dist/codemirror.min.js'
			}
		},
		qunit: {
			all: ['tests/runner.html']
		},
		jshint: {
			options: {
				curly: false,
				camelcase: true,
				eqnull: true,
				eqeqeq: true,
				undef: true,
				forin: true,
				latedef: true,
				newcap: true,
				unused: true,
				strict: true,
				jquery: true,
				browser: true,
				globals: {
					CodeMirror: false,
					DOMParser: false
				}
			},
			gruntfile: {
				options: { globals: { 'module': false } },
				src: 'Gruntfile.js'
			},
			src: {
				src: 'src/apeye*.js'
			},
			test: {
				options: {
					unused: false,
					strict: false,
					sub: true,
					globals: {
						// we create a global, modifiable APEye instance in tests for simplicity
						apeye: true,
						// following are standard QUnit globals
						module: false,
						assertInvisible: false,
						assertVisible: false,
						assertFieldValue: false,
						sinon: false,
						test: false,
						ok: false,
						strictEqual: false,
						deepEqual: false
					}
				},
				src: 'tests/apeye*.js'
			}
		},
		less: {
			compile: {
				options: {
					compress: true
				},
				files: {
					'dist/apeye.css': 'src/apeye.less'
				}
			}
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: ['jshint:gruntfile']
			},
			src: {
				files: '<%= jshint.src.src %>',
				tasks: ['jshint:src', 'qunit']
			},
			test: {
				files: '<%= jshint.test.src %>',
				tasks: ['jshint:test', 'qunit']
			}
		}
	});

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

	// Default task.
	grunt.registerTask('default', ['jshint', 'less', 'qunit', 'concat', 'uglify']);
};
<|endoftext|>


<commit_before>// Configuration
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: '<json:package.json>',

        htmlhint: {
            all: {
                options: {
                    'tagname-lowercase': true,
                    'attr-lowercase': true,
                    'doctype-first': true,
                    'tag-pair': true,
                    'spec-char-escape': true,
                    'id-unique': true,
                    'img-alt-require': true,
                    'doctype-html5': true,
                    'id-class-value': true,
                    'style-disabled': true
                },
                src: ['*.html']
            }
        },

        jshint: {
            all: ['scripts/main.js',
                  'scripts/helpers/*.js',
                  'scripts/plugins/*.js']
        },

        clean: {
            deploy: ['dist']
        },

        connect: {
            livereload: {
                options: {
                    port: 9001,
                    middleware: function(connect, options) {
                        return[
                            require('connect-livereload')(),
                            connect.static(options.base),
                            connect.directory(options.base)
                        ]
                    }
                }
            }
        },

        watch: {
            options: {
                livereload: true
            },
            html: {
                files: '*.html',
                tasks: ['htmlhint', 'concat:dev', 'compass:dev'],
                options: {
                    nospawn: true
                }
            },
            js: {
                files: ['scripts/helpers/*.js', 'scripts/main.js'],
                tasks: ['jshint', 'concat:dev', 'compass:dev'],
                options: {
                    nospawn: true
                }
            },
            scss: {
                files: 'scss/**/*.scss',
                tasks: ['concat:dev', 'compass:dev'],
                options: {
                    nospawn: true
                }
            }
        },

        modernizr: {
            'devFile' : 'scripts/vendor/modernizr-2.6.2.min.js',
            'outputFile' : 'dist/scripts/vendor/modernizr-2.6.2.min.js',
            'extra' : {
                'shiv' : false,
                'printshiv' : true,
                'load' : false,
                'mq' : true,
                'cssclasses' : true
            },
            'extensibility' : {
                'addtest' : false,
                'prefixed' : false,
                'teststyles' : false,
                'testprops' : false,
                'testallprops' : false,
                'hasevents' : false,
                'prefixes' : false,
                'domprefixes' : false
            },
            'uglify' : true,
            'tests' : [],
            // parseFiles = true: crawl all *.js, *.css, *.scss files;
            // override by defining "files" array
            'parseFiles' : true,
            'files' : ['scss/**/*.scss', 'scripts/**/*.js'],
            'matchCommunityTests' : false,
            'customTests' : [],
            'excludeFiles' : ['Gruntfile.js','package.json']
        },

        concat: {
            dev: {
                src: ['scripts/helpers/log.js',
                      'scripts/helpers/main-shiv.js',
                      'scripts/helpers/accessifyhtml5.js',
                      'scripts/plugins/responsive-nav.js',
                      'scripts/plugins/jquery.magnific-popup.js',
                      'scripts/plugins/responsiveslides.js',
                      'scripts/plugins/jquery.tipsy.js',
                      'scripts/plugins/jquery.syncheight.js',
                      'scripts/plugins/jquery.tabs.js',
                      'scripts/plugins/jquery.gmap.js',
                      'scripts/main.js'],
                dest: 'scripts/master.js'
            }
        },

        uglify: {
            deploy: {
                src: 'scripts/master.js',
                dest: 'dist/scripts/master.js'
            }
        },

        compass: {
            dev: {
                options: {
                    sassDir: 'scss',
                    cssDir: 'styles',
                    imagesDir: 'img',
                    outputStyle: 'nested',
                    noLineComments: true,
                    force: true,
                    debugInfo: false
                }
            },
            deploy: {
                options: {
                    sassDir: 'scss',
                    cssDir: 'dist/styles',
                    imagesDir: 'img',
                    outputStyle: 'compressed',
                    noLineComments: true,
                    force: true,
                    debugInfo: false
                }
            }
        },

        imagemin: {
            deploy: {
                options: {
                    optimizationLevel: 1,
                    progressive: false
                },
                files: [
                    {
                        expand: true,
                        cwd: '.',
                        src: ['img/**/*.png', 'img/**/*.jpg'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        copy: {
            deploy: {
                files: [
                    {
                        src: ['*.html',
                              '.htaccess',
                              'robots.txt',
                              'scripts/vendor/jquery-1.9.1.min.js',
                              'scripts/helpers/boxsizing.htc'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        hashres: {
            options: {
                encoding: 'utf-8',
                fileNameFormat: '${hash}.${ext}',
                renameFiles: true
            },
            deploy: {
                src: [
                    'dist/scripts/master.js',
                    'dist/styles/master.css',
                    'dist/styles/oldie.css'],
                dest: 'dist/*.html',

            }
        }
    });
    // Load required tasks
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-hashres');
    grunt.loadNpmTasks('grunt-htmlhint');
    grunt.loadNpmTasks('grunt-modernizr');
    // Default
    grunt.registerTask('default', ['connect', 'watch']);
    // Testing
    grunt.registerTask('test', ['htmlhint', 'jshint']);
    // Deployment
    grunt.registerTask('deploy', ['clean:deploy', 'copy:deploy', 'concat:dev', 'compass:deploy', 'uglify', 'imagemin:deploy', 'modernizr', 'hashres:deploy']);
};
<commit_msg>Only do sensible hinting on demand.<commit_after>// Configuration
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: '<json:package.json>',

        htmlhint: {
            all: {
                options: {
                    'tagname-lowercase': true,
                    'attr-lowercase': true,
                    'doctype-first': true,
                    'tag-pair': true,
                    'spec-char-escape': true,
                    'id-unique': true,
                    'img-alt-require': true,
                    'doctype-html5': true,
                    'id-class-value': true,
                    'style-disabled': true
                },
                src: ['*.html']
            }
        },

        jshint: {
            all: ['Gruntfile.js',
                  'scripts/main.js']
        },

        clean: {
            deploy: ['dist']
        },

        connect: {
            livereload: {
                options: {
                    port: 9001,
                    middleware: function(connect, options) {
                        return[
                            require('connect-livereload')(),
                            connect.static(options.base),
                            connect.directory(options.base)
                        ];
                    }
                }
            }
        },

        watch: {
            options: {
                livereload: true
            },
            html: {
                files: '*.html',
                tasks: ['concat:dev', 'compass:dev'],
                options: {
                    nospawn: true
                }
            },
            js: {
                files: ['scripts/main.js'],
                tasks: ['concat:dev', 'compass:dev'],
                options: {
                    nospawn: true
                }
            },
            scss: {
                files: 'scss/**/*.scss',
                tasks: ['concat:dev', 'compass:dev'],
                options: {
                    nospawn: true
                }
            }
        },

        modernizr: {
            'devFile' : 'scripts/vendor/modernizr-2.6.2.min.js',
            'outputFile' : 'dist/scripts/vendor/modernizr-2.6.2.min.js',
            'extra' : {
                'shiv' : false,
                'printshiv' : true,
                'load' : false,
                'mq' : true,
                'cssclasses' : true
            },
            'extensibility' : {
                'addtest' : false,
                'prefixed' : false,
                'teststyles' : false,
                'testprops' : false,
                'testallprops' : false,
                'hasevents' : false,
                'prefixes' : false,
                'domprefixes' : false
            },
            'uglify' : true,
            'tests' : [],
            // parseFiles = true: crawl all *.js, *.css, *.scss files;
            // override by defining "files" array
            'parseFiles' : true,
            'files' : ['scss/**/*.scss', 'scripts/**/*.js'],
            'matchCommunityTests' : false,
            'customTests' : [],
            'excludeFiles' : ['Gruntfile.js','package.json']
        },

        concat: {
            dev: {
                src: ['scripts/helpers/log.js',
                      'scripts/helpers/main-shiv.js',
                      'scripts/helpers/accessifyhtml5.js',
                      'scripts/plugins/responsive-nav.js',
                      'scripts/plugins/jquery.magnific-popup.js',
                      'scripts/plugins/responsiveslides.js',
                      'scripts/plugins/jquery.tipsy.js',
                      'scripts/plugins/jquery.syncheight.js',
                      'scripts/plugins/jquery.tabs.js',
                      'scripts/plugins/jquery.gmap.js',
                      'scripts/main.js'],
                dest: 'scripts/master.js'
            }
        },

        uglify: {
            deploy: {
                src: 'scripts/master.js',
                dest: 'dist/scripts/master.js'
            }
        },

        compass: {
            dev: {
                options: {
                    sassDir: 'scss',
                    cssDir: 'styles',
                    imagesDir: 'img',
                    outputStyle: 'nested',
                    noLineComments: true,
                    force: true,
                    debugInfo: false
                }
            },
            deploy: {
                options: {
                    sassDir: 'scss',
                    cssDir: 'dist/styles',
                    imagesDir: 'img',
                    outputStyle: 'compressed',
                    noLineComments: true,
                    force: true,
                    debugInfo: false
                }
            }
        },

        imagemin: {
            deploy: {
                options: {
                    optimizationLevel: 1,
                    progressive: false
                },
                files: [
                    {
                        expand: true,
                        cwd: '.',
                        src: ['img/**/*.png', 'img/**/*.jpg'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        copy: {
            deploy: {
                files: [
                    {
                        src: ['*.html',
                              '.htaccess',
                              'robots.txt',
                              'scripts/vendor/jquery-1.9.1.min.js',
                              'scripts/helpers/boxsizing.htc'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        hashres: {
            options: {
                encoding: 'utf-8',
                fileNameFormat: '${hash}.${ext}',
                renameFiles: true
            },
            deploy: {
                src: [
                    'dist/scripts/master.js',
                    'dist/styles/master.css',
                    'dist/styles/oldie.css'],
                dest: 'dist/*.html',

            }
        }
    });
    // Load required tasks
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-hashres');
    grunt.loadNpmTasks('grunt-htmlhint');
    grunt.loadNpmTasks('grunt-modernizr');
    // Default
    grunt.registerTask('default', ['connect', 'watch']);
    // Testing
    grunt.registerTask('test', ['htmlhint', 'jshint']);
    // Deployment
    grunt.registerTask('deploy', ['clean:deploy', 'copy:deploy', 'concat:dev', 'compass:deploy', 'uglify', 'imagemin:deploy', 'modernizr', 'hashres:deploy']);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

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

  var karmaConfig = function(configFile, customOptions) {
    var options = { configFile: configFile, keepalive: true };
    var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
    return grunt.util._.extend(options, customOptions, travisOptions);
  };

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('bower.json'),
    meta: {
      banner: '/*!\n' +
        ' * <%= pkg.name %> v<%= pkg.version %>\n' +
        ' * The MIT License\n' +
        ' * Copyright (c) 2013 Jan Antala\n' +
        ' */'
    },
    uglify: {
      options: {
        preserveComments: 'some'
      },
      dist: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.min.js'
      }
    },
    concat: {
      options: {
        process: true,
        banner: '<%= meta.banner %>\n\n'
      },
      dist: {
        src: 'src/<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.js'
      }
    },
    karma: {
      unit: {
        options: karmaConfig('test/test.conf.js')
      }
    },
    jshint:{
      files:['src/**/*.js', 'test/**/*.js'],
      options: {
        curly:true,
        eqeqeq:true,
        immed:true,
        latedef:true,
        newcap:true,
        noarg:true,
        sub:true,
        boss:true,
        eqnull:true,
        devel:true,
        globals:{}
      }
    },
    changelog: {
      options: {
        dest: 'CHANGELOG.md'
      }
    },
  });
};
<commit_msg>chore(Grunt): use load-grunt-tasks<commit_after>module.exports = function (grunt) {
  require('load-grunt-tasks')(grunt);

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

  var karmaConfig = function(configFile, customOptions) {
    var options = { configFile: configFile, keepalive: true };
    var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
    return grunt.util._.extend(options, customOptions, travisOptions);
  };

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('bower.json'),
    meta: {
      banner: '/*!\n' +
        ' * <%= pkg.name %> v<%= pkg.version %>\n' +
        ' * The MIT License\n' +
        ' * Copyright (c) 2013 Jan Antala\n' +
        ' */'
    },
    uglify: {
      options: {
        preserveComments: 'some'
      },
      dist: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.min.js'
      }
    },
    concat: {
      options: {
        process: true,
        banner: '<%= meta.banner %>\n\n'
      },
      dist: {
        src: 'src/<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.js'
      }
    },
    karma: {
      unit: {
        options: karmaConfig('test/test.conf.js')
      }
    },
    jshint:{
      files:['src/**/*.js', 'test/**/*.js'],
      options: {
        curly:true,
        eqeqeq:true,
        immed:true,
        latedef:true,
        newcap:true,
        noarg:true,
        sub:true,
        boss:true,
        eqnull:true,
        devel:true,
        globals:{}
      }
    },
    changelog: {
      options: {
        dest: 'CHANGELOG.md'
      }
    },
  });
};
<|endoftext|>


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

	grunt.initConfig({

		// Coffee build
		coffee: {
			build: {
				options: {
					join: true
				},
				files: {
					'build/rotten-flesh.js': 'src/**/*.coffee'
				}
			}
		},

		// Uglify stuff
		uglify: {
			options: {
				mangle: false,
			},
			target: {
				files: {
					"build/rotten-flesh.min.js": "build/rotten-flesh.js"
				}
			}
		},

		// Watch task
		watch: {
			coffeeScripts: {
				files: "src/**/*.coffee",
				tasks: "coffee:build"
			},

			gruntfile: {
				files: ['Gruntfile.js']
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-coffee');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.registerTask("build", [
		"coffee:build"
	]);

	grunt.registerTask("dist", [
		"coffee:build",
		"uglify"
	]);

	grunt.registerTask("test", [

	]);

};
<commit_msg>update gruntfile<commit_after>module.exports = function(grunt) {

	grunt.initConfig({

		// Coffee build
		coffee: {
			build: {
				options: {
					join: true
				},
				files: {
					'build/rotten-flesh.js': 'src/**/*.coffee'
				}
			}
		},

		// Uglify stuff
		uglify: {
			options: {
				mangle: false,
			},
			target: {
				files: {
					"build/rotten-flesh.min.js": "build/rotten-flesh.js"
				}
			}
		},

		// Watch task
		watch: {
			coffeeScripts: {
				files: "src/**/*.coffee",
				tasks: "coffee:build"
			},

			gruntfile: {
				files: ['Gruntfile.js']
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-coffee');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.registerTask("build", [
		"coffee:build"
	]);

	grunt.registerTask("dist", [
		"coffee:build",
		"uglify"
	]);

	grunt.registerTask("listen", [
		"watch"
	]);

	grunt.registerTask("test", [

	]);

};
<|endoftext|>


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

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

		jshint: {
			src: [
				"**/*.js", "!{node_modules,ViewStack/transitions}/**", "!**/themes/**", "!*/css/*.js"
			],
			options: {
				jshintrc: ".jshintrc"
			}
		},

		// Task for compiling less files into CSS files
		less : {
			// Compile less code for each widget
			widgets : {
				files: [
					{
						expand: true,
						src: ["*/themes/*/*.less", "list/*/themes/*/*.less", "!**/variables.less",
						      "!{dijit,mobile}/themes/*/*.less", "*/css/*.less",
							 "ViewStack/transitions/*.less"],
						ext: ".css"
					}
				]
			}
		},

		// Copied from grunt web site but not tested
		uglify: {
			options: {
				banner: "/*! <%= pkg.name %> <%= grunt.template.today('yyyy-mm-dd') %> */\n"
			},
			build: {
				src: "src/<%= pkg.name %>.js",
				dest: "build/<%= pkg.name %>.min.js"
			}
		},

		intern: {
			local: {
				options: {
					runType: "runner",
					config: "tests/intern.local",
					reporters: ["runner"]
				}
			},
			"local.android": {
				options: {
					runType: "runner",
					config: "tests/intern.local.android",
					reporters: ["runner"]
				}
			},
			"local.ios": {
				options: {
					runType: "runner",
					config: "tests/intern.local.ios",
					reporters: ["runner"]
				}
			},
			remote: {
				options: {
					runType: "runner",
					config: "tests/intern",
					reporters: ["runner"]
				}
			},
			browserstack: {
				options: {
					runType: "runner",
					config: "tests/intern.browserstack",
					reporters: ["runner"]
				}
			}
		},

		"jsdoc-amddcl": {
			docs: {
				files: [
					{
						src: [
							".",
							"./list",
							"./README.md",
							"./package.json"
						],
						imports: [
							"../delite/out"
						],
						paths: {
							"decor": "../../../../decor/docs/api/0.3.0/decor",
							"delite": "../../../../delite/docs/api/0.4.0/delite"
						},
						packagePathFormat: "${name}/docs/api/${version}"
					}
				]
			},
			export: {
				files: [
					{
						args: [
							"-X"
						],
						src: [
							".",
							"./list",
							"./README.md",
							"./package.json"
						],
						dest: "./out/doclets.json",
						imports: [
							"../delite/out"
						]
					}
				]
			}
		}
	});

	// Load plugins
	grunt.loadNpmTasks("intern");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-less");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("jsdoc-amddcl");

	// Aliases
	grunt.registerTask("default", ["less"]);
	grunt.registerTask("jsdoc", "jsdoc-amddcl");

	// Testing.
	// always specify the target e.g. grunt test:remote, grunt test:remote
	// then add on any other flags afterwards e.g. console, lcovhtml
	var testTaskDescription = "Run this task instead of the intern task directly! \n" +
		"Always specify the test target e.g. \n" +
		"grunt test:local\n" +
		"grunt test:local.android\n" +
		"grunt test:local.ios\n" +
		"grunt test:remote\n\n" +
		"Add any optional reporters via a flag e.g. \n" +
		"grunt test:local:console\n" +
		"grunt test:local:lcovhtml\n" +
		"grunt test:local:console:lcovhtml";
	grunt.registerTask("test", testTaskDescription, function (target) {
		function addReporter(reporter) {
			var property = "intern." + target + ".options.reporters",
				value = grunt.config.get(property);
			if (value.indexOf(reporter) !== -1) {
				return;
			}
			value.push(reporter);
			grunt.config.set(property, value);
		}
		if (this.flags.lcovhtml) {
			addReporter("lcovhtml");
		}

		if (this.flags.console) {
			addReporter("console");
		}
		grunt.task.run("intern:" + target);
	});
};<commit_msg>JSDoc: add flag in Gruntfile to disable inclusion of Events section in TOC of API doc<commit_after>/*global module */
module.exports = function (grunt) {

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

		jshint: {
			src: [
				"**/*.js", "!{node_modules,ViewStack/transitions}/**", "!**/themes/**", "!*/css/*.js"
			],
			options: {
				jshintrc: ".jshintrc"
			}
		},

		// Task for compiling less files into CSS files
		less : {
			// Compile less code for each widget
			widgets : {
				files: [
					{
						expand: true,
						src: ["*/themes/*/*.less", "list/*/themes/*/*.less", "!**/variables.less",
						      "!{dijit,mobile}/themes/*/*.less", "*/css/*.less",
							 "ViewStack/transitions/*.less"],
						ext: ".css"
					}
				]
			}
		},

		// Copied from grunt web site but not tested
		uglify: {
			options: {
				banner: "/*! <%= pkg.name %> <%= grunt.template.today('yyyy-mm-dd') %> */\n"
			},
			build: {
				src: "src/<%= pkg.name %>.js",
				dest: "build/<%= pkg.name %>.min.js"
			}
		},

		intern: {
			local: {
				options: {
					runType: "runner",
					config: "tests/intern.local",
					reporters: ["runner"]
				}
			},
			"local.android": {
				options: {
					runType: "runner",
					config: "tests/intern.local.android",
					reporters: ["runner"]
				}
			},
			"local.ios": {
				options: {
					runType: "runner",
					config: "tests/intern.local.ios",
					reporters: ["runner"]
				}
			},
			remote: {
				options: {
					runType: "runner",
					config: "tests/intern",
					reporters: ["runner"]
				}
			},
			browserstack: {
				options: {
					runType: "runner",
					config: "tests/intern.browserstack",
					reporters: ["runner"]
				}
			}
		},

		"jsdoc-amddcl": {
			docs: {
				files: [
					{
						src: [
							".",
							"./list",
							"./README.md",
							"./package.json"
						],
						imports: [
							"../delite/out"
						],
						paths: {
							"decor": "../../../../decor/docs/api/0.3.0/decor",
							"delite": "../../../../delite/docs/api/0.4.0/delite"
						},
						packagePathFormat: "${name}/docs/api/${version}",
						includeEventsInTOC: "false"
					}
				]
			},
			export: {
				files: [
					{
						args: [
							"-X"
						],
						src: [
							".",
							"./list",
							"./README.md",
							"./package.json"
						],
						dest: "./out/doclets.json",
						imports: [
							"../delite/out"
						]
					}
				]
			}
		}
	});

	// Load plugins
	grunt.loadNpmTasks("intern");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-less");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("jsdoc-amddcl");

	// Aliases
	grunt.registerTask("default", ["less"]);
	grunt.registerTask("jsdoc", "jsdoc-amddcl");

	// Testing.
	// always specify the target e.g. grunt test:remote, grunt test:remote
	// then add on any other flags afterwards e.g. console, lcovhtml
	var testTaskDescription = "Run this task instead of the intern task directly! \n" +
		"Always specify the test target e.g. \n" +
		"grunt test:local\n" +
		"grunt test:local.android\n" +
		"grunt test:local.ios\n" +
		"grunt test:remote\n\n" +
		"Add any optional reporters via a flag e.g. \n" +
		"grunt test:local:console\n" +
		"grunt test:local:lcovhtml\n" +
		"grunt test:local:console:lcovhtml";
	grunt.registerTask("test", testTaskDescription, function (target) {
		function addReporter(reporter) {
			var property = "intern." + target + ".options.reporters",
				value = grunt.config.get(property);
			if (value.indexOf(reporter) !== -1) {
				return;
			}
			value.push(reporter);
			grunt.config.set(property, value);
		}
		if (this.flags.lcovhtml) {
			addReporter("lcovhtml");
		}

		if (this.flags.console) {
			addReporter("console");
		}
		grunt.task.run("intern:" + target);
	});
};<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {
    grunt.initConfig({
        /*
         * Information can be loaded from the package.json and reused in the
         * Gruntfile. This is nice in order to avoid duplication of information.
         */
        pkg: '<json:package.json>',

        /*
         * Just a definition of all the sources files and their location. We
         * put them in a meta section so that we only need to declare them once.
         */
        meta: {
            all: ['client/**/*', 'server/**/*', 'test/**/*'],
            gruntfile: 'Gruntfile.js',
            server: {
                src: 'server/**/*.js',
                test: 'test/server/**/*.js'
            },
            client: {
                js: ['client/js/**/*.js', '!client/js/lib/**/*'],
                tests: {
                    ui: {
                        configLocal: 'test/client/ui-local.conf.js',
                        configSauce: 'test/client/ui-saucelabs.conf.js',
                        src: 'test/client/ui/**/*.js'
                    },
                    unit: {
                        config: 'test/client/unit.conf.js',
                        src: 'test/client/unit/**/*.js'
                    }
                }
            }
        },

        /*
         * Simplemocha is executing our Mocha tests (Mocha is our test runner
         * for the server-side tests).
         */
        simplemocha: {
            options: {
                timeout: 3000,
                ignoreLeaks: false,
                ui: 'bdd',
                reporter: 'spec'
            },
            all: {
                src: '<%= meta.server.test %>'
            }
        },

        /*
         * Statis source code analyses. JSHint verifies that we are adhering
         * to good coding styles, avoid pitfalls and much more.
         * http://jshint.com/docs/
         *
         * We are configuring different settings for the different parts of our
         * code, as browser environments are different to NodeJS environments.
         */
        jshint: {
            server: {
                files: { src: '<%= meta.server.src %>' },
                options: {
                    node: true,
                    globalstrict: true
                }
            },
            servertest: {
                files: { src: '<%= meta.server.test %>' },
                options: {
                    node: true,
                    globalstrict: true,
                    expr: true, // to allow the use of expet(val).to.be.empty
                    globals: {
                        describe: false,
                        beforeEach: false,
                        it: false
                    }
                }
            },
            gruntfile: {
                files: { src: '<%= meta.gruntfile %>' },
                options: {
                    node: true,
                    globalstrict: true
                }
            },
            client: {
                files: { src: '<%= meta.client.js %>' },
                options: {
                    browser: true,
                    unused: false,
                    globals: {
                        angular: false
                    }
                }
            },
            clientUi: {
                files: { src: '<%= meta.client.tests.ui.src %>' },
                options: {
                    node: true,
                    globalstrict: true,
                    globals: {
                        browser: false,
                        expect: false,
                        describe: false,
                        it: false,
                        beforeEach: false,
                        element: false,
                        by: false
                    }
                }
            },
            clientUnit: {
                files: { src: '<%= meta.client.tests.unit.src %>' },
                options: {
                    newcap: false,
                    undef: false,
                    immed: false,
                    unused: false,
                    sub: false,
                    noempty: false,
                    expr: true,
                    globals: {
                        describe: false,
                        it: false,
                        chai: false
                    }
                }
            },
            options: {
                bitwise: true,
                boss: true,
                curly: true,
                camelcase: true,
                eqeqeq: true,
                eqnull: true,
                forin: true,
                immed: true,
                indent: 4,
                latedef: true,
                maxcomplexity: 6,
                maxdepth: 3,
                maxparams: 4,
                maxstatements: 14,
                maxlen: 120,
                newcap: true,
                noarg: true,
                noempty: true,
                nonew: true,
                quotmark: 'single',
                sub: true,
                strict: true,
                trailing: true,
                undef: true,
                unused: true
            }
        },

        /*
         * Karma is our super awesome test runner. It starts up a browser for
         * you and can even observe file changes. We have our own Grunt
         * plugin as we want the tests to be run asynchronously.
         */
        karma: {
            unit: {
                configFile: '<%= meta.client.tests.unit.config %>',
                browsers: ['PhantomJS'],
                singleRun: true
            }
        },

        /*
         * Protractor is the preferred AngularJS test runner. It is basically
         * a small wrapper around WebDriverJS and Selenium which enables
         * tests of AngularJS-based applications.
         */
        protractor: {
            local: {
                configFile: '<%= meta.client.tests.ui.configLocal %>'
            },
            travis: {
                configFile: '<%= meta.client.tests.ui.configSauce %>'
            }
        },

        /*
         * Watch is handy when you want to execute tasks upon file changes, e.g.
         * execute tests and static source code analysis.
         */
        watch: {
            files: '<%= meta.all %>',
            tasks: ['jshint', 'simplemocha', 'karma:unit']
        }
    });

    require('load-grunt-tasks')(grunt);
    grunt.loadTasks('./tasks');

    grunt.registerTask('travis', [
        'jshint',
        'simplemocha',
        'karma:unit',
        'server',
        'protractor:travis'
    ]);

    grunt.registerTask('test', [
        'jshint',
        'simplemocha',
        'karma:unit',
        'server',
        'protractor:local'
    ]);

    grunt.registerTask('dev', ['server', 'watch']);
};
<commit_msg>Add twttr as global variable to grunt ignore<commit_after>'use strict';

module.exports = function (grunt) {
    grunt.initConfig({
        /*
         * Information can be loaded from the package.json and reused in the
         * Gruntfile. This is nice in order to avoid duplication of information.
         */
        pkg: '<json:package.json>',

        /*
         * Just a definition of all the sources files and their location. We
         * put them in a meta section so that we only need to declare them once.
         */
        meta: {
            all: ['client/**/*', 'server/**/*', 'test/**/*'],
            gruntfile: 'Gruntfile.js',
            server: {
                src: 'server/**/*.js',
                test: 'test/server/**/*.js'
            },
            client: {
                js: ['client/js/**/*.js', '!client/js/lib/**/*'],
                tests: {
                    ui: {
                        configLocal: 'test/client/ui-local.conf.js',
                        configSauce: 'test/client/ui-saucelabs.conf.js',
                        src: 'test/client/ui/**/*.js'
                    },
                    unit: {
                        config: 'test/client/unit.conf.js',
                        src: 'test/client/unit/**/*.js'
                    }
                }
            }
        },

        /*
         * Simplemocha is executing our Mocha tests (Mocha is our test runner
         * for the server-side tests).
         */
        simplemocha: {
            options: {
                timeout: 3000,
                ignoreLeaks: false,
                ui: 'bdd',
                reporter: 'spec'
            },
            all: {
                src: '<%= meta.server.test %>'
            }
        },

        /*
         * Statis source code analyses. JSHint verifies that we are adhering
         * to good coding styles, avoid pitfalls and much more.
         * http://jshint.com/docs/
         *
         * We are configuring different settings for the different parts of our
         * code, as browser environments are different to NodeJS environments.
         */
        jshint: {
            server: {
                files: { src: '<%= meta.server.src %>' },
                options: {
                    node: true,
                    globalstrict: true
                }
            },
            servertest: {
                files: { src: '<%= meta.server.test %>' },
                options: {
                    node: true,
                    globalstrict: true,
                    expr: true, // to allow the use of expet(val).to.be.empty
                    globals: {
                        describe: false,
                        beforeEach: false,
                        it: false
                    }
                }
            },
            gruntfile: {
                files: { src: '<%= meta.gruntfile %>' },
                options: {
                    node: true,
                    globalstrict: true
                }
            },
            client: {
                files: { src: '<%= meta.client.js %>' },
                options: {
                    browser: true,
                    unused: false,
                    globals: {
                        angular: false,
                        twttr: false
                    }
                }
            },
            clientUi: {
                files: { src: '<%= meta.client.tests.ui.src %>' },
                options: {
                    node: true,
                    globalstrict: true,
                    globals: {
                        browser: false,
                        expect: false,
                        describe: false,
                        it: false,
                        beforeEach: false,
                        element: false,
                        by: false
                    }
                }
            },
            clientUnit: {
                files: { src: '<%= meta.client.tests.unit.src %>' },
                options: {
                    newcap: false,
                    undef: false,
                    immed: false,
                    unused: false,
                    sub: false,
                    noempty: false,
                    expr: true,
                    globals: {
                        describe: false,
                        it: false,
                        chai: false
                    }
                }
            },
            options: {
                bitwise: true,
                boss: true,
                curly: true,
                camelcase: true,
                eqeqeq: true,
                eqnull: true,
                forin: true,
                immed: true,
                indent: 4,
                latedef: true,
                maxcomplexity: 6,
                maxdepth: 3,
                maxparams: 4,
                maxstatements: 14,
                maxlen: 120,
                newcap: true,
                noarg: true,
                noempty: true,
                nonew: true,
                quotmark: 'single',
                sub: true,
                strict: true,
                trailing: true,
                undef: true,
                unused: true
            }
        },

        /*
         * Karma is our super awesome test runner. It starts up a browser for
         * you and can even observe file changes. We have our own Grunt
         * plugin as we want the tests to be run asynchronously.
         */
        karma: {
            unit: {
                configFile: '<%= meta.client.tests.unit.config %>',
                browsers: ['PhantomJS'],
                singleRun: true
            }
        },

        /*
         * Protractor is the preferred AngularJS test runner. It is basically
         * a small wrapper around WebDriverJS and Selenium which enables
         * tests of AngularJS-based applications.
         */
        protractor: {
            local: {
                configFile: '<%= meta.client.tests.ui.configLocal %>'
            },
            travis: {
                configFile: '<%= meta.client.tests.ui.configSauce %>'
            }
        },

        /*
         * Watch is handy when you want to execute tasks upon file changes, e.g.
         * execute tests and static source code analysis.
         */
        watch: {
            files: '<%= meta.all %>',
            tasks: ['jshint', 'simplemocha', 'karma:unit']
        }
    });

    require('load-grunt-tasks')(grunt);
    grunt.loadTasks('./tasks');

    grunt.registerTask('travis', [
        'jshint',
        'simplemocha',
        'karma:unit',
        'server',
        'protractor:travis'
    ]);

    grunt.registerTask('test', [
        'jshint',
        'simplemocha',
        'karma:unit',
        'server',
        'protractor:local'
    ]);

    grunt.registerTask('dev', ['server', 'watch']);
};
<|endoftext|>