<commit_before>/* jshint node:true */
'use strict';
module.exports = function (grunt) {

  var config = {
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.readJSON('.aws-config.json'),
    srcDir: 'src',
    destDir: 'dist',
    tempDir: 'tmp',
    meta: {
      banner: '/*! <%= 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 <%= pkg.license %> */\n\n'
    },
    clean: {
      on_start: ['<%= destDir %>', '<%= tempDir %>'],
      temp: ['<%= tempDir %>'],
    },
    copy: {
      everthing_left_in_src: {
        cwd: '<%= srcDir %>',
        expand: true,
        src: [
          '**/*.js',
          '**/*.json',
          'font/**/*',
          'img/**/*',
          'panels/bettermap/leaflet/*.png'
        ],
        dest: '<%= tempDir %>'
      }
    },
    jshint: {
      // just lint the source dir
      source: {
        files: {
          src: ['Gruntfile.js', '<%= srcDir %>/app/**/*.js']
        }
      },
      options: {
        jshintrc: '.jshintrc'
      }
    },
    less: {
      dist:{
        options:{
          compress: true
        },
        expand: true,
        cwd:'<%= srcDir %>/vendor/bootstrap/less/',
        src: ['bootstrap.dark.less', 'bootstrap.light.less'],
        dest: '<%= tempDir %>/css/',
      },
      // Compile to src when not building
      src:{
        options: {
          paths: ["<%= srcDir %>/vendor/bootstrap/less"],
          yuicompress:true
        },
        files: {
          "<%= srcDir %>/css/bootstrap.dark.min.css": "<%= srcDir %>/vendor/bootstrap/less/bootstrap.dark.less",
          "<%= srcDir %>/css/bootstrap.light.min.css": "<%= srcDir %>/vendor/bootstrap/less/bootstrap.light.less"
        }
      }
    },
    cssmin: {
      dist: {
        expand: true,
        cwd: '<%= srcDir %>',
        src: [
          '**/*.css'
        ],
        dest: '<%= tempDir %>'
      }
    },
    htmlmin:{
      dist: {
        options:{
          removeComments: true,
          collapseWhitespace: true
        },
        expand: true,
        cwd: '<%= srcDir %>',
        src: [
          'index.html',
          'app/panels/**/*.html',
          'app/partials/**/*.html'
        ],
        dest: '<%= tempDir %>'
      }
    },
    ngmin: {
      scripts: {
        expand:true,
        cwd:'<%= tempDir %>',
        src: [
          'app/controllers/**/*.js',
          'app/directives/**/*.js',
          'app/services/**/*.js',
          'app/filters/**/*.js',
          'app/panels/**/*.js',
          'app/app.js',
          'vendor/angular/**/*.js',
          'vendor/elasticjs/elastic-angular-client.js'
        ],
        dest: '<%= tempDir %>'
      }
    },
    requirejs: {
      compile_temp: {
        options: {
          appDir: '<%= tempDir %>',
          dir: '<%= destDir %>',

          mainConfigFile: '<%= tempDir %>/app/components/require.config.js',
          modules: [], // populated below

          optimize: 'none',
          optimizeCss: 'none',

          removeCombined: true,
          preserveLicenseComments: false,
          findNestedDependencies: true,
          normalizeDirDefines: "none",
          inlineText: true,
          skipPragmas: true,
          optimizeAllPluginResources: 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();
          }
        }
      }
    },
    uglify: {
      dest: {
        expand: true,
        src: ['**/*.js', '!config.js', '!app/dashboards/*.js'],
        dest: '<%= destDir %>',
        cwd: '<%= destDir %>',
        options: {
          quite: true,
          compress: true,
          preserveComments: false,
          banner: '<%= meta.banner %>'
        }
      }
    },
    'git-describe': {
      me: {
        // Target-specific file lists and/or options go here.
      },
    },
    zip: {
      dist: {
        cwd: '<%= destDir %>',
        src: ['<%= destDir %>/**/*','LICENSE.md','README.md'],
        dest: '<%= tempDir %>/dist.zip'
      }
    },
    s3: {
      options: {
        key: '<%= aws.key %>',
        secret: '<%= aws.secret %>',
        bucket: 'download.elasticsearch.org',
        access: 'private'
      },
      dist: {
        upload: [
          {
            src: '<%= tempDir %>/dist.zip',
            dest: 'kibana/kibana/<%= pkg.name %>-latest.zip',
          }
        ]
      }
    }
  };

  var fs = require('fs');
  var requireModules = [
    {
      // main/common module
      name: 'app',
      include: [
        'kbn',
        'jquery',
        'underscore',
        'angular',
        'bootstrap',
        'modernizr',
        'jquery',
        'angular-sanitize',
        'timepicker',
        'datepicker',
        'elasticjs',
        'angular-strap',
        'directives/all',
        'filters/all',
        'services/all',
        'jquery.flot',
        'jquery.flot.pie',
        'text',
        'settings'
      ]
    }
  ];

  // create a module for each directory in src/app/panels/
  fs.readdirSync(config.srcDir+'/app/panels').forEach(function (panelName) {
    requireModules.push({
      name: 'panels/'+panelName+'/module',
      exclude: ['app']
    });
  });

  // exclude the literal config definition from all modules
  requireModules.forEach(function (module) {
    module.excludeShallow = module.excludeShallow || [];
    module.excludeShallow.push('config');
  });

  config.requirejs.compile_temp.options.modules = requireModules;

  // load plugins
  grunt.loadNpmTasks('grunt-s3');
  grunt.loadNpmTasks('grunt-zip');
  grunt.loadNpmTasks('grunt-ngmin');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-git-describe');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-string-replace');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-requirejs');

  // Project configuration.
  grunt.initConfig(config);

  // Default task.
  grunt.registerTask('default', ['jshint:source','less:src']);
  grunt.registerTask('build', [
    'jshint:source',
    'clean:on_start',
    'htmlmin',
    'less:dist',
    'cssmin',
    'copy:everthing_left_in_src',
    'ngmin',
    'requirejs:compile_temp',
    'clean:temp',
    'write_revision_to_dest', // runs git-describe and replace:config
    'uglify:dest'
  ]);

  grunt.registerTask('distribute', [
    'build',
    'zip:dist',
    's3:dist',
    'clean:temp'
  ]);

  grunt.registerTask('write_revision_to_dest', function() {
    grunt.event.once('git-describe', function (desc) {
      grunt.config('string-replace.config', {
        src: '<%= destDir %>/app/components/require.config.js',
        dest: '<%= destDir %>/app/components/require.config.js',
        options: {
          replacements: [
            {
              pattern: /(?:^|\/\/)(.*)@REV@/,
              replacement: '$1'+desc.object
            }
          ]
        }
      });

      grunt.task.run('string-replace:config');
    });
    grunt.task.run('git-describe');
  });

};<commit_msg>moved the aws config out of the general gruntfile setup, and into a task that is only run when needed.<commit_after>/* jshint node:true */
'use strict';
module.exports = function (grunt) {

  var config = {
    pkg: grunt.file.readJSON('package.json'),
    srcDir: 'src',
    destDir: 'dist',
    tempDir: 'tmp',
    meta: {
      banner: '/*! <%= 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 <%= pkg.license %> */\n\n'
    },
    clean: {
      on_start: ['<%= destDir %>', '<%= tempDir %>'],
      temp: ['<%= tempDir %>'],
    },
    copy: {
      everthing_left_in_src: {
        cwd: '<%= srcDir %>',
        expand: true,
        src: [
          '**/*.js',
          '**/*.json',
          'font/**/*',
          'img/**/*',
          'panels/bettermap/leaflet/*.png'
        ],
        dest: '<%= tempDir %>'
      }
    },
    jshint: {
      // just lint the source dir
      source: {
        files: {
          src: ['Gruntfile.js', '<%= srcDir %>/app/**/*.js']
        }
      },
      options: {
        jshintrc: '.jshintrc'
      }
    },
    less: {
      dist:{
        options:{
          compress: true
        },
        expand: true,
        cwd:'<%= srcDir %>/vendor/bootstrap/less/',
        src: ['bootstrap.dark.less', 'bootstrap.light.less'],
        dest: '<%= tempDir %>/css/',
      },
      // Compile to src when not building
      src:{
        options: {
          paths: ["<%= srcDir %>/vendor/bootstrap/less"],
          yuicompress:true
        },
        files: {
          "<%= srcDir %>/css/bootstrap.dark.min.css": "<%= srcDir %>/vendor/bootstrap/less/bootstrap.dark.less",
          "<%= srcDir %>/css/bootstrap.light.min.css": "<%= srcDir %>/vendor/bootstrap/less/bootstrap.light.less"
        }
      }
    },
    cssmin: {
      dist: {
        expand: true,
        cwd: '<%= srcDir %>',
        src: [
          '**/*.css'
        ],
        dest: '<%= tempDir %>'
      }
    },
    htmlmin:{
      dist: {
        options:{
          removeComments: true,
          collapseWhitespace: true
        },
        expand: true,
        cwd: '<%= srcDir %>',
        src: [
          'index.html',
          'app/panels/**/*.html',
          'app/partials/**/*.html'
        ],
        dest: '<%= tempDir %>'
      }
    },
    ngmin: {
      scripts: {
        expand:true,
        cwd:'<%= tempDir %>',
        src: [
          'app/controllers/**/*.js',
          'app/directives/**/*.js',
          'app/services/**/*.js',
          'app/filters/**/*.js',
          'app/panels/**/*.js',
          'app/app.js',
          'vendor/angular/**/*.js',
          'vendor/elasticjs/elastic-angular-client.js'
        ],
        dest: '<%= tempDir %>'
      }
    },
    requirejs: {
      compile_temp: {
        options: {
          appDir: '<%= tempDir %>',
          dir: '<%= destDir %>',

          mainConfigFile: '<%= tempDir %>/app/components/require.config.js',
          modules: [], // populated below

          optimize: 'none',
          optimizeCss: 'none',

          removeCombined: true,
          preserveLicenseComments: false,
          findNestedDependencies: true,
          normalizeDirDefines: "none",
          inlineText: true,
          skipPragmas: true,
          optimizeAllPluginResources: 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();
          }
        }
      }
    },
    uglify: {
      dest: {
        expand: true,
        src: ['**/*.js', '!config.js', '!app/dashboards/*.js'],
        dest: '<%= destDir %>',
        cwd: '<%= destDir %>',
        options: {
          quite: true,
          compress: true,
          preserveComments: false,
          banner: '<%= meta.banner %>'
        }
      }
    },
    'git-describe': {
      me: {
        // Target-specific file lists and/or options go here.
      },
    },
    zip: {
      dist: {
        cwd: '<%= destDir %>',
        src: ['<%= destDir %>/**/*','LICENSE.md','README.md'],
        dest: '<%= tempDir %>/dist.zip'
      }
    },
    s3: {
      dist: {
        upload: [
          {
            src: '<%= tempDir %>/dist.zip',
            dest: 'kibana/kibana/<%= pkg.name %>-latest.zip',
          }
        ]
      }
    }
  };

  var fs = require('fs');
  var requireModules = [
    {
      // main/common module
      name: 'app',
      include: [
        'kbn',
        'jquery',
        'underscore',
        'angular',
        'bootstrap',
        'modernizr',
        'jquery',
        'angular-sanitize',
        'timepicker',
        'datepicker',
        'elasticjs',
        'angular-strap',
        'directives/all',
        'filters/all',
        'services/all',
        'jquery.flot',
        'jquery.flot.pie',
        'text',
        'settings'
      ]
    }
  ];

  // create a module for each directory in src/app/panels/
  fs.readdirSync(config.srcDir+'/app/panels').forEach(function (panelName) {
    requireModules.push({
      name: 'panels/'+panelName+'/module',
      exclude: ['app']
    });
  });

  // exclude the literal config definition from all modules
  requireModules.forEach(function (module) {
    module.excludeShallow = module.excludeShallow || [];
    module.excludeShallow.push('config');
  });

  config.requirejs.compile_temp.options.modules = requireModules;

  // load plugins
  grunt.loadNpmTasks('grunt-s3');
  grunt.loadNpmTasks('grunt-zip');
  grunt.loadNpmTasks('grunt-ngmin');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-git-describe');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-string-replace');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-requirejs');

  // Project configuration.
  grunt.initConfig(config);

  // Default task.
  grunt.registerTask('default', ['jshint:source','less:src']);
  grunt.registerTask('build', [
    'jshint:source',
    'clean:on_start',
    'htmlmin',
    'less:dist',
    'cssmin',
    'copy:everthing_left_in_src',
    'ngmin',
    'requirejs:compile_temp',
    'clean:temp',
    'write_revision_to_dest', // runs git-describe and replace:config
    'uglify:dest'
  ]);

  grunt.registerTask('distribute', [
    'load_s3_config',
    'build',
    'zip:dist',
    's3:dist',
    'clean:temp'
  ]);

  grunt.registerTask('load_s3_config', function () {
    var config = grunt.file.readJSON('.aws-config.json');
    grunt.config('s3.options', {
      key: config.key,
      secret: config.secret,
      bucket: 'download.elasticsearch.org',
      access: 'private'
    });
  });

  grunt.registerTask('write_revision_to_dest', function() {
    grunt.event.once('git-describe', function (desc) {
      grunt.config('string-replace.config', {
        src: '<%= destDir %>/app/components/require.config.js',
        dest: '<%= destDir %>/app/components/require.config.js',
        options: {
          replacements: [
            {
              pattern: /(?:^|\/\/)(.*)@REV@/,
              replacement: '$1'+desc.object
            }
          ]
        }
      });

      grunt.task.run('string-replace:config');
    });
    grunt.task.run('git-describe');
  });

};<|endoftext|>


<commit_before>"use strict";

module.exports = ( grunt ) => {

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

    grunt.initConfig( {
        "eslint": {
            "src": [ "src/**/*.js" ]
        },
        "babel": {
            "options": {
                "presets": [ "es2015" ],
                // "plugins": [ "transform-es2015-modules-umd" ]
            },
            "src": {
                "files": [ {
                    "expand": true,
                    "cwd": "src/",
                    "src": [ "**/*.js" ],
                    "dest": "lib/"
                } ]
            }
        },
        "nodeunit": {
            "files": [ "test/**/*_test.js" ]
        },
        "watch": {
            "src": {
                "files": "src/**/¨.js",
                "tasks": [ "default" ]
            }
        }
    } );

    grunt.registerTask( "test", [ "nodeunit" ] );

    grunt.registerTask( "default", [
        "eslint",
        "babel",
        "test"
    ] );

    grunt.registerTask( "work", [
        "default",
        "watch"
    ] );

};
<commit_msg>Fix gruntfile<commit_after>"use strict";

module.exports = function( grunt ) {

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

    grunt.initConfig( {
        "eslint": {
            "src": [ "src/**/*.js" ]
        },
        "babel": {
            "options": {
                "presets": [ "es2015" ],
                // "plugins": [ "transform-es2015-modules-umd" ]
            },
            "src": {
                "files": [ {
                    "expand": true,
                    "cwd": "src/",
                    "src": [ "**/*.js" ],
                    "dest": "lib/"
                } ]
            }
        },
        "nodeunit": {
            "files": [ "test/**/*_test.js" ]
        },
        "watch": {
            "src": {
                "files": "src/**/¨.js",
                "tasks": [ "default" ]
            }
        }
    } );

    grunt.registerTask( "test", [ "nodeunit" ] );

    grunt.registerTask( "default", [
        "eslint",
        "babel",
        "test"
    ] );

    grunt.registerTask( "work", [
        "default",
        "watch"
    ] );

};
<|endoftext|>


<commit_before>var Lang = A.Lang,

    _DOCUMENT = A.one(A.config.doc),

    ACTIVE_ELEMENT = 'activeElement',
    ACTIVE_INPUT = 'activeInput',
    BOTTOM = 'bottom',
    BOUNDING_BOX = 'boundingBox',
    CLICK = 'click',
    CLICKOUTSIDE = 'clickoutside',
    ESC = 'esc',
    KEY = 'key',
    POPOVER = 'popover',
    POPOVER_CSS_CLASS = 'popoverCssClass';

function DatePickerPopover() {}

DatePickerPopover.ATTRS = {
    autoHide: {
        validator: Lang.isBoolean,
        value: true
    },

    popover: {
        setter: '_setPopover',
        value: {},
        writeOnce: true
    },

    popoverCssClass: {
        validator: Lang.isString,
        value: A.getClassName('datepicker-popover')
    }
};

A.mix(DatePickerPopover.prototype, {
    popover: null,

    alignTo: function(node) {
        var instance = this,
            popover = instance.getPopover();

        popover.set('align.node', node);
    },

    getPopover: function() {
        var instance = this,
            popover = instance.popover;

        if (!popover) {
            popover = new A.Popover(instance.get(POPOVER));
            popover.get(BOUNDING_BOX).on(
                CLICKOUTSIDE, instance._onPopoverClickOutside, instance);

            instance.popover = popover;
        }

        return popover;
    },

    hide: function() {
        var instance = this;

        instance.getPopover().hide();
    },

    show: function() {
        var instance = this;

        instance.getPopover().show();
    },

    _isActiveInputFocused: function() {
        var instance = this,
            activeInput = instance.get(ACTIVE_INPUT);

        return (activeInput === _DOCUMENT.get(ACTIVE_ELEMENT));
    },

    _onPopoverClickOutside: function(event) {
        var instance = this,
            target = event.target,
            activeInput = instance.get(ACTIVE_INPUT);

        if (!instance._isActiveInputFocused() &&
            !activeInput.contains(target)) {

            instance.hide();
        }
    },

    _setPopover: function(val) {
        var instance = this;

        return A.merge({
            bodyContent: '',
            cssClass: instance.get(POPOVER_CSS_CLASS),
            constrain: true,
            hideOn: [
                {
                    node: _DOCUMENT,
                    eventName: KEY,
                    keyCode: ESC
                }
            ],
            position: BOTTOM,
            render: true,
            triggerShowEvent: CLICK,
            triggerToggleEvent: null,
            visible: false
        }, val);
    }
}, true);

A.DatePickerPopover = DatePickerPopover;<commit_msg>Add API Docs placeholder for DatePickerPopover<commit_after>/**
 * The DatePicker Component
 *
 * @module aui-datepicker
 * @submodule aui-datepicker-popover
 */

var Lang = A.Lang,

    _DOCUMENT = A.one(A.config.doc),

    ACTIVE_ELEMENT = 'activeElement',
    ACTIVE_INPUT = 'activeInput',
    BOTTOM = 'bottom',
    BOUNDING_BOX = 'boundingBox',
    CLICK = 'click',
    CLICKOUTSIDE = 'clickoutside',
    ESC = 'esc',
    KEY = 'key',
    POPOVER = 'popover',
    POPOVER_CSS_CLASS = 'popoverCssClass';

/**
 * A base class for DatePickerPopover.
 *
 * @class A.DatePickerPopover
 * @param config {Object} Object literal specifying widget configuration properties.
 * @constructor
 */
function DatePickerPopover() {}

/**
 * TODO. Wanna help? Please send a Pull Request.
 *
 * @property DatePickerPopover.ATTRS
 * @type Object
 * @static
 */
DatePickerPopover.ATTRS = {

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @attribute autoHide
     * @default true
     * @type Boolean
     */
    autoHide: {
        validator: Lang.isBoolean,
        value: true
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @attribute popover
     * @default {}
     * @writeOnce
     */
    popover: {
        setter: '_setPopover',
        value: {},
        writeOnce: true
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @attribute popoverCssClass
     * @default A.getClassName('datepicker-popover')
     * @type String
     */
    popoverCssClass: {
        validator: Lang.isString,
        value: A.getClassName('datepicker-popover')
    }
};

A.mix(DatePickerPopover.prototype, {
    popover: null,

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @method alignTo
     * @param node
     */
    alignTo: function(node) {
        var instance = this,
            popover = instance.getPopover();

        popover.set('align.node', node);
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @method getPopover
     */
    getPopover: function() {
        var instance = this,
            popover = instance.popover;

        if (!popover) {
            popover = new A.Popover(instance.get(POPOVER));
            popover.get(BOUNDING_BOX).on(
                CLICKOUTSIDE, instance._onPopoverClickOutside, instance);

            instance.popover = popover;
        }

        return popover;
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @method hide
     */
    hide: function() {
        var instance = this;

        instance.getPopover().hide();
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @method show
     */
    show: function() {
        var instance = this;

        instance.getPopover().show();
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @method _isActiveInputFocused
     * @protected
     */
    _isActiveInputFocused: function() {
        var instance = this,
            activeInput = instance.get(ACTIVE_INPUT);

        return (activeInput === _DOCUMENT.get(ACTIVE_ELEMENT));
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @method _onPopoverClickOutside
     * @param event
     * @protected
     */
    _onPopoverClickOutside: function(event) {
        var instance = this,
            target = event.target,
            activeInput = instance.get(ACTIVE_INPUT);

        if (!instance._isActiveInputFocused() &&
            !activeInput.contains(target)) {

            instance.hide();
        }
    },

    /**
     * TODO. Wanna help? Please send a Pull Request.
     *
     * @method _setPopover
     * @param val
     * @protected
     */
    _setPopover: function(val) {
        var instance = this;

        return A.merge({
            bodyContent: '',
            cssClass: instance.get(POPOVER_CSS_CLASS),
            constrain: true,
            hideOn: [
                {
                    node: _DOCUMENT,
                    eventName: KEY,
                    keyCode: ESC
                }
            ],
            position: BOTTOM,
            render: true,
            triggerShowEvent: CLICK,
            triggerToggleEvent: null,
            visible: false
        }, val);
    }
}, true);

A.DatePickerPopover = DatePickerPopover;<|endoftext|>


<commit_before>'use strict';

var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist',
        build: 'build',
        pkg: grunt.file.readJSON('package.json')
    };

    try {
        yeomanConfig.app = require('./component.json').appPath || yeomanConfig.app;
    } catch (e) {}

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass']
            },
            livereload: {
                files: [
                    '<%= yeoman.app %>/{,*/}*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.app)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.build %>/<%= yeoman.build %>.zip',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.app %>/scripts/{,*/}*.js'
            ]
        },
        karma: {
            unit: {
                options: {
                    configFile: 'karma.conf.js',
                    singleRun: true
                }
            },
            cloudunit: {
                options: {
                    configFile: 'karma-c9.conf.js',
                    singleRun: true
                }
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles/scss',
                cssDir: '<%= yeoman.app %>/styles',
                imagesDir: '<%= yeoman.app %>/images',
                javascriptsDir: '<%= yeoman.app %>/scripts',
                fontsDir: '<%= yeoman.app %>/styles/fonts',
                importPath: '<%= yeoman.app %>/components',
                relativeAssets: true,
                require: 'zurb-foundation'
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        concat: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/scripts/scripts.js': [
                        '.tmp/scripts/{,*/}*.js',
                        '<%= yeoman.app %>/scripts/{,*/}*.js'
                    ]
                }
            }
        },
        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },
        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/zarautz.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.app %>/styles/{,*/}*.css'
                    ]
                }
            }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: ['*.html', 'views/*.html'],
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        cdnify: {
            dist: {
                html: ['<%= yeoman.dist %>/*.html']
            }
        },
        ngmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.dist %>/scripts',
                    src: '*.js',
                    dest: '<%= yeoman.dist %>/scripts'
                }]
            }
        },
        uglify: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/scripts/scripts.js': [
                        '<%= yeoman.dist %>/scripts/scripts.js'
                    ]
                }
            }
        },
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
                        '<%= yeoman.dist %>/styles/fonts/*'
                    ]
                }
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,txt}',
                        'config.xml',
                        '.htaccess',
                        '!components/**/*',
                        'images/{,*/}*.{gif,webp}',
                        'styles/fonts/*'
                    ]
                }]
            }
        },
        compress: {
            dist: {
                options: {
                    archive: '<%= yeoman.build %>/<%= yeoman.build %>.zip',
                    mode: 'zip'
                },
                files: [
                    // http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
                    {
                        expand: true,
                        cwd: '<%= yeoman.dist %>',
                        src: '**',
                        isFile: true
                    }
                ]
            }
        },
        'phonegap-build': {
            dist: {
                options: {
                    archive: "<%= yeoman.build %>/<%= yeoman.build %>.zip",
                    appId: "448397",
                    timeout: 300000, // 5 minutes
                    user: {
                        email: "team@illarra.com"
                    }
                }
            },
            download: {
                options: {
                    appId: "448397",
                    timeout: 300000, // 5 minutes
                    user: {
                        email: "team@illarra.com"
                    },
                    download: {
                        //winphone: '<%= yeoman.build %>/winphone.xap',
                        //symbian: '<%= yeoman.build %>/symbian.wgz',
                        //blackberry: '<%= yeoman.build %>/blackberry.cod',
                        //webos: '<%= yeoman.build %>/webos.ipk',
                        ios: '<%= yeoman.build %>/ios.ipa',
                        android: '<%= yeoman.build %>/android.apk'
                    }
                }
            }
        }
        /*
        exec: {
            phonegap: {
                cmd: "curl -u illarra.bros@gmail.com -X PUT -F file=@./build.zip https://build.phonegap.com/api/v1/apps/448397"
            }
        },*/
    });

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', [
        'clean:server',
        'compass:server',
        'livereload-start',
        'connect:livereload',
        'open',
        'watch'
    ]);

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

    grunt.registerTask('c9test', [
        'clean:server',
        'karma:cloudunit'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        // Test Code
        'jshint',
        'test',
        // Prepare assets
        'assets',
        'compress'
    ]);

    grunt.registerTask('c9build', [
        'clean:dist',
        // Test Code
        'jshint',
        'c9test',
        // Prepare assets
        'assets'
    ]);

    grunt.registerTask('assets', [
        'compass:dist',
        'useminPrepare',
        'concat',
        'imagemin',
        'cssmin',
        'htmlmin',
        'copy',
        //'cdnify',
        'ngmin',
        'uglify',
        'rev',
        'usemin'
    ]);

    grunt.registerTask('upload', [
        'build',
        'phonegap-build'
    ]);

    grunt.registerTask('download', [
        'phonegap-build:download'
    ]);

    grunt.registerTask('default', ['build']);
};
<commit_msg>Builda hobetuta, downloadek oaindikan eztik egiten<commit_after>'use strict';

var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist',
        build: 'build',
        pkg: grunt.file.readJSON('package.json')
    };

    try {
        yeomanConfig.app = require('./component.json').appPath || yeomanConfig.app;
    } catch (e) {}

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass']
            },
            livereload: {
                files: [
                    '<%= yeoman.app %>/{,*/}*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.app)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.build %>/<%= yeoman.build %>.zip',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.app %>/scripts/{,*/}*.js'
            ]
        },
        karma: {
            unit: {
                options: {
                    configFile: 'karma.conf.js',
                    singleRun: true
                }
            },
            cloudunit: {
                options: {
                    configFile: 'karma-c9.conf.js',
                    singleRun: true
                }
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles/scss',
                cssDir: '<%= yeoman.app %>/styles',
                imagesDir: '<%= yeoman.app %>/images',
                javascriptsDir: '<%= yeoman.app %>/scripts',
                fontsDir: '<%= yeoman.app %>/styles/fonts',
                importPath: '<%= yeoman.app %>/components',
                relativeAssets: true,
                require: 'zurb-foundation'
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        concat: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/scripts/scripts.js': [
                        '.tmp/scripts/{,*/}*.js',
                        '<%= yeoman.app %>/scripts/{,*/}*.js'
                    ]
                }
            }
        },
        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },
        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/zarautz.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.app %>/styles/{,*/}*.css'
                    ]
                }
            }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: ['*.html', 'views/*.html'],
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        cdnify: {
            dist: {
                html: ['<%= yeoman.dist %>/*.html']
            }
        },
        ngmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.dist %>/scripts',
                    src: '*.js',
                    dest: '<%= yeoman.dist %>/scripts'
                }]
            }
        },
        uglify: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/scripts/scripts.js': [
                        '<%= yeoman.dist %>/scripts/scripts.js'
                    ]
                }
            }
        },
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
                        '<%= yeoman.dist %>/styles/fonts/*'
                    ]
                }
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,txt}',
                        'config.xml',
                        '.htaccess',
                        '!components/**/*',
                        'images/{,*/}*.{gif,webp}',
                        'styles/fonts/*'
                    ]
                }]
            }
        },
        compress: {
            dist: {
                options: {
                    archive: '<%= yeoman.build %>/<%= yeoman.build %>.zip',
                    mode: 'zip'
                },
                files: [
                    // http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
                    {
                        expand: true,
                        cwd: '<%= yeoman.dist %>',
                        src: '**',
                        isFile: true
                    }
                ]
            }
        },
        'phonegap-build': {
            upload: {
                options: {
                    archive: "<%= yeoman.build %>/<%= yeoman.build %>.zip",
                    appId: "448397",
                    timeout: 300000, // 5 minutes
                    user: {
                        email: "team@illarra.com"
                    }
                }
            },
            download: {
                options: {
                    appId: "448397",
                    timeout: 300000, // 5 minutes
                    user: {
                        email: "team@illarra.com"
                    },
                    download: {
                        //winphone: '<%= yeoman.build %>/winphone.xap',
                        //symbian: '<%= yeoman.build %>/symbian.wgz',
                        //blackberry: '<%= yeoman.build %>/blackberry.cod',
                        //webos: '<%= yeoman.build %>/webos.ipk',
                        ios: '<%= yeoman.build %>/ios.ipa',
                        android: '<%= yeoman.build %>/android.apk'
                    }
                }
            }
        }
        /*
        exec: {
            phonegap: {
                cmd: "curl -u illarra.bros@gmail.com -X PUT -F file=@./build.zip https://build.phonegap.com/api/v1/apps/448397"
            }
        },*/
    });

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', [
        'clean:server',
        'compass:server',
        'livereload-start',
        'connect:livereload',
        'open',
        'watch'
    ]);

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

    grunt.registerTask('c9test', [
        'clean:server',
        'karma:cloudunit'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        // Test Code
        'jshint',
        'test',
        // Prepare assets
        'assets',
        'compress'
    ]);

    grunt.registerTask('c9build', [
        'clean:dist',
        // Test Code
        'jshint',
        'c9test',
        // Prepare assets
        'assets'
    ]);

    grunt.registerTask('assets', [
        'compass:dist',
        'useminPrepare',
        'concat',
        'imagemin',
        'cssmin',
        'htmlmin',
        'copy',
        //'cdnify',
        'ngmin',
        'uglify',
        'rev',
        'usemin'
    ]);

    grunt.registerTask('upload', [
        'build',
        'phonegap-build:upload'
    ]);

    grunt.registerTask('download', [
        'phonegap-build:download'
    ]);

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


<commit_before><commit_msg>Forgot to save gruntfile. :/<commit_after>module.exports = function(grunt) {

    grunt.loadNpmTasks('grunt-screeps');

    grunt.initConfig({
        pkg: grunt.file.readJSON('config/screeps-creds.json'),
        screeps: {
            options: {
                email: '<%= pkg.email %>',
                password: '<%= pkg.password %>',
                branch: grunt.option('branch') || 'default',
                ptr: false
            },
            dist: {
                src: ['src/*.js']
            }
        }
    });
}<|endoftext|>


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

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      all: [
        'Gruntfile.js',
        'app.js',
        'lib/**/*.js',
        'routes/*.js',
        'test/*.js',
        'public/js/three-script.js'
      ]
    },
    stylus: {
      compile : {
        files : {
          'public/css/style.css' : 'public/css/*.styl'
        }
      }
    }
  });

  // Load the plugins.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-stylus');

  // Default task(s).
  grunt.registerTask('default', ['jshint', 'stylus']);
};<commit_msg>Add db.js to jshint task<commit_after>module.exports = function(grunt) {
  'use strict';

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      all: [
        'Gruntfile.js',
        'app.js',
        'db.js',
        'lib/**/*.js',
        'routes/*.js',
        'test/*.js',
        'public/js/three-script.js'
      ]
    },
    stylus: {
      compile : {
        files : {
          'public/css/style.css' : 'public/css/*.styl'
        }
      }
    }
  });

  // Load the plugins.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-stylus');

  // Default task(s).
  grunt.registerTask('default', ['jshint', 'stylus']);
};<|endoftext|>


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

    var fs = require("fs");
    var shell = require("shelljs");
    var path = require("path");

    function expanduser(p) {
        return p.replace(/~/g, process.env.HOME);
    }

    var p = grunt.file.readJSON('package.json').options, opts = {};
    Object.keys(p).forEach(function(k) { opts[k] = expanduser(p[k]) });

    function opt(name) {
        return opts[name];
    }

    function isNewer(src, dest) {
        var sStat, dStat;

        sStat = fs.statSync(src); // must exist!
        try {
            dStat = fs.statSync(dest);
        } catch(e) {
            if(e.code == "ENOENT") {
                grunt.log.writeln("%s does not exist", dest);
                return true;
            }
        }

        if(sStat.mtime >= dStat.mtime) {
            grunt.log.writeln("%s is newer than %s", src, dest);
            return true;
        }

        //grunt.log.writeln("%s is older than %s", src, dest);
        return false;
    }

    function $f(str, args) {
        return str.replace(/{(\d+)}/g, function(_, $1) {
            return args[$1];
        }).replace(/{#(\w+)}/g, function(_, $1) {
            return opt($1);
        });
    }

    function $$(cmd) {
        cmd = $f(cmd, [].slice.call(arguments, 1));
        grunt.log.writeln("\n> " + cmd);
        var rc = shell.exec(cmd).code;
        if(rc != 0) {
            throw grunt.util.error("Command failed, rc=" + rc);
        }
    }

    grunt.initConfig({
        options: opts,

        buildOSX: {
            app: $f("{#BUILD_DIR}/osx64/{#APPNAME}.app")
        },

        buildWin: {
            app: $f("{#BUILD_DIR}/win32/{#APPNAME}/{#APPNAME}.exe")
        },

        dictMorph: {
            compiler: $f("./compile_dicts.js"),
            src: $f("{#MORPH_PATH}"),
            dest: [
                $f("{#BUILD_DIR}/data/morph.dat"),
                $f("{#BUILD_DIR}/data/morph.idx"),
                $f("{#BUILD_DIR}/data/forms.dat"),
                $f("{#BUILD_DIR}/data/forms.idx")
            ]
        },

        dictML: {
            compiler: $f("./compile_dicts.js"),
            src: $f("{#ML_PATH}"),
            dest: [
                $f("{#BUILD_DIR}/data/ml.dat"),
                $f("{#BUILD_DIR}/data/ml.idx")
            ]
        }
    });

    grunt.registerTask("build", [
        "initBuild",
        "compileDicts",
        "makeApp",
        "buildOSX",
        "buildWin"
    ]);

    grunt.registerTask("initBuild", "", function() {
        $$("mkdir -p {#BUILD_DIR}/data");
        $$("exiftool -all= -overwrite_original -r ..");
    });

    grunt.registerTask("makeApp", "", function() {
        $$("rm -f {#BUILD_DIR}/app.nw");
        $$('cd ./app && zip -r {#BUILD_DIR}/app.nw * -x "*/.*"');
        $$('cd {#BUILD_DIR} && zip -r {#BUILD_DIR}/app.nw data/* -x "*/.*"');
        $$("zip -j {#BUILD_DIR}/app.nw {#FONT_PATH}");
        $$("echo \"VERSION='{#VERSION}'\" | tee {#BUILD_DIR}/version.js");
        $$("zip -j {#BUILD_DIR}/app.nw {#BUILD_DIR}/version.js");
        $$("zip -j {#BUILD_DIR}/app.nw ./icons.iconset/icon_128x128.png");
        $$("zip -j {#BUILD_DIR}/app.nw ./node_modules/jquery/dist/jquery.js");
    });

    grunt.registerTask("compileDicts", "", function() {
        grunt.task.requires("initBuild");

        ["Morph", "ML"].forEach(function(dict) {
            var conf = grunt.config.get("dict" + dict);
            if(conf.dest.every(function(d) { return !isNewer(conf.compiler, d)})) {
                grunt.log.writeln("%s: nothing to do", dict);
                return;
            }
            var dir = path.dirname(conf.dest[0]);
            grunt.log.writeln("compile %s: %s => %s", dict, conf.src, dir);
            require(conf.compiler).compile(dict, conf.src, dir);
        });
    });

    grunt.registerTask("buildOSX", "", function() {

        function patchPlist(plist, appName) {
            grunt.log.writeln("patching plist");
            var s = fs.readFileSync(plist, "ascii");
            s = s.replace(/(<key>(?:CFBundleDisplayName|CFBundleName)<\/key>\s*<string>).+?(<\/string>)/g, "$1" + appName + "$2");
            fs.writeFileSync(plist, s, "ascii");
        }

        var app = grunt.config.get(this.name).app;
        var dir = path.dirname(app);

        var nwpath = $f("{#NW_PATH}/node-webkit-v{#NW_VERSION}-osx-x64");

        $$("mkdir -p {0}", dir);

        if(!fs.existsSync(app)) {
            $$("cp -r {0}/node-webkit.app {1}/", nwpath, app);
        }

        $$("rm -f {0}/Contents/Resources/*", app);
        $$("cp {#BUILD_DIR}/app.nw {0}/Contents/Resources", app);

        patchPlist(app + "/Contents/Info.plist", opt("APPNAME"));
        $$("iconutil --convert icns --output {0}/Contents/Resources/nw.icns ./icons.iconset", app);
    });

    grunt.registerTask("buildWin", "", function() {

        var app = grunt.config.get(this.name).app;
        var dir = path.dirname(app);

        var nwpath = $f("{#NW_PATH}/node-webkit-v{#NW_VERSION}-win-ia32");

        $$("mkdir -p {0}", dir);

        if(!fs.existsSync(dir + "/locales")) {
            $$("mkdir -p {0}/locales", dir);
            $$("cp {0}/nw.pak {1}",  nwpath, dir);
            $$("cp {0}/icudtl.* {1}", nwpath, dir);
            $$("cp {0}/locales/en-US.pak {1}/locales", nwpath, dir);
        }
        shell.cat(nwpath + "/nw.exe", opt("BUILD_DIR") + "/app.nw").to(app);
    });

    grunt.registerTask("dist", "", function() {
        $$("mkdir -p {#BUILD_DIR}/dist");
        $$('cd {#BUILD_DIR}/osx64 && rm -f {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-osx.zip && zip -r {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-osx.zip -r {#APPNAME}.app -x "*/.*" ');
        $$('cd {#BUILD_DIR}/win32 && rm -f {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-win.zip && zip -r {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-win.zip    {#APPNAME}/*   -x "*/.*" ');
    });

    grunt.registerTask("clean", "", function() {
        $$("rm -rf {#BUILD_DIR}");
    });

};
<commit_msg>Fix windows build<commit_after>module.exports = function(grunt) {

    var fs = require("fs");
    var shell = require("shelljs");
    var path = require("path");

    function expanduser(p) {
        return p.replace(/~/g, process.env.HOME);
    }

    var p = grunt.file.readJSON('package.json').options, opts = {};
    Object.keys(p).forEach(function(k) { opts[k] = expanduser(p[k]) });

    function $f(str, args) {
        return str.replace(/{(\d+)}/g, function(_, $1) {
            return args[$1];
        }).replace(/{#(\w+)}/g, function(_, $1) {
                return opt($1);
            });
    }

    opts['APP_NW'] = $f("{#BUILD_DIR}/app.nw");

    function opt(name) {
        return opts[name];
    }

    function isNewer(src, dest) {
        var sStat, dStat;

        sStat = fs.statSync(src); // must exist!
        try {
            dStat = fs.statSync(dest);
        } catch(e) {
            if(e.code == "ENOENT") {
                grunt.log.writeln("%s does not exist", dest);
                return true;
            }
        }

        if(sStat.mtime >= dStat.mtime) {
            grunt.log.writeln("%s is newer than %s", src, dest);
            return true;
        }

        //grunt.log.writeln("%s is older than %s", src, dest);
        return false;
    }

    function $$(cmd) {
        cmd = $f(cmd, [].slice.call(arguments, 1));
        grunt.log.writeln("\n> " + cmd);
        var rc = shell.exec(cmd).code;
        if(rc != 0) {
            throw grunt.util.error("Command failed, rc=" + rc);
        }
    }

    grunt.initConfig({
        options: opts,

        buildOSX: {
            app: $f("{#BUILD_DIR}/osx64/{#APPNAME}.app")
        },

        buildWin: {
            app: $f("{#BUILD_DIR}/win32/{#APPNAME}/{#APPNAME}.exe")
        },

        dictMorph: {
            compiler: $f("./compile_dicts.js"),
            src: $f("{#MORPH_PATH}"),
            dest: [
                $f("{#BUILD_DIR}/data/morph.dat"),
                $f("{#BUILD_DIR}/data/morph.idx"),
                $f("{#BUILD_DIR}/data/forms.dat"),
                $f("{#BUILD_DIR}/data/forms.idx")
            ]
        },

        dictML: {
            compiler: $f("./compile_dicts.js"),
            src: $f("{#ML_PATH}"),
            dest: [
                $f("{#BUILD_DIR}/data/ml.dat"),
                $f("{#BUILD_DIR}/data/ml.idx")
            ]
        }
    });

    grunt.registerTask("build", [
        "initBuild",
        "compileDicts",
        "makeApp",
        "buildOSX",
        "buildWin"
    ]);

    grunt.registerTask("initBuild", "", function() {
        $$("mkdir -p {#BUILD_DIR}/data");
        $$("exiftool -all= -overwrite_original -r ..");
    });

    grunt.registerTask("makeApp", "", function() {
        $$("rm -f {#APP_NW}");
        $$('cd ./app && zip -r {#APP_NW} * -x "*/.*"');
        $$('cd {#BUILD_DIR} && zip -r {#APP_NW} data/* -x "*/.*"');
        $$("zip -j {#APP_NW} {#FONT_PATH}");
        $$("echo \"VERSION='{#VERSION}'\" | tee {#BUILD_DIR}/version.js");
        $$("zip -j {#APP_NW} {#BUILD_DIR}/version.js");
        $$("zip -j {#APP_NW} ./icons.iconset/icon_128x128.png");
        $$("zip -j {#APP_NW} ./node_modules/jquery/dist/jquery.js");
    });

    grunt.registerTask("compileDicts", "", function() {
        grunt.task.requires("initBuild");

        ["Morph", "ML"].forEach(function(dict) {
            var conf = grunt.config.get("dict" + dict);
            if(conf.dest.every(function(d) { return !isNewer(conf.compiler, d)})) {
                grunt.log.writeln("%s: nothing to do", dict);
                return;
            }
            var dir = path.dirname(conf.dest[0]);
            grunt.log.writeln("compile %s: %s => %s", dict, conf.src, dir);
            require(conf.compiler).compile(dict, conf.src, dir);
        });
    });

    grunt.registerTask("buildOSX", "", function() {

        function patchPlist(plist, appName) {
            grunt.log.writeln("patching plist");
            var s = fs.readFileSync(plist, "ascii");
            s = s.replace(/(<key>(?:CFBundleDisplayName|CFBundleName)<\/key>\s*<string>).+?(<\/string>)/g, "$1" + appName + "$2");
            fs.writeFileSync(plist, s, "ascii");
        }

        var app = grunt.config.get(this.name).app;
        var dir = path.dirname(app);

        var nwpath = $f("{#NW_PATH}/node-webkit-v{#NW_VERSION}-osx-x64");

        $$("mkdir -p {0}", dir);

        if(!fs.existsSync(app)) {
            $$("cp -r {0}/node-webkit.app {1}/", nwpath, app);
        }

        $$("rm -f {0}/Contents/Resources/*", app);
        $$("cp {#APP_NW} {0}/Contents/Resources", app);

        patchPlist(app + "/Contents/Info.plist", opt("APPNAME"));
        $$("iconutil --convert icns --output {0}/Contents/Resources/nw.icns ./icons.iconset", app);
    });

    grunt.registerTask("buildWin", "", function() {

        var app = grunt.config.get(this.name).app;
        var dir = path.dirname(app);

        var nwpath = $f("{#NW_PATH}/node-webkit-v{#NW_VERSION}-win-ia32");

        $$("mkdir -p {0}", dir);

        if(!fs.existsSync(dir + "/locales")) {
            $$("mkdir -p {0}/locales", dir);
            $$("cp {0}/nw.pak {1}",  nwpath, dir);
            $$("cp {0}/icudtl.* {1}", nwpath, dir);
            $$("cp {0}/locales/en-US.pak {1}/locales", nwpath, dir);
        }

        $$("cp {0}/nw.exe {1}", nwpath, app);
        fs.appendFileSync(app, fs.readFileSync($f("{#APP_NW}")));
    });

    grunt.registerTask("dist", "", function() {
        $$("mkdir -p {#BUILD_DIR}/dist");
        $$('cd {#BUILD_DIR}/osx64 && rm -f {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-osx.zip && zip -r {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-osx.zip -r {#APPNAME}.app -x "*/.*" ');
        $$('cd {#BUILD_DIR}/win32 && rm -f {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-win.zip && zip -r {#BUILD_DIR}/dist/{#APPNAME}-{#VERSION}-win.zip    {#APPNAME}/*   -x "*/.*" ');
    });

    grunt.registerTask("clean", "", function() {
        $$("rm -rf {#BUILD_DIR}");
    });

};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
    "use strict";
    var pkg, config;

    pkg = grunt.file.readJSON('package.json');

    config = {
        banner: [
            '/**\n',
            ' * <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n',
            ' * <%= pkg.description %>\n',
            ' *\n',
            ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n',
            ' * Licensed <%= pkg.license %>\n',
            ' */\n'
        ].join(''),

        sources: [
            'src/geotiff.js',
        ],
        pkg: pkg,
        uglifyFiles: {},
        browserifyFiles: {}
    };

    // setup dynamic filenames
    config.dist = ['dist/', '.js'].join(config.pkg.name);
    config.browserifyFiles[['dist/', '.js'].join(config.pkg.name)] = ["src/main.js"];
    config.uglifyFiles[['dist/', '.min.js'].join(config.pkg.name)] = config.dist;

    // Project configuration.
    grunt.initConfig({
        pkg: config.pkg,
        lint: {
            files: ['gruntfile.js', 'test/*.js', 'src/*']
        },
        clean: {
            dist: ['dist/']
        },
        concat: {
            options: {
                stripBanners: true,
                banner: config.banner
            },
            dist: {
                src: config.sources,
                dest: config.dist
            }
        },
        uglify: {
            options: { mangle: true },
            dist: {
                files: config.uglifyFiles
            }
        },
        jasmine : {
            tests : {
                src : ['dist/', '.js'].join(config.pkg.name),
                options : {
                    specs : 'test/*.spec.js',
                    //template : 'test/grunt.tmpl'
                }
            }
        },
        jshint: {
            options: {
                jshintrc: 'jshint.json'
            },
            all: ["src/*.js"]
        },
        connect: {
            livereload: true,
            options: {
                port: 9000,
                livereload: 35729,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
        },
        watch: {
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                tasks: ['jshint', 'browserify', 'mocha'],
                files: [
                    'test/*.html',
                    'src/*.js',
                    'test/*.spec.js'
                ]
            },

        },
        browserify: {
            dist: {
                files: config.browserifyFiles
            },
        },
        bump: {
            options: {
                pushTo: 'origin'
            }
        },

        karma: {
            all: {
                configFile: 'karma.conf.js'
            }
        },
        jsdoc: {
            dist: {
                src: ['src/*.js', 'test/*.js'],
                options: {
                    destination: 'docs'
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-jsdoc');

    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-bump');

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

    grunt.registerTask('serve', ['jshint', 'browserify', 'connect:livereload', 'watch']);

    grunt.registerTask('test', ['jshint', 'karma']);
};
<commit_msg>Removing unused mocha call in gruntfile.<commit_after>'use strict';

module.exports = function(grunt) {
    "use strict";
    var pkg, config;

    pkg = grunt.file.readJSON('package.json');

    config = {
        banner: [
            '/**\n',
            ' * <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n',
            ' * <%= pkg.description %>\n',
            ' *\n',
            ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n',
            ' * Licensed <%= pkg.license %>\n',
            ' */\n'
        ].join(''),

        sources: [
            'src/geotiff.js',
        ],
        pkg: pkg,
        uglifyFiles: {},
        browserifyFiles: {}
    };

    // setup dynamic filenames
    config.dist = ['dist/', '.js'].join(config.pkg.name);
    config.browserifyFiles[['dist/', '.js'].join(config.pkg.name)] = ["src/main.js"];
    config.uglifyFiles[['dist/', '.min.js'].join(config.pkg.name)] = config.dist;

    // Project configuration.
    grunt.initConfig({
        pkg: config.pkg,
        lint: {
            files: ['gruntfile.js', 'test/*.js', 'src/*']
        },
        clean: {
            dist: ['dist/']
        },
        concat: {
            options: {
                stripBanners: true,
                banner: config.banner
            },
            dist: {
                src: config.sources,
                dest: config.dist
            }
        },
        uglify: {
            options: { mangle: true },
            dist: {
                files: config.uglifyFiles
            }
        },
        jasmine : {
            tests : {
                src : ['dist/', '.js'].join(config.pkg.name),
                options : {
                    specs : 'test/*.spec.js',
                    //template : 'test/grunt.tmpl'
                }
            }
        },
        jshint: {
            options: {
                jshintrc: 'jshint.json'
            },
            all: ["src/*.js"]
        },
        connect: {
            livereload: true,
            options: {
                port: 9000,
                livereload: 35729,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
        },
        watch: {
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                tasks: ['jshint', 'browserify'],
                files: [
                    'test/*.html',
                    'src/*.js',
                    'test/*.spec.js'
                ]
            },

        },
        browserify: {
            dist: {
                files: config.browserifyFiles
            },
        },
        bump: {
            options: {
                pushTo: 'origin'
            }
        },

        karma: {
            all: {
                configFile: 'karma.conf.js'
            }
        },
        jsdoc: {
            dist: {
                src: ['src/*.js', 'test/*.js'],
                options: {
                    destination: 'docs'
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-jsdoc');

    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-bump');

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

    grunt.registerTask('serve', ['jshint', 'browserify', 'connect:livereload', 'watch']);

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


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

	// Option functionality not yet added for karma file patterns
	function karmaGenerateLoadedFiles (sources) {
	 	function karmaPatternize (src, options) {
			return	{	pattern: src,
						watched: true,
						included: true,
						served: true, };
		}
		var files = Array.prototype.map.call(sources, function (value) { return karmaPatternize(value); });
		files.push(karmaPatternize("spec/unit/**/*.js"));
		return files;
	}

	// Sources are loaded each time this grunt task is started
	// If deps.src is empty another pattern should be generated
	var deps = grunt.file.readJSON('package.json');

	// var depsPrefixed = deps.dirs.src.map(prefixWith('src/'));
	var karmaFiles = karmaGenerateLoadedFiles(deps.dirs.src);

	var conf = {
		// Get filepaths from package.json file. The files are set up in the setup task.
		watch: {
			files: ["src/**/*.js"],
			tasks: ["jshint:sources", "karma:unit"],
			options: {
				debounceDelay: 1000
			}
		},
		jshint: {
			options: {
				sub: false
			},
			sources: ["src/**/*.js"],
			build: ["build/**/*.js"]
		},
		clean: {
			reports: ["reports/**"],
			build: ["build/js/**"]
		},

		compile: {
			options: {
				compilation_level: 'ADVANCED_OPTIMIZATIONS',
				language_in: 'ECMASCRIPT5_STRICT',
				warning_level: 'VERBOSE',
		        formatting: 'PRETTY_PRINT',
		       	debug: true,
				externs: 'externs/'
			},
			comp : {
							// Destination : Source
				files: {'build/gcc_src.js' : 'src/**/*.js'}
			}
		},

		jsdoc : {
			makedoc : {
				src: ['src/**/*.js'],
				options: {
					destination: 'reports/jsdoc'
				}
			}
		},

        shell: {
        	test: {
        		options: {
        			stdout: true
        		},
        		command: 'echo test'
        	}
        },
		// Karma is always used for unit tests
		karma: {
			unit: {
				configFile: 'karma.conf.js',
				singleRun: true,
				files: karmaFiles,
			},
			report: {
				reporters: ['progress', 'coverage'],
				configFile: 'karma.conf.js',
				singleRun: true,
				preprocessors: {
					'src/**/*.js': ['coverage']
				},
				coverageReporter: {
					type : 'html',
					dir : 'reports/'
				},
				files: karmaFiles,
			}
		},
		exec: {
			casp: {
				command: 'casperjs',
				stdout: false,
				stderr: false
			}
		},
		express: {
			build: {
				options: {
					port: 9876,
					bases: 'build/',
			        server: 'build.js'
				}
			},
			create: {
				options: {
					port: 6789,
					bases: 'create/',
			        server: 'create.js'
				}
			}
		},

		casperjs: {
			options: {
				async: {
					parallel: false
				}
			},
			files: ['spec/e2e/**/*.js']
		},

	};

	// Project configuration.
	grunt.initConfig(conf);
	grunt.registerTask('build', ['express:build', 'express-keepalive']);
	grunt.registerTask('create', ['express:create', 'express-keepalive']);
	grunt.loadNpmTasks('grunt-express');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-karma');

	grunt.loadNpmTasks('grunt-closurecompiler');

	grunt.loadNpmTasks('grunt-jsdoc');

	grunt.loadNpmTasks('grunt-casperjs');

	grunt.renameTask('closurecompiler', 'compile');

	// grunt.registerTask('e2e', []); // Runs e2e tests on deployed instance
	grunt.registerTask('deploy', ['compile']); // Compiles the app and deploys an html file
	grunt.registerTask('unit', ['jshint:sources', 'karma:unit']); // Runs unit tests on local code
	grunt.registerTask('unitreport', ['jshint:sources', 'karma:report', 'jsdoc']); // Runs unit tests and generates a coverage report, used for jenkins
	grunt.registerTask('default', ['clean', 'jshint:sources', 'deploy']);
	grunt.registerTask('server', ['express', 'express-keepalive']);

};
<commit_msg>this is a message<commit_after>module.exports = function(grunt) {

	// Option functionality not yet added for karma file patterns
	function karmaGenerateLoadedFiles (sources) {
	 	function karmaPatternize (src, options) {
			return	{	pattern: src,
						watched: true,
						included: true,
						served: true, };
		}
		var files = Array.prototype.map.call(sources, function (value) { return karmaPatternize(value); });
		files.push(karmaPatternize("spec/unit/**/*.js"));
		return files;
	}

	// Sources are loaded each time this grunt task is started
	// If deps.src is empty another pattern should be generated
	var deps = grunt.file.readJSON('package.json');

	// var depsPrefixed = deps.dirs.src.map(prefixWith('src/'));
	var karmaFiles = karmaGenerateLoadedFiles(deps.dirs.src);

	var conf = {
		// Get filepaths from package.json file. The files are set up in the setup task.
		watch: {
			files: ["src/**/*.js"],
			tasks: ["jshint:sources", "karma:unit"],
			options: {
				debounceDelay: 1000
			}
		},
		jshint: {
			options: {
				sub: false
			},
			sources: ["src/**/*.js"],
			build: ["build/**/*.js"]
		},
		clean: {
			reports: ["reports/**"],
			build: ["build/js/**"]
		},

		compile: {
			options: {
				compilation_level: 'ADVANCED_OPTIMIZATIONS',
				language_in: 'ECMASCRIPT5_STRICT',
				warning_level: 'VERBOSE',
		        formatting: 'PRETTY_PRINT',
		       	debug: true,
				externs: 'externs/'
			},
			comp : {
							// Destination : Source
				files: {'build/gcc_src.js' : 'src/**/*.js'}
			}
		},

		jsdoc : {
			makedoc : {
				src: ['src/**/*.js'],
				options: {
					destination: 'reports/jsdoc'
				}
			}
		},

        shell: {
        	test: {
        		options: {
        			stdout: true
        		},
        		command: 'echo test'
        	}
        },
		// Karma is always used for unit tests
		karma: {
			unit: {
				configFile: 'karma.conf.js',
				singleRun: true,
				files: karmaFiles,
			},
			report: {
				reporters: ['progress', 'coverage'],
				configFile: 'karma.conf.js',
				singleRun: true,
				preprocessors: {
					'src/**/*.js': ['coverage']
				},
				coverageReporter: {
					type : 'html',
					dir : 'reports/'
				},
				files: karmaFiles,
			}
		},
		exec: {
			casp: {
				command: 'casperjs',
				stdout: false,
				stderr: false
			}
		},
		express: {
			build: {
				options: {
					port: 9876,
					bases: 'build/',
			        server: 'build.js'
				}
			},
			create: {
				options: {
					port: 6789,
					bases: 'create/',
			        server: 'create.js'
				}
			}
		},

		casperjs: {
			options: {
				async: {
					parallel: false
				}
			},
			files: ['spec/e2e/**/*.js']
		},

	};

	// Project configuration.
	grunt.initConfig(conf);
	grunt.loadNpmTasks('grunt-express');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-karma');

	grunt.loadNpmTasks('grunt-closurecompiler');

	grunt.loadNpmTasks('grunt-jsdoc');

	grunt.loadNpmTasks('grunt-casperjs');

	grunt.renameTask('closurecompiler', 'compile');
	// grunt.registerTask('e2e', []); // Runs e2e tests on deployed instance
	grunt.registerTask('build', ['express:build', 'express-keepalive']);
	grunt.registerTask('create', ['express:create', 'express-keepalive']);
	grunt.registerTask('unit', ['karma:unit']); // Runs unit tests on local code
	grunt.registerTask('coverage', ['karma:report']); // Runs unit tests and generates a coverage report, used for jenkins
	grunt.registerTask('server', ['express', 'express-keepalive']);
	grunt.registerTask('default', ['jshint:sources', 'karma:unit']);

};
<|endoftext|>