<commit_before>/*global module:false*/
module.exports = function(grunt) {
  require('time-grunt')(grunt);

  // 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',

    connect: {
      live: {
        options: {
          port: 9001,
          base: 'build/live',
          keepalive: true
        }
      },
      modifiers: {
        options: {
          port: 9002,
          base: 'build/_modifiers',
          keepalive: true
        }
      }
    },

    clean: {
      build: ['build'],
      source: ['.sass-cache', 'src/sass/_all.scss', 'src/sass/partials/_debug.scss', 'src/sass/bem'],
      backup: ['backup']
    },

    copy: {
      html: {
        src: 'src/index.html',
        dest: 'build/live/index.html'
      },
      css: {
        expand: true,
        src: 'src/*.css',
        dest: 'build/live/css/',
        flatten: true,
        filter: 'isFile'
      },
      modifiers_css: {
        expand: true,
        src: 'build/live/css/*.css',
        dest: 'build/_modifiers/css/',
        flatten: true,
        filter: 'isFile'
      },
      backup: {
        cwd: 'src/',
        expand: true,
        src: 'sass/**',
        dest: 'backup/ <%= grunt.template.today("yyyymmddhMM") %>/'
      }
    },

    dom_munger: {
      index: {
        options: {
          append: {selector: 'head', html: '<link rel="stylesheet" href="/css/debug.css">'}
        },
        src: 'build/live/index.html'
      }
    },

    sass: {
      dist: {
        options: {
          style: 'expanded'
        },
        files: [
          {'./build/live/css/index.css': './src/index.scss'},
          {'./build/_modifiers/css/debug.css': './src/sass/custom/debug.scss'}
        ]
      }
    },

    sass_directory_import: {
      index: {
        files: {
          src: ['src/sass/_all.scss']
        }
      }
    },

    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['lib/<%= pkg.name %>.js'],
        dest: 'dist/<%= pkg.name %>.js'
      }
    },

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

    uncss: {
      dist: {
        src: 'build/live/index.html',
        dest: 'build/live/css/index.css',
        options: {
          stylesheets: ['css/index.css'],
          report: 'min'
        }
      }
    },

    watch: {
      html: {
        files: ['src/index.html'],
        tasks: ['html']
      },
      sass: {
        files: ['src/**/**.scss'],
        tasks: ['import-all-sass', 'sass', 'scaffold-modifiers', 'copy:modifiers_css']
      },
      css: {
         files: ['src/**/**.css'],
         tasks: ['copy:css']
      },
      grunt: {
        files: ['Gruntfile.js'],
        tasks: ['dev']
      },
      options: {
        livereload: true
      }
    },

    // prompt: {
    //   clear_sass_scaffold: {
    //     options: {
    //       questions: [{
    //           config: 'blah',
    //           type: 'confirm',
    //           message: 'This will remove your SASS ?',
    //           then: function(){
    //             console.log('then', arguments);
    //           }
    //         }
    //       ]
    //     }
    //   }
    // }

  });

  grunt.registerTask('scaffold-sass', 'Generates folders for all sass files based on BEM classnames in index.html', function() {
    var _ = require("underscore");
    var jsdom = require('jsdom').jsdom;
    var cwd = 'src/';
    var dir = cwd + 'sass/bem'
    var index = cwd + 'index.html';
    var html = grunt.file.read(index);
    var doc = jsdom(html).parentWindow.document;
    var bemClasses = doc.querySelectorAll('body[class^="__"], body *[class^="__"]');
    var classList, BEList = [], beSplit, dirPath, bePath, mPath;

    // collect the BEM classes
    _.each(bemClasses, function(el){
      classList = el.getAttribute('class').split(' ');
       _.each(classList, function(c){
        if(c.indexOf('__') == 0){
          BEM = splitBEM(c);
          BEList.push(BEM.be);
        }
      });
    });

    BEList = _.uniq(BEList);

    var debugSASS = '';

    // generate sass folders
    _.each(BEList, function(be){
      beSplit = be.split('__');
      dirPath = dir + beSplit.join('/__');
      bePath = dirPath + '/' + be + '.scss';
      mPath = dirPath + '/' + be + '_modifiers.scss';

      if(!grunt.file.isDir(dirPath)){
        grunt.file.mkdir(dirPath);
      }

      if(!grunt.file.exists(bePath)){
        grunt.file.write(bePath, '.' + be + '{\n}');
      }

      if(!grunt.file.exists(mPath)){
        grunt.file.write(mPath, '.' + be + '_modifier-name{\n}');
      }

      debugSASS += '.' + be + '{@include debug();}\n';
    });

    // write some debuging css outlines
    grunt.file.write(cwd + 'sass/custom/partials/_debug.scss', debugSASS);

    // clean up sass folders which are not referenced through the HTML bem classes
    // BOB::TODO::20140324, will remove everything.. also custom css work, need to rethink this
    var dirs = grunt.file.expand({cwd: dir}, ['**/*', '!**/*.scss']),
        dirName;

    _.each(dirs, function(path){
      dirName = path.split('/').join('');
      if(!doc.querySelector('.' + dirName)){
        // grunt.task.run('prompt:clear_sass_scaffold');
        grunt.file.delete(dir + '/'+ path);
      }
    });

  });

  // Simplified version of https://www.npmjs.org/package/grunt-sass-directory-import
  grunt.registerTask('import-all-sass', 'Generates a _all.scss file with all sass files imported', function() {
    var dir = 'src/sass/';
    var filepath = dir + '_all.scss';
    var customFiles = grunt.file.expand({cwd: dir}, ['custom/**/*.scss', '!_all.scss', '!partials/_debug.scss']);
    var bemFiles = grunt.file.expand({cwd: dir}, ['bem/**/*.scss']);
    var segments, file, importFile;
    var imports = ['// Auto generated, see grunt "import-all-sass task" '];

    imports = imports.concat(getSASSimports(customFiles));
    imports = imports.concat(getSASSimports(bemFiles));

    grunt.file.write(filepath, imports.join('\n'));
  });

  function getSASSimports(files){
    var _ = require("underscore");
    var imports = [];

    _.each(files, function(path){
      segments = path.split('/');
      file = segments.pop();

      if(file.charAt(0) == '_'){
        file = file.substring(1);
      }

      file = file.replace('.scss', '');
      segments.push(file);
      importFile = segments.join('/');
      imports.push('@import "' + importFile + '";');
    });

    return imports;
  }

  grunt.registerTask('scaffold-modifiers', 'Generate HTML pages for each BEM modifier', function() {
    var _ = require("underscore");
    var CSSOM = require('cssom');
    var CSSFile = grunt.file.read('build/live/css/index.css');
    var CSSTree = CSSOM.parse(CSSFile);
    var dir = 'build/_modifiers/';
    var createPage = false;
    var defaultModifiers = [];
    var tasks = [], bem;

    var currentModifierFiles = grunt.file.expand({cwd: dir}, '*.html');
    _.each(currentModifierFiles, function(file){
      grunt.file.delete(dir + file);
    });

    _.each(CSSTree.cssRules, function(rule){
      var selector = rule.selectorText;
      var suffix = [];
      var beParts;

      if(selector.indexOf('.') == 0){
        selector = selector.substring(1);
      }

      bem = splitBEM(selector);

      beParts = bem.be.split('__').length;

      // Only create pages with a single 'BEM' including a modifier
      createPage = (selector.indexOf(' ') === -1) && (bem.m !== undefined);

      // Create pages for testing, and apply the relevant modifier classes
      if(createPage){
        suffix.push({selector: '.' + bem.be, attribute: 'class', value: ' ' + selector});

        _.each(defaultModifiers, function(sel){
          var defaultBem = splitBEM(sel);
          // Only apply the default if they are concerned with a parent of the current bem
          if(defaultBem.be.split('__').length < beParts){
            suffix.push({selector: '.' + defaultBem.be, attribute: 'class', value: ' ' + sel});
          }

        });

        grunt.config('dom_munger.a' + selector + '.options', {
          append: {selector: 'head', html: '<link rel="stylesheet" href="/css/debug.css">'},
          suffix: suffix
        });
        grunt.config('dom_munger.a' + selector + '.src', 'build/live/index.html');
        grunt.config('dom_munger.a' + selector + '.dest', dir + selector + '.html');
        tasks.push('dom_munger:a' + selector);
      }

    });

    grunt.config('dom_munger.index' + '.options', {
      append: {selector: 'head', html: '<link rel="stylesheet" href="/css/debug.css">'}
    });
    grunt.config('dom_munger.index.src', 'build/live/index.html');
    grunt.config('dom_munger.index.dest', dir + 'index.html');
    tasks.push('dom_munger:index');

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

  function splitBEM(bemClass){
    var BE = bemClass.split('__');
    var M = BE.pop().split('_');
    BE.push(M.shift());
    BE = BE.join('__');
    M = M[0];

    return {be: BE, m: M};
  }

  // https://www.npmjs.org/package/load-grunt-tasks
  require('load-grunt-tasks')(grunt);

  // BOB::TODO::20140422, the default task should re-use the html/css tasks
  // grunt.registerTask('dev', ['clear', 'scaffold-sass']);
  grunt.registerTask('html', ['copy:html', 'scaffold-sass', 'import-all-sass', 'sass', 'scaffold-modifiers']);
  grunt.registerTask('css', ['copy:css', 'sass', 'scaffold-modifiers', 'copy:modifiers_css']);
  grunt.registerTask('reset', ['copy:backup', 'clean']);
  grunt.registerTask('default', ['clean:build', 'copy', 'scaffold-sass', 'import-all-sass', 'sass', 'scaffold-modifiers', 'copy:modifiers_css']);

};
<commit_msg>renamed build/_modifier to build/develop and matched tasks names inside grunt, makes more sense<commit_after>/*global module:false*/
module.exports = function(grunt) {
  require('time-grunt')(grunt);

  // 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',

    connect: {
      live: {
        options: {
          port: 9001,
          base: 'build/live',
          keepalive: true
        }
      },
      develop: {
        options: {
          port: 9002,
          base: 'build/develop',
          keepalive: true
        }
      }
    },

    clean: {
      build: ['build'],
      source: ['.sass-cache', 'src/sass/_all.scss', 'src/sass/partials/_debug.scss', 'src/sass/bem'],
      backup: ['backup']
    },

    copy: {
      html: {
        src: 'src/index.html',
        dest: 'build/live/index.html'
      },
      css: {
        expand: true,
        src: 'src/*.css',
        dest: 'build/live/css/',
        flatten: true,
        filter: 'isFile'
      },
      develop_css: {
        expand: true,
        src: 'build/live/css/*.css',
        dest: 'build/develop/css/',
        flatten: true,
        filter: 'isFile'
      },
      backup: {
        cwd: 'src/',
        expand: true,
        src: 'sass/**',
        dest: 'backup/ <%= grunt.template.today("yyyymmddhMM") %>/'
      }
    },

    dom_munger: {
      index: {
        options: {
          append: {selector: 'head', html: '<link rel="stylesheet" href="/css/debug.css">'}
        },
        src: 'build/live/index.html'
      }
    },

    sass: {
      dist: {
        options: {
          style: 'expanded'
        },
        files: [
          {'./build/live/css/index.css': './src/index.scss'},
          {'./build/develop/css/debug.css': './src/sass/custom/debug.scss'}
        ]
      }
    },

    sass_directory_import: {
      index: {
        files: {
          src: ['src/sass/_all.scss']
        }
      }
    },

    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['lib/<%= pkg.name %>.js'],
        dest: 'dist/<%= pkg.name %>.js'
      }
    },

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

    uncss: {
      dist: {
        src: 'build/live/index.html',
        dest: 'build/live/css/index.css',
        options: {
          stylesheets: ['css/index.css'],
          report: 'min'
        }
      }
    },

    watch: {
      html: {
        files: ['src/index.html'],
        tasks: ['html']
      },
      sass: {
        files: ['src/**/**.scss'],
        tasks: ['import-all-sass', 'sass', 'scaffold-develop', 'copy:develop_css']
      },
      css: {
         files: ['src/**/**.css'],
         tasks: ['copy:css']
      },
      grunt: {
        files: ['Gruntfile.js'],
        tasks: ['dev']
      },
      options: {
        livereload: true
      }
    },

    // prompt: {
    //   clear_sass_scaffold: {
    //     options: {
    //       questions: [{
    //           config: 'blah',
    //           type: 'confirm',
    //           message: 'This will remove your SASS ?',
    //           then: function(){
    //             console.log('then', arguments);
    //           }
    //         }
    //       ]
    //     }
    //   }
    // }

  });

  grunt.registerTask('scaffold-sass', 'Generates folders for all sass files based on BEM classnames in index.html', function() {
    var _ = require("underscore");
    var jsdom = require('jsdom').jsdom;
    var cwd = 'src/';
    var dir = cwd + 'sass/bem'
    var index = cwd + 'index.html';
    var html = grunt.file.read(index);
    var doc = jsdom(html).parentWindow.document;
    var bemClasses = doc.querySelectorAll('body[class^="__"], body *[class^="__"]');
    var classList, BEList = [], beSplit, dirPath, bePath, mPath;

    // collect the BEM classes
    _.each(bemClasses, function(el){
      classList = el.getAttribute('class').split(' ');
       _.each(classList, function(c){
        if(c.indexOf('__') == 0){
          BEM = splitBEM(c);
          BEList.push(BEM.be);
        }
      });
    });

    BEList = _.uniq(BEList);

    var debugSASS = '';

    // generate sass folders
    _.each(BEList, function(be){
      beSplit = be.split('__');
      dirPath = dir + beSplit.join('/__');
      bePath = dirPath + '/' + be + '.scss';
      mPath = dirPath + '/' + be + '_modifiers.scss';

      if(!grunt.file.isDir(dirPath)){
        grunt.file.mkdir(dirPath);
      }

      if(!grunt.file.exists(bePath)){
        grunt.file.write(bePath, '.' + be + '{\n}');
      }

      if(!grunt.file.exists(mPath)){
        grunt.file.write(mPath, '.' + be + '_modifier-name{\n}');
      }

      debugSASS += '.' + be + '{@include debug();}\n';
    });

    // write some debuging css outlines
    grunt.file.write(cwd + 'sass/custom/partials/_debug.scss', debugSASS);

    // clean up sass folders which are not referenced through the HTML bem classes
    // BOB::TODO::20140324, will remove everything.. also custom css work, need to rethink this
    var dirs = grunt.file.expand({cwd: dir}, ['**/*', '!**/*.scss']),
        dirName;

    _.each(dirs, function(path){
      dirName = path.split('/').join('');
      if(!doc.querySelector('.' + dirName)){
        // grunt.task.run('prompt:clear_sass_scaffold');
        grunt.file.delete(dir + '/'+ path);
      }
    });

  });

  // Simplified version of https://www.npmjs.org/package/grunt-sass-directory-import
  grunt.registerTask('import-all-sass', 'Generates a _all.scss file with all sass files imported', function() {
    var dir = 'src/sass/';
    var filepath = dir + '_all.scss';
    var customFiles = grunt.file.expand({cwd: dir}, ['custom/**/*.scss', '!_all.scss', '!partials/_debug.scss']);
    var bemFiles = grunt.file.expand({cwd: dir}, ['bem/**/*.scss']);
    var segments, file, importFile;
    var imports = ['// Auto generated, see grunt "import-all-sass task" '];

    imports = imports.concat(getSASSimports(customFiles));
    imports = imports.concat(getSASSimports(bemFiles));

    grunt.file.write(filepath, imports.join('\n'));
  });

  function getSASSimports(files){
    var _ = require("underscore");
    var imports = [];

    _.each(files, function(path){
      segments = path.split('/');
      file = segments.pop();

      if(file.charAt(0) == '_'){
        file = file.substring(1);
      }

      file = file.replace('.scss', '');
      segments.push(file);
      importFile = segments.join('/');
      imports.push('@import "' + importFile + '";');
    });

    return imports;
  }

  grunt.registerTask('scaffold-develop', 'Generate HTML pages for each BEM modifier', function() {
    var _ = require("underscore");
    var CSSOM = require('cssom');
    var CSSFile = grunt.file.read('build/live/css/index.css');
    var CSSTree = CSSOM.parse(CSSFile);
    var dir = 'build/develop/';
    var createPage = false;
    var defaultModifiers = [];
    var tasks = [], bem;

    var currentModifierFiles = grunt.file.expand({cwd: dir}, '*.html');
    _.each(currentModifierFiles, function(file){
      grunt.file.delete(dir + file);
    });

    _.each(CSSTree.cssRules, function(rule){
      var selector = rule.selectorText;
      var suffix = [];
      var beParts;

      if(selector.indexOf('.') == 0){
        selector = selector.substring(1);
      }

      bem = splitBEM(selector);

      beParts = bem.be.split('__').length;

      // Only create pages with a single 'BEM' including a modifier
      createPage = (selector.indexOf(' ') === -1) && (bem.m !== undefined);

      // Create pages for testing, and apply the relevant modifier classes
      if(createPage){
        suffix.push({selector: '.' + bem.be, attribute: 'class', value: ' ' + selector});

        _.each(defaultModifiers, function(sel){
          var defaultBem = splitBEM(sel);
          // Only apply the default if they are concerned with a parent of the current bem
          if(defaultBem.be.split('__').length < beParts){
            suffix.push({selector: '.' + defaultBem.be, attribute: 'class', value: ' ' + sel});
          }

        });

        grunt.config('dom_munger.a' + selector + '.options', {
          append: {selector: 'head', html: '<link rel="stylesheet" href="/css/debug.css">'},
          suffix: suffix
        });
        grunt.config('dom_munger.a' + selector + '.src', 'build/live/index.html');
        grunt.config('dom_munger.a' + selector + '.dest', dir + selector + '.html');
        tasks.push('dom_munger:a' + selector);
      }

    });

    grunt.config('dom_munger.index' + '.options', {
      append: {selector: 'head', html: '<link rel="stylesheet" href="/css/debug.css">'}
    });
    grunt.config('dom_munger.index.src', 'build/live/index.html');
    grunt.config('dom_munger.index.dest', dir + 'main.html');
    tasks.push('dom_munger:index');

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

  function splitBEM(bemClass){
    var BE = bemClass.split('__');
    var M = BE.pop().split('_');
    BE.push(M.shift());
    BE = BE.join('__');
    M = M[0];

    return {be: BE, m: M};
  }

  // https://www.npmjs.org/package/load-grunt-tasks
  require('load-grunt-tasks')(grunt);

  // BOB::TODO::20140422, the default task should re-use the html/css tasks
  grunt.registerTask('dev', ['clear', 'scaffold-sass']);
  grunt.registerTask('html', ['copy:html', 'scaffold-sass', 'import-all-sass', 'sass', 'scaffold-develop']);
  grunt.registerTask('css', ['copy:css', 'sass', 'scaffold-develop', 'copy:develop_css']);
  grunt.registerTask('reset', ['copy:backup', 'clean']);
  grunt.registerTask('default', ['clean:build', 'copy', 'scaffold-sass', 'import-all-sass', 'sass', 'scaffold-develop', 'copy:develop_css']);

};
<|endoftext|>


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

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        test: '',
        shell: {
            test: {
                command: 'mocha <%= test %> --reporter spec',
                options: {
                    stdout: true
                }
            }
        },
        mongodb : {
            test: {
                host: 'mongodb://localhost:27017/test',
                collections: ['users','contenttypes','nodes','content', 'tokens'],
                data: './fixtures/mongodb/test.js'
            },
            dev : {
                host: 'mongodb://localhost:27017/grasshopper',
                collections: ['users','contenttypes','nodes','content', 'tokens'],
                data: './fixtures/mongodb/dev.js'
            }
        },
        jshint: {
            files: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'],
            options: {
                // options here to override JSHint defaults
                globals: {
                    jQuery: true,
                    console: true,
                    module: true,
                    document: true,
                    require: true
                }
            }
        },
        watch: {
            files: ['<%= jshint.files %>'],
            tasks: ['jshint']
        }
    });

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

    grunt.registerTask('db:dev', ['mongodb:dev']);
    grunt.registerTask('db:test', ['mongodb:test']);

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

};<commit_msg>Changed grunt task to show errors when running tests.<commit_after>module.exports = function(grunt) {
    'use strict';

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        test: '',
        shell: {
            test: {
                command: 'mocha <%= test %> --reporter spec',
                options: {
                    stdout: true,
                    stderr: true
                }
            }
        },
        mongodb : {
            test: {
                host: 'mongodb://localhost:27017/test',
                collections: ['users','contenttypes','nodes','content', 'tokens'],
                data: './fixtures/mongodb/test.js'
            },
            dev : {
                host: 'mongodb://localhost:27017/grasshopper',
                collections: ['users','contenttypes','nodes','content', 'tokens'],
                data: './fixtures/mongodb/dev.js'
            }
        },
        jshint: {
            files: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'],
            options: {
                // options here to override JSHint defaults
                globals: {
                    jQuery: true,
                    console: true,
                    module: true,
                    document: true,
                    require: true
                }
            }
        },
        watch: {
            files: ['<%= jshint.files %>'],
            tasks: ['jshint']
        }
    });

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

    grunt.registerTask('db:dev', ['mongodb:dev']);
    grunt.registerTask('db:test', ['mongodb:test']);

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

};<|endoftext|>


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

  grunt.initConfig({
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      all: [
        'Gruntfile.js',
        '_assets/js/*.js',
        '_assets/js/plugins/*.js',
        '!_assets/js/main.min.js'
      ]
    },
    recess: {
      dist: {
        options: {
          compile: true,
          compress: true
        },
        files: {
          '_assets/css/main.min.css': [
            '_assets/less/main.less'
          ]
        }
      }
    },
    uglify: {
      dist: {
        files: {
          '_assets/js/main.min.js': [
            '_assets/js/plugins/*.js',
            '_assets/js/_*.js'
          ]
        }
      }
    },
<<<<<<< HEAD
    imagemin: {
=======
    imgcompress: {
>>>>>>> hotfix/gruntjs
      dist: {
        options: {
          optimizationLevel: 7,
          progressive: true
        },
        files: [{
          expand: true,
          cwd: 'images/',
          src: '{,*/}*.{png,jpg,jpeg}',
          dest: 'images/'
        }]
      }
    },
    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: 'images/',
          src: '{,*/}*.svg',
          dest: 'images/'
        }]
      }
    },
    watch: {
      less: {
        files: [
          '_assets/less/*.less'
        ],
        tasks: ['recess']
      },
      js: {
        files: [
          '<%= jshint.all %>'
        ],
        tasks: ['uglify']
      }
    },
    clean: {
      dist: [
        '_assets/css/main.min.css',
        '_assets/js/main.min.js'
      ]
    }
  });

  // Load tasks
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-recess');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-svgmin');
  grunt.loadNpmTasks('grunt-imgcompress');

  // Register tasks
  grunt.registerTask('default', [
    'clean',
    'recess',
    'uglify',
    'imgcompress',
    'svgmin'
  ]);
  grunt.registerTask('dev', [
    'watch'
  ]);

};<commit_msg>Fix conflict<commit_after>'use strict';
module.exports = function(grunt) {

  grunt.initConfig({
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      all: [
        'Gruntfile.js',
        '_assets/js/*.js',
        '_assets/js/plugins/*.js',
        '!_assets/js/main.min.js'
      ]
    },
    recess: {
      dist: {
        options: {
          compile: true,
          compress: true
        },
        files: {
          '_assets/css/main.min.css': [
            '_assets/less/main.less'
          ]
        }
      }
    },
    uglify: {
      dist: {
        files: {
          '_assets/js/main.min.js': [
            '_assets/js/plugins/*.js',
            '_assets/js/_*.js'
          ]
        }
      }
    },
    imgcompress: {
      dist: {
        options: {
          optimizationLevel: 7,
          progressive: true
        },
        files: [{
          expand: true,
          cwd: 'images/',
          src: '{,*/}*.{png,jpg,jpeg}',
          dest: 'images/'
        }]
      }
    },
    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: 'images/',
          src: '{,*/}*.svg',
          dest: 'images/'
        }]
      }
    },
    watch: {
      less: {
        files: [
          '_assets/less/*.less'
        ],
        tasks: ['recess']
      },
      js: {
        files: [
          '<%= jshint.all %>'
        ],
        tasks: ['uglify']
      }
    },
    clean: {
      dist: [
        '_assets/css/main.min.css',
        '_assets/js/main.min.js'
      ]
    }
  });

  // Load tasks
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-recess');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-svgmin');
  grunt.loadNpmTasks('grunt-imgcompress');

  // Register tasks
  grunt.registerTask('default', [
    'clean',
    'recess',
    'uglify',
    'imgcompress',
    'svgmin'
  ]);
  grunt.registerTask('dev', [
    'watch'
  ]);

};<|endoftext|>


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

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.readJSON('aws-credentials.json'),

    aws_s3: {
      options: {
        accessKeyId: '<%= aws.AWSAccessKeyId %>', // Use the variables
        secretAccessKey: '<%= aws.AWSSecretKey %>', // You can also use env variables
        region: 'ap-southeast-2',
        uploadConcurrency: 5, // 5 simultaneous uploads
        downloadConcurrency: 5 // 5 simultaneous downloads
      },
      production: {
        options: {
          bucket: 'www.growth.ren',
          params: {
            CacheControl: 'max-age=604800'
          }
        },
        files: [
          {expand: true, cwd: 'www/css/', src: ['**'], dest: 'css/', action: 'upload'},
          {expand: true, cwd: 'www/img/', src: ['**'], dest: 'img/', action: 'upload'},
          {expand: true, cwd: 'www/js/', src: ['**'], dest: 'js/', action: 'upload'},
          {expand: true, cwd: 'www/lib/', src: ['**'], dest: 'lib/', action: 'upload'},
          {expand: true, cwd: 'www/assets/', src: ['**'], dest: 'lib/', action: 'upload'},
          {expand: true, cwd: 'www/review/', src: ['**'], dest: 'lib/', action: 'upload'},
          {expand: true, cwd: 'www/templates/', src: ['**'], dest: 'templates/', action: 'upload'},
          {expand: true, cwd: 'www/article/', src: ['**'], dest: 'article/', action: 'upload', params: {ContentType: 'text/plain'}},
          {
            expand: true,
            cwd: './www/',
            src: ['index.html'],
            dest: './',
            action: 'upload',
            params: {CacheControl: 'max-age=30', ContentType: 'text/html'}
          }
          // CacheControl only applied to the assets folder
          // LICENCE inside that folder will have ContentType equal to 'text/plain'
        ]
      },
      clean_production: {
        options: {
          bucket: 'www.growth.ren',
          debug: true // Doesn't actually delete but shows log
        },
        files: [
          {dest: 'css/', src: ['**'],  action: 'delete'},
          {dest: 'img/', src: ['**'],  action: 'delete'},
          {dest: 'js/', src: ['**'],  action: 'delete'},
          {dest: 'lib/', src: ['**'],  action: 'delete'},
          {dest: 'templates/', src: ['**'],  action: 'delete'},
          {dest: 'article/', src: ['**'],  action: 'delete'},
          {dest: './', src: ['index.html'], action: 'delete'}
          //{dest: 'assets/', exclude: "**/*.tgz", action: 'delete'}, // will not delete the tgz
          //{dest: 'assets/large/', exclude: "**/*copy*", flipExclude: true, action: 'delete'}, // will delete everything that has copy in the name
        ]
      }
    }
  });

  grunt.loadNpmTasks('grunt-aws-s3');
  grunt.registerTask('deploy', ['aws_s3:clean_production', 'aws_s3:production']);

};
<commit_msg>upload apk to s3<commit_after>module.exports = function (grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.readJSON('aws-credentials.json'),

    aws_s3: {
      options: {
        accessKeyId: '<%= aws.AWSAccessKeyId %>', // Use the variables
        secretAccessKey: '<%= aws.AWSSecretKey %>', // You can also use env variables
        region: 'ap-southeast-2',
        uploadConcurrency: 5, // 5 simultaneous uploads
        downloadConcurrency: 5 // 5 simultaneous downloads
      },
      production: {
        options: {
          bucket: 'www.growth.ren',
          params: {
            CacheControl: 'max-age=604800'
          }
        },
        files: [
          {expand: true, cwd: 'www/css/', src: ['**'], dest: 'css/', action: 'upload'},
          {expand: true, cwd: 'www/img/', src: ['**'], dest: 'img/', action: 'upload'},
          {expand: true, cwd: 'www/js/', src: ['**'], dest: 'js/', action: 'upload'},
          {expand: true, cwd: 'www/lib/', src: ['**'], dest: 'lib/', action: 'upload'},
          {expand: true, cwd: 'www/assets/', src: ['**'], dest: 'lib/', action: 'upload'},
          {expand: true, cwd: 'www/review/', src: ['**'], dest: 'lib/', action: 'upload'},
          {expand: true, cwd: 'www/templates/', src: ['**'], dest: 'templates/', action: 'upload'},
          {expand: true, cwd: 'platforms/android/build/outputs/apk', src: ['android-armv7-debug.apk'], dest: './', action: 'upload'},
          {expand: true, cwd: 'www/article/', src: ['**'], dest: 'article/', action: 'upload', params: {ContentType: 'text/plain'}},
          {
            expand: true,
            cwd: './www/',
            src: ['index.html'],
            dest: './',
            action: 'upload',
            params: {CacheControl: 'max-age=30', ContentType: 'text/html'}
          }
          // CacheControl only applied to the assets folder
          // LICENCE inside that folder will have ContentType equal to 'text/plain'
        ]
      },
      clean_production: {
        options: {
          bucket: 'www.growth.ren',
          debug: true // Doesn't actually delete but shows log
        },
        files: [
          {dest: 'css/', src: ['**'],  action: 'delete'},
          {dest: 'img/', src: ['**'],  action: 'delete'},
          {dest: 'js/', src: ['**'],  action: 'delete'},
          {dest: 'lib/', src: ['**'],  action: 'delete'},
          {dest: 'templates/', src: ['**'],  action: 'delete'},
          {dest: 'article/', src: ['**'],  action: 'delete'},
          {dest: './', src: ['index.html'], action: 'delete'}
          //{dest: 'assets/', exclude: "**/*.tgz", action: 'delete'}, // will not delete the tgz
          //{dest: 'assets/large/', exclude: "**/*copy*", flipExclude: true, action: 'delete'}, // will delete everything that has copy in the name
        ]
      }
    }
  });

  grunt.loadNpmTasks('grunt-aws-s3');
  grunt.registerTask('deploy', ['aws_s3:clean_production', 'aws_s3:production']);

};
<|endoftext|>


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

    var applicationFiles = [

        // intro
        'public/js/application/intro.js',

        // templates
        'public/js/templates/<%= pkg.name %>.templates.js',

        // helper
        'public/js/helpers/formatter.js',
        'public/js/helpers/util.js',
        'public/js/helpers/handlebarsHelper.js',

        // routes
        'public/js/routes/Router.js',
        'public/js/routes/IndexRoute.js',
        'public/js/routes/SummarySearchRoute.js',
        'public/js/routes/RelayDetailRoute.js',
        'public/js/routes/BridgeDetailRoute.js',

        // models
        'public/js/models/defaults.js',
        'public/js/models/TemporaryStore.js',
        'public/js/models/OnionooDetail.js',
        'public/js/models/OnionooSummary.js',
        'public/js/models/OnionooBandwidthHistory.js',
        'public/js/models/OnionooWeightsHistory.js',

        // controllers
        'public/js/controllers/ApplicationController.js',
        'public/js/controllers/IndexController.js',
        'public/js/controllers/RelayDetailController.js',
        'public/js/controllers/BridgeDetailController.js',
        'public/js/controllers/SummarySearchController.js',

        // views
        'public/js/views/LoadingIndicatorView.js',
        'public/js/views/HistoryGraphView.js',
        'public/js/views/ToggleEnableView.js',
        'public/js/views/RelaySummariesView.js'
    ];

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

        clean: {
            standalone: ['build']
        },

        copy:{
            standalone: {
                files: [
                    {
                        // minimized css and js
                        expand: true,
                        flatten: true,
                        src: ['public/dist/*.min.*'],
                        dest: 'build/dist/'
                    },{
                        // fonts
                        expand: true,
                        flatten: true,
                        src: ['public/fonts/*'],
                        dest: 'build/fonts/'
                    },{
                        // images
                        expand: true,
                        flatten:true,
                        src: ['public/img/*'],
                        dest: 'build/img/'
                    },{
                        // rootlevel files
                        expand: true,
                        flatten: true,
                        src: ['public/favicon.ico', 'views/html/index.html'],
                        dest: 'build/'
                    }
                ]
            }
        },

        watch: {
            js_files:{
                files: ['public/js/**/*.js'],
                tasks: ['concat:dev']
            },
            hbs:{
                files: ['public/js/templates/*.handlebars'],
                tasks: ['emberTemplates']
            },
            css:{
                files: ['public/css/*.css'],
                tasks: ['cssmin']
            }
            /*
            //enable if you have no file watchers in your ide

            ,scss:{
                files: ['public/css/*.scss'],
                tasks: ['sass']
            }
            */
        },

        emberTemplates: {
            compile: {
                options: {
                    templateName: function(sourceFile) {
                        //public/js/templates
                        return sourceFile.replace(/public\/js\/templates\//, '');
                    }
                },
                files: {
                    "public/js/templates/<%= pkg.name %>.templates.js": "public/js/templates/*.handlebars"
                }
            }
        },

        concat: {
            options: {
                separator: ';'
            },
            prod: {
                src: [

                    // vendor libs
                    'public/js/vendor/modernizr-2.6.2.min.js',
                    'public/js/vendor/sha1.js',
                    'public/js/vendor/jquery/jquery-1.10.1.min.js',
                    'public/js/vendor/jquery-deparam/jquery-deparam.min.js',
                    'public/js/vendor/datatables/jquery.dataTables.min.js',
                    'public/js/vendor/dygraph/dygraph-combined.js',
                    'public/js/vendor/dygraph/dygraph-extra.js',

                    // emberjs
                    'public/js/vendor/handlebars-runtime/handlebars.runtime-1.0.0-rc.4.js',
                    //'public/js/vendor/ember/ember-1.0.0-rc.6.1.prod.js',
                    'public/js/vendor/ember/ember-1.0.0-rc.6.1.js',

                    // foundation
                    'public/js/vendor/zepto/zepto.js',
                    'public/js/vendor/foundation/foundation.min.js',
                    'public/js/vendor/foundation/foundation.tooltips.js'].concat(applicationFiles),

                dest: 'public/dist/<%= pkg.name %>.js'
            },
            dev: {
                src: [
                    // vendor libs
                    'public/js/vendor/modernizr-2.6.2.min.js',
                    'public/js/vendor/sha1.js',
                    'public/js/vendor/jquery/jquery-1.10.1.js',
                    'public/js/vendor/jquery-deparam/jquery-deparam.js',
                    'public/js/vendor/datatables/jquery.dataTables.js',
                    'public/js/vendor/dygraph/dygraph-combined.js',
                    'public/js/vendor/dygraph/dygraph-extra.js',

                    // emberjs
                    'public/js/vendor/handlebars-runtime/handlebars.runtime-1.0.0-rc.4.js',
                    'public/js/vendor/ember/ember-1.0.0-rc.6.1.js',

                    // foundation
                    'public/js/vendor/zepto/zepto.js',
                    'public/js/vendor/foundation/foundation.min.js',
                    'public/js/vendor/foundation/foundation.tooltips.js'].concat(applicationFiles),

                // workaround to avoid changing the script src in index.html
                dest: 'public/dist/<%= pkg.name %>.<%=pkg.version %>.min.js'
            }

        },

        uglify: {
            options: {
                mangle: false,
                report: 'min',
                banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
            },
            dist: {
                files: {
                    'public/dist/<%= pkg.name %>.<%= pkg.version %>.min.js': ['public/dist/<%= pkg.name%>.js']
                }
            }
        },

        // compile scss files
        sass: {
            dist: {
                files: {
                    'public/css/style.css': 'public/css/style.scss'
                }
            }
        },

        //css related
        cssmin: {
            combine: {
                files: {
                    'public/dist/<%= pkg.name %>.css': [
                        'public/css/normalize.css',
                        'public/css/foundation.min.css',
                        'public/css/style.css',
                        'public/css/country-flags.css'
                    ]
                }
            },
            minify: {
                expand: true,
                cwd: 'public/dist/',
                src: ['<%= pkg.name %>.css'],
                dest: 'public/dist/',
                ext: '.<%= pkg.version %>.min.css'
            }
        },

        // create archive
        compress: {
            main: {
                options: {
                    archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
                },
                files: [
                    {src: ['build/**'], dest: '<%= pkg.name %>-<%= pkg.version %>/'} // includes files in path and its subdirs
                ]
            }
        },

        // karma
        karma: {
            unit: {
                configFile: 'test/karma.conf.js',
                singleRun: true
            }
        }
    });

    grunt.event.on('watch', function(action, filepath) {
        grunt.log.writeln('\n' + filepath + ' has ' + action);
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-ember-templates');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-karma');

    // Default task(s).
    grunt.registerTask('default', ['emberTemplates', 'concat:prod', 'uglify', 'sass', 'cssmin', 'karma']);
    grunt.registerTask('dev', ['emberTemplates', 'concat:dev', 'sass', 'cssmin', 'watch']);
    grunt.registerTask('standalone', ['clean', 'emberTemplates', 'concat:prod', 'uglify', 'sass', 'cssmin', 'copy:standalone']);
    grunt.registerTask('standalone-archive', ['clean', 'emberTemplates', 'concat:prod', 'uglify', 'sass', 'cssmin', 'copy:standalone', 'compress']);
};<commit_msg>#12 added karma to gruntfile targets<commit_after>module.exports = function(grunt) {

    var applicationFiles = [

        // intro
        'public/js/application/intro.js',

        // templates
        'public/js/templates/<%= pkg.name %>.templates.js',

        // helper
        'public/js/helpers/formatter.js',
        'public/js/helpers/util.js',
        'public/js/helpers/handlebarsHelper.js',

        // routes
        'public/js/routes/Router.js',
        'public/js/routes/IndexRoute.js',
        'public/js/routes/SummarySearchRoute.js',
        'public/js/routes/RelayDetailRoute.js',
        'public/js/routes/BridgeDetailRoute.js',

        // models
        'public/js/models/defaults.js',
        'public/js/models/TemporaryStore.js',
        'public/js/models/OnionooDetail.js',
        'public/js/models/OnionooSummary.js',
        'public/js/models/OnionooBandwidthHistory.js',
        'public/js/models/OnionooWeightsHistory.js',

        // controllers
        'public/js/controllers/ApplicationController.js',
        'public/js/controllers/IndexController.js',
        'public/js/controllers/RelayDetailController.js',
        'public/js/controllers/BridgeDetailController.js',
        'public/js/controllers/SummarySearchController.js',

        // views
        'public/js/views/LoadingIndicatorView.js',
        'public/js/views/HistoryGraphView.js',
        'public/js/views/ToggleEnableView.js',
        'public/js/views/RelaySummariesView.js'
    ];

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

        clean: {
            standalone: ['build']
        },

        copy:{
            standalone: {
                files: [
                    {
                        // minimized css and js
                        expand: true,
                        flatten: true,
                        src: ['public/dist/*.min.*'],
                        dest: 'build/dist/'
                    },{
                        // fonts
                        expand: true,
                        flatten: true,
                        src: ['public/fonts/*'],
                        dest: 'build/fonts/'
                    },{
                        // images
                        expand: true,
                        flatten:true,
                        src: ['public/img/*'],
                        dest: 'build/img/'
                    },{
                        // rootlevel files
                        expand: true,
                        flatten: true,
                        src: ['public/favicon.ico', 'views/html/index.html'],
                        dest: 'build/'
                    }
                ]
            }
        },

        watch: {
            js_files:{
                files: ['public/js/**/*.js'],
                tasks: ['concat:dev']
            },
            hbs:{
                files: ['public/js/templates/*.handlebars'],
                tasks: ['emberTemplates']
            },
            css:{
                files: ['public/css/*.css'],
                tasks: ['cssmin']
            }
            /*
            //enable if you have no file watchers in your ide

            ,scss:{
                files: ['public/css/*.scss'],
                tasks: ['sass']
            }
            */
        },

        emberTemplates: {
            compile: {
                options: {
                    templateName: function(sourceFile) {
                        //public/js/templates
                        return sourceFile.replace(/public\/js\/templates\//, '');
                    }
                },
                files: {
                    "public/js/templates/<%= pkg.name %>.templates.js": "public/js/templates/*.handlebars"
                }
            }
        },

        concat: {
            options: {
                separator: ';'
            },
            prod: {
                src: [

                    // vendor libs
                    'public/js/vendor/modernizr-2.6.2.min.js',
                    'public/js/vendor/sha1.js',
                    'public/js/vendor/jquery/jquery-1.10.1.min.js',
                    'public/js/vendor/jquery-deparam/jquery-deparam.min.js',
                    'public/js/vendor/datatables/jquery.dataTables.min.js',
                    'public/js/vendor/dygraph/dygraph-combined.js',
                    'public/js/vendor/dygraph/dygraph-extra.js',

                    // emberjs
                    'public/js/vendor/handlebars-runtime/handlebars.runtime-1.0.0-rc.4.js',
                    //'public/js/vendor/ember/ember-1.0.0-rc.6.1.prod.js',
                    'public/js/vendor/ember/ember-1.0.0-rc.6.1.js',

                    // foundation
                    'public/js/vendor/zepto/zepto.js',
                    'public/js/vendor/foundation/foundation.min.js',
                    'public/js/vendor/foundation/foundation.tooltips.js'].concat(applicationFiles),

                dest: 'public/dist/<%= pkg.name %>.js'
            },
            dev: {
                src: [
                    // vendor libs
                    'public/js/vendor/modernizr-2.6.2.min.js',
                    'public/js/vendor/sha1.js',
                    'public/js/vendor/jquery/jquery-1.10.1.js',
                    'public/js/vendor/jquery-deparam/jquery-deparam.js',
                    'public/js/vendor/datatables/jquery.dataTables.js',
                    'public/js/vendor/dygraph/dygraph-combined.js',
                    'public/js/vendor/dygraph/dygraph-extra.js',

                    // emberjs
                    'public/js/vendor/handlebars-runtime/handlebars.runtime-1.0.0-rc.4.js',
                    'public/js/vendor/ember/ember-1.0.0-rc.6.1.js',

                    // foundation
                    'public/js/vendor/zepto/zepto.js',
                    'public/js/vendor/foundation/foundation.min.js',
                    'public/js/vendor/foundation/foundation.tooltips.js'].concat(applicationFiles),

                // workaround to avoid changing the script src in index.html
                dest: 'public/dist/<%= pkg.name %>.<%=pkg.version %>.min.js'
            }

        },

        uglify: {
            options: {
                mangle: false,
                report: 'min',
                banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
            },
            dist: {
                files: {
                    'public/dist/<%= pkg.name %>.<%= pkg.version %>.min.js': ['public/dist/<%= pkg.name%>.js']
                }
            }
        },

        // compile scss files
        sass: {
            dist: {
                files: {
                    'public/css/style.css': 'public/css/style.scss'
                }
            }
        },

        //css related
        cssmin: {
            combine: {
                files: {
                    'public/dist/<%= pkg.name %>.css': [
                        'public/css/normalize.css',
                        'public/css/foundation.min.css',
                        'public/css/style.css',
                        'public/css/country-flags.css'
                    ]
                }
            },
            minify: {
                expand: true,
                cwd: 'public/dist/',
                src: ['<%= pkg.name %>.css'],
                dest: 'public/dist/',
                ext: '.<%= pkg.version %>.min.css'
            }
        },

        // create archive
        compress: {
            main: {
                options: {
                    archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
                },
                files: [
                    {src: ['build/**'], dest: '<%= pkg.name %>-<%= pkg.version %>/'} // includes files in path and its subdirs
                ]
            }
        },

        // karma
        karma: {
            unit: {
                configFile: 'test/karma.conf.js',
                singleRun: true
            }
        }
    });

    grunt.event.on('watch', function(action, filepath) {
        grunt.log.writeln('\n' + filepath + ' has ' + action);
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-ember-templates');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-karma');

    // Default task(s).
    grunt.registerTask('default', ['emberTemplates', 'concat:prod', 'uglify', 'sass', 'cssmin', 'karma']);
    grunt.registerTask('dev', ['emberTemplates', 'concat:dev', 'sass', 'cssmin', 'watch']);
    grunt.registerTask('standalone', ['clean', 'emberTemplates', 'concat:prod', 'uglify', 'sass', 'cssmin', 'copy:standalone', 'karma']);
    grunt.registerTask('standalone-archive', ['clean', 'emberTemplates', 'concat:prod', 'uglify', 'sass', 'cssmin', 'copy:standalone', 'karma', 'compress']);
};<|endoftext|>


<commit_before>"use strict";

exports = module.exports = function (grunt) {

    var path = require("path");

    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        version: {
            number: "", // not defined for development snapshots
            dev: 'DEVELOPMENT SNAPSHOT (<%= grunt.template.today("dd.mm.yyyy HH:MM:ss Z") %>)'
        },
         dirs: {
                modules: "build/output/modules"
         },

        // Path configurations
        libDir: "src/",
        testDir: "tests/",
        docDir: "doc/",
        buildDir: "build/output",

        moduleFiles: [
                    "LICENSE",
                    "<%= buildDir %>/xml3d.js"
                ],

        releaseName: "<%= buildDir %>/xml3d<%= version.number %>.js",

        clean: {
            output: ["<%= buildDir %>"],
            debug: ["<%= pkg.name %>"],
            doc: ["<%= docDir %>"]
        },

        concat: {
            options: {
                process: function(src, filepath) {
                    switch (filepath) {
                        case "build/output/xml3d.js": return src.replace('%VERSION%', grunt.config.get("version.dev") );
                        case "LICENSE": return "/**\n" + src + "\n@version: " + grunt.config.get("version.dev") +"\n**/";
                        default: return src;
                    }
                }
            },
            dist: {
                src: '<%= moduleFiles %>',
                dest: '<%= releaseName %>',
                nonull: true
            }

        },
        "browserify": {
            "testlib": {
                src: "./tests/build/index.js",
                dest: "./tests/xml3d-testlib.js",
                options: {
                    browserifyOptions: {
                        debug: true,
                        standalone: "XML3DTestLib"
                    }
                }
            },
            "dev": {
                src: "./src/xml3d.js",
                dest: "./build/output/xml3d.js",
                options: {
                    browserifyOptions: {
                        debug: true
                    }
                }
            }
    }   ,
        "closure-compiler": {
            frontend: {
                closurePath: './build/closure',
                js: '<%= releaseName %>',
                jsOutputFile: "<%= buildDir %>/xml3d<%= version.number %>-min.js",
                maxBuffer: 500,
                options: {
                    //compilation_level: 'ADVANCED_OPTIMIZATIONS', language_in: 'ECMASCRIPT5_STRICT'
                }
            }
        }, connect: {
            server: {
                options: {
                    port: 9001,
                    open: "http://localhost:9001/tests/all.html"
                }
            }
        },
        uglify: {
            "<%= releaseName %>": "<%= releaseName %>"
        }

    });

    var moduleBuilds = [];

    grunt.file.expand({filter: "isFile"}, "./src/**/build.json").forEach(function (configFile) {
        grunt.log.writeln("Reading file: " + configFile);
        var modulePath = path.dirname(configFile);
        var moduleConfig = grunt.file.readJSON(configFile);
        var destFile = grunt.config.get("dirs.modules") + "/xml3d-" + moduleConfig.module + "-module.js";
        var taskName = moduleConfig.task || "concat";

        var srcFiles = taskName == "concat" ? moduleConfig.files.map(function(name) { return modulePath + "/" + name; }) : modulePath + "/index.js";

        var config = {}, options = {}, task = config[taskName] = {};

        if (taskName == "browserify") {
            options["browserifyOptions"] = {
                debug: true, standalone: "XML3D"
            }
        }

        task[moduleConfig.module] = {
            src: srcFiles,
            dest: destFile,
            nonull: true
        };

        grunt.config.merge(config);
        moduleBuilds.push({
            task: taskName + ":" + moduleConfig.module,
            dest: destFile
        });
    });

    var shouldPublish = grunt.option('publish');
    if (shouldPublish) {
        grunt.config.merge({
            version: {
                number: "-<%= pkg.version %>",
                dev: "<%= pkg.version %>"
            }
        })
    }

    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-contrib-concat");
    grunt.loadNpmTasks('grunt-closure-compiler');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-contrib-connect');

    var builds = moduleBuilds.map(function(f) { return f.task });
    builds.push("concat:dist");

    grunt.registerTask("testlib", "browserify:testlib");
    grunt.registerTask("xml3ddev", "browserify:dev");
    grunt.registerTask("merge", builds);
    grunt.registerTask("dev", ["xml3ddev", "merge"]);
    grunt.registerTask("min", ["xml3ddev", "merge", "closure-compiler"]);
    grunt.registerTask("default", ["dev", "testlib"]);
    grunt.registerTask("continuous", ["dev", "min", "testlib"]);
    grunt.registerTask("testserver", ["connect:server:keepalive"]);

    grunt.registerTask('prepublish', 'Run all my build tasks.', function(n) {
        if (!grunt.option('publish')) { // Be sure to specify the target
            grunt.warn('Set publish flag to continue.');
        }
        grunt.task.run("clean:output", "dev", "closure-compiler");
    });
};
<commit_msg>Add a release task that builds without source mapping.<commit_after>"use strict";

exports = module.exports = function (grunt) {

    var path = require("path");

    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        version: {
            number: "", // not defined for development snapshots
            dev: 'DEVELOPMENT SNAPSHOT (<%= grunt.template.today("dd.mm.yyyy HH:MM:ss Z") %>)'
        },
         dirs: {
                modules: "build/output/modules"
         },

        // Path configurations
        libDir: "src/",
        testDir: "tests/",
        docDir: "doc/",
        buildDir: "build/output",

        moduleFiles: [
                    "LICENSE",
                    "<%= buildDir %>/xml3d.js"
                ],

        releaseName: "<%= buildDir %>/xml3d<%= version.number %>.js",

        clean: {
            output: ["<%= buildDir %>"],
            debug: ["<%= pkg.name %>"],
            doc: ["<%= docDir %>"]
        },

        concat: {
            options: {
                process: function(src, filepath) {
                    switch (filepath) {
                        case "build/output/xml3d.js": return src.replace('%VERSION%', grunt.config.get("version.dev") );
                        case "LICENSE": return "/**\n" + src + "\n@version: " + grunt.config.get("version.dev") +"\n**/";
                        default: return src;
                    }
                }
            },
            dist: {
                src: '<%= moduleFiles %>',
                dest: '<%= releaseName %>',
                nonull: true
            }

        },
        "browserify": {
            "testlib": {
                src: "./tests/build/index.js",
                dest: "./tests/xml3d-testlib.js",
                options: {
                    browserifyOptions: {
                        debug: true,
                        standalone: "XML3DTestLib"
                    }
                }
            },
            "dev": {
                src: "./src/xml3d.js",
                dest: "./build/output/xml3d.js",
                options: {
                    browserifyOptions: {
                        debug: true
                    }
                }
            },
            release: {
                src: "./src/xml3d.js",
                dest: "./build/output/xml3d.js",
                options: {
                    browserifyOptions: {
                        debug: false
                    }
                }
            }
    }   ,
        "closure-compiler": {
            frontend: {
                closurePath: './build/closure',
                js: '<%= releaseName %>',
                jsOutputFile: "<%= buildDir %>/xml3d<%= version.number %>-min.js",
                maxBuffer: 500,
                options: {
                    //compilation_level: 'ADVANCED_OPTIMIZATIONS', language_in: 'ECMASCRIPT5_STRICT'
                }
            }
        }, connect: {
            server: {
                options: {
                    port: 9001,
                    open: "http://localhost:9001/tests/all.html"
                }
            }
        },
        uglify: {
            "<%= releaseName %>": "<%= releaseName %>"
        }

    });

    var moduleBuilds = [];

    grunt.file.expand({filter: "isFile"}, "./src/**/build.json").forEach(function (configFile) {
        grunt.log.writeln("Reading file: " + configFile);
        var modulePath = path.dirname(configFile);
        var moduleConfig = grunt.file.readJSON(configFile);
        var destFile = grunt.config.get("dirs.modules") + "/xml3d-" + moduleConfig.module + "-module.js";
        var taskName = moduleConfig.task || "concat";

        var srcFiles = taskName == "concat" ? moduleConfig.files.map(function(name) { return modulePath + "/" + name; }) : modulePath + "/index.js";

        var config = {}, options = {}, task = config[taskName] = {};

        if (taskName == "browserify") {
            options["browserifyOptions"] = {
                debug: true, standalone: "XML3D"
            }
        }

        task[moduleConfig.module] = {
            src: srcFiles,
            dest: destFile,
            nonull: true
        };

        grunt.config.merge(config);
        moduleBuilds.push({
            task: taskName + ":" + moduleConfig.module,
            dest: destFile
        });
    });

    var shouldPublish = grunt.option('publish');
    if (shouldPublish) {
        grunt.config.merge({
            version: {
                number: "-<%= pkg.version %>",
                dev: "<%= pkg.version %>"
            }
        })
    }

    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-contrib-concat");
    grunt.loadNpmTasks('grunt-closure-compiler');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-contrib-connect');

    var builds = moduleBuilds.map(function(f) { return f.task });
    builds.push("concat:dist");

    grunt.registerTask("testlib", "browserify:testlib");
    grunt.registerTask("xml3ddev", "browserify:dev");
    grunt.registerTask("xml3drelease", "browserify:release");
    grunt.registerTask("merge", builds);
    grunt.registerTask("dev", ["xml3ddev"]);
    grunt.registerTask("release", ["xml3drelease", "merge"]);
    grunt.registerTask("min", ["release", "closure-compiler"]);
    grunt.registerTask("default", ["dev", "testlib"]);
    grunt.registerTask("continuous", ["dev", "min", "testlib"]);
    grunt.registerTask("testserver", ["connect:server:keepalive"]);

    grunt.registerTask('prepublish', 'Run all my build tasks.', function(n) {
        if (!grunt.option('publish')) { // Be sure to specify the target
            grunt.warn('Set publish flag to continue.');
        }
        grunt.task.run("clean:output", "dev", "closure-compiler");
    });
};
<|endoftext|>


<commit_before>'use strict';

/*!
 * Inspired Gruntfile
 * Copyright 2015 Seth Warburton.
 * Licensed under MIT (http://opensource.org/licenses/MIT)
 */

module.exports = function(grunt) {

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

    // Configurable paths, point them where you want.
    var config = {
        app: 'app', // The source directory
        dist: 'assets' // The output directory
    };

    //Initializing the configuration object
    grunt.initConfig({

        // Project settings
        config: config,

        // Add vendor prefixed styles.
        autoprefixer: {
            options: {
                browsers: ['last 1 version, > 5%']
            },
            dist: {
                src: '<%= config.dist %>/css/main.css'
            }
        },

        // Reload browser when watched files are changed and provide a url for
        // device testing
        browserSync: {
            dev: {
                bsFiles: {
                    src : '<%= config.dist %>/css/main.css'
                },
                options: {
                watchTask: true,
                    files: [
                        '<%= config.dist %>/css/main.css',
                        '<%= config.dist %>/js/**/*.js',
                        'craft/templates/**/*.html',
                        '_site'
                    ],
                    server: {
                        baseDir: '_site'
                    }
                    // PHP site like Craft running on localhost? Comment out the
                    // server: line above and uncomment the following, setting
                    // it to match *your* localhost path.
                    //
                    // proxy: 'localhost:8888/mysite/'
                }
            }
        },

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

        // Combine and copy JS, without minification, for development. Because
        // JS uglify is very slow in comparison we only uglify on build.
        concat: {
                options: {
                stripBanners: false
            },
            dev: {
                files: {
                    '<%= config.dist %>/js/plugins.js': ['<%= config.app %>/js/plugins/*.js'],
                    '<%= config.dist %>/js/main.js': ['<%= config.app %>/js/main.js'],
                },
            },
        },

        // Copies any remaining files
        copy: {
            files: {
                cwd: '<%= config.app %>/js/vendor/',
                src: '**/*',
                dest: '<%= config.dist %>/js/vendor/',
                expand: true
            }
        },

        // Format and optimise css for production
        cssnano: {
            options: {
                sourcemap: true
            },
            dist: {
                files: {
                    '<%= config.dist %>/css/main.min.css': '<%= config.dist %>/css/main.css'
                }
            }
        },

        // Automatically generate .svg icons, with fallbacks, from svg files in
        //icons. See: http://www.grunticon.com/ for further details.
        grunticon: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/svg-compressed',
                    src: ['*.svg', '*.png'],
                    dest: "<%= config.dist %>/icons"
                }],
                options: {
                    defaultHeight: '16px',
                    defaultWidth: '16px',
                    enhanceSVG: true,
                    pngpath: "<%= config.dist %>/icons/png"
                }
            }
        },

        // Process images to optimise filesizes for production
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/img',
                    src: '{,*/}*.{gif,jpeg,jpg,png,svg}',
                    dest: 'img'
                }]
            }
        },

        // Not a Jekyll site? Comment this task out.
        jekyll: {
            build: {
                dest: '_site',
                baseurl: '/'
            }
        },

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

        // Compile Sass source files to CSS
        sass: {
            dist: {
                options: {
                    precision: '5',
                    sourceMap: true
                },
                files: {
                    '<%= config.dist %>/css/main.css': '<%= config.app %>/scss/main.scss'
                }
            }
        },

        // Optimise SVGs
        svgmin: {
            options: {
                plugins: [
                    {
                        removeViewBox: false
                    }, {
                        removeUselessStrokeAndFill: false
                    }
                ]
            },
            // Optimise icon.svg files prior to the Grunticonn task
            icons: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>/icons',
                    src: '{,*/}*.svg',
                    dest: '.tmp/svg-compressed'
                }]
            },
            // Optimise the site logo
//            logo: {
//                files: {
//                    '<%= config.dist %>/img/logo.svg': '<%= config.app %>/img/logo.svg',
//                }
//            }
        },

        // Compress JS files for production
        uglify: {
            dist: {
                files: {
                    '<%= config.dist %>/js/plugins.js': '<%= config.app %>/js/plugins/*.js',
                    '<%= config.dist %>/js/main.js': '<%= config.app %>/js/main.js'
                }
            }
        },

        // Watch files for changes and run tasks based on the changed files
        watch: {
            sass: {
                files: ['<%= config.app %>/scss/**/*.scss'],
                tasks: ['styles']
            },
            jekyll: {
                files: ['index.html','_layouts/*.html', '_includes/*.*','<%= config.dist %>/css/main.css'],
                tasks: ['jekyll:build']
            },
            js: {
                files: ['<%= config.app %>/js/**/*.js'],
                tasks: ['concat:dev']
            },
            gruntfile: {
                files: ['Gruntfile.js']
            }
        }
    });

    // Just-in-time plugin, for loading plugins really quickly.
    require('jit-grunt')(grunt);

    // Task registration
    grunt.registerTask('default', ['dev']);
    grunt.registerTask('build', ['dist']);
    grunt.registerTask('styles', []);
    grunt.registerTask('images', []);
    grunt.registerTask('test', []);

    // Primary Task definition
    grunt.registerTask('dev', ['clean','images','styles','concat:dev','copy','jekyll','browserSync','watch']);
    grunt.registerTask('dist', ['clean','images','styles','uglify','copy']);

    // Sub-tasks, called by primary tasks, for better organisation.
    grunt.registerTask('images', ['imagemin','svgmin','grunticon']);
    grunt.registerTask('styles', ['sass','autoprefixer','cssnano']);
    grunt.registerTask('test', ['jshint']);
};
<commit_msg>Suuuuuupeeeeerrrr update!<commit_after>'use strict';

/*!
 * Inspired Gruntfile
 * Copyright 2015 Seth Warburton.
 * Version 1.01
 * Licensed under MIT (http://opensource.org/licenses/MIT)
 */

module.exports = function(grunt) {

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

    // Configurable paths
    var config = {
        app: 'src/', // The source directory
        dist: '' // The output directory
    };

    //Initializing the configuration object
    grunt.initConfig({

        // Project settings
        config: config,

        // Reload browser when watched files are changed and provide a url for device testing
        browserSync: {
            dev: {
                bsFiles: {
                    src : '<%= config.dist %>css/main.css'
                },
                options: {
                watchTask: true,
                    files: [
                        '<%= config.dist %>css/main.css',
                        '<%= config.dist %>js/**/*.js',
                        '<%= config.dist %>html/**/*.php', // Watch Joomla template overrides
                        'craft/templates/**/*.html', // Watch Craft CMS templates
                        '_site' // Watch Jekyll's build location
                    ],
                    // server: { // Using Jekyll? Uncomment this and comment out the proxy rule below
                    //    baseDir: '_site'
                    // }
                    // PHP site like Craft running on localhost? Comment out the
                    // server: line above and uncomment the following, setting
                    // it to match *your* localhost path.
                    //
                    // proxy: 'localhost:8888/mysite/'
                    proxy: 'localhost:8888/joomlanauts/'
                }
            }
        },

        // Empties destination and temp folders to start fresh
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.sass-cache',
                        '.tmp',
                        '<%= config.dist %>css',
                        '<%= config.dist %>img',
                        '<%= config.dist %>js',
                        '<%= config.dist %>fonts'
                    ]
                }]
            },
        },

        // Combine and copy JS, without minification, for development. Because
        // JS uglify is very slow in comparison we only uglify on build.
        concat: {
                options: {
                stripBanners: false
            },
            dev: {
                files: {
                    '<%= config.dist %>js/plugins.js': ['<%= config.app %>js/plugins/*.js'],
                    '<%= config.dist %>js/main.js': ['<%= config.app %>js/main.js'],
                },
            },
        },

        // Copies any remaining files
        copy: {
            files: {
                cwd: '<%= config.app %>js/vendor/',
                src: '**/*',
                dest: '<%= config.dist %>js/vendor/',
                expand: true
            }
        },

        // Automatically generate .svg icons, with fallbacks, from svg files in
        //icons. See: http://www.grunticon.com/ for further details.
        grunticon: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/svg-compressed',
                    src: ['*.svg', '*.png'],
                    dest: "<%= config.dist %>icons"
                }],
                options: {
                    defaultHeight: '16px',
                    defaultWidth: '16px',
                    enhanceSVG: true,
                    pngpath: "<%= config.dist %>icons/png"
                }
            }
        },

        // Process images to optimise filesizes for production
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>img',
                    src: '**/*.{gif,jpeg,jpg,png,svg}',
                    dest: '<%= config.dist %>img'
                }]
            }
        },

        // Jekyll site? Uncomment this task to autobuild your site.
        // jekyll: {
        //     build: {
        //         dest: '_site',
        //         baseurl: '/'
        //     }
        // },

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

        postcss: {
            options: {
                processors: [
                    require('autoprefixer')({
                        browsers: 'last 1 version, > 5%' // add vendor prefixes
                    }),
                    require('cssnano')() // optimise and the minify the result
                ]
            },
            dist: {
                files: {
                    '<%= config.dist %>css/main.css': '<%= config.dist %>css/main.css'
                }
            }
        },

        // Compile Sass source files to CSS
        sass: {
            dist: {
                options: {
                    precision: '5',
                    sourceMap: true
                },
                files: {
                    '<%= config.dist %>css/main.css': '<%= config.app %>scss/main.scss'
                }
            }
        },

        scsslint: {
            allFiles: [
                '<%= config.app %>scss',
            ],
            options: {
                config: '<%= config.app %>scss/.scss-lint.yml',
                reporterOutput: 'scss-lint-report.xml'
            },
        },

        // Optimise SVGs
        svgmin: {
            options: {
                plugins: [
                    {
                        removeViewBox: false
                    }, {
                        removeUselessStrokeAndFill: false
                    }
                ]
            },
            // Optimise icon.svg files prior to the Grunticonn task
            icons: {
                files: [{
                    expand: true,
                    cwd: '<%= config.app %>icons',
                    src: '{,*/}*.svg',
                    dest: '.tmp/svg-compressed'
                }]
            }
        },

        // Compress JS files for production
        uglify: {
            dist: {
                files: {
                    '<%= config.dist %>js/plugins.js': '<%= config.app %>js/plugins/*.js',
                    '<%= config.dist %>js/main.js': '<%= config.app %>js/main.js'
                }
            }
        },

        // Watch files for changes and run tasks based on the changed files
        watch: {
            sass: {
                files: ['<%= config.app %>scss/**/*.scss'],
                tasks: ['styles']
            },
            js: {
                files: ['<%= config.app %>js/**/*.js'],
                tasks: ['concat:dev']
            },
            gruntfile: {
                files: ['Gruntfile.js']
            }
        }
    });

    // Just-in-time plugin, for loading plugins really quickly.
    require('jit-grunt')(grunt, {
        scsslint: 'grunt-scss-lint'
    });

    // Task registration
    grunt.registerTask('default', ['dev']);
    grunt.registerTask('build', ['dist']);
    grunt.registerTask('styles', []);
    grunt.registerTask('images', []);
    grunt.registerTask('test', []);

    // Primary Task definition
    grunt.registerTask('dev', ['clean','images','test','styles','concat:dev','copy','browserSync','watch']);
    grunt.registerTask('dist', ['clean','images','styles','uglify','copy']);

    // Sub-tasks, called by primary tasks, for better organisation.
    grunt.registerTask('images', ['imagemin','svgmin','grunticon']);
    grunt.registerTask('styles', ['sass','postcss']);
    grunt.registerTask('test', ['scsslint']);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		ngdocs: {
			options: {
				dest: 'docs',
				scripts: ['angular.js',
                                'https://code.angularjs.org/1.2.8/angular-route.js',
                                'http://maps.google.com/maps/api/js?sensor=false&.js',
                                'https://code.jquery.com/jquery-1.11.0.js',
                                'http://code.jquery.com/ui/1.10.4/jquery-ui.js',
                                'http://localhost/gmap/OpenLayers/OpenLayers.js',
                                'src/main/js/map services/layer-openlayersv2.js',
                                'src/main/js/map services/map-openlayersv2.js',
                                'src/main/js/map services/data-openlayersv2.js',
                                'src/main/js/map services/mapservices.js',
                                'src/main/js/map services/map-control-openlayersv2.js',
                                'src/main/js/core/map-services.js',
                                'src/main/js/core/map-directives.js',
                                'src/main/js/core/map-config.js',
                                'src/main/js/core/control-directives.js',
                                'src/main/js/core/feature-directives.js',
                                'src/main/js/core/layer-services.js',
                                'src/main/js/core/layer-directives.js',
                                'src/main/js/core/marker-directives.js',
                                'src/main/js/core/core.js',
                                'src/main/js/core/services.js',
                                'src/main/js/ui/ui-directives.js',
                                'src/main/js/config/directives.js'],
				html5Mode: false
			},
			api: {
				src: ['src/**/*.js', '!src/**/*.spec.js'],
				title: 'API Documentation'
			}
		}
	});
	grunt.loadNpmTasks('grunt-ngdocs');
	grunt.registerTask('default',['ngdocs']);
};<commit_msg>Updated OpenLayers.js dependency to v2.13.1 on cloudflare.com<commit_after>module.exports = function (grunt) {
	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		ngdocs: {
			options: {
				dest: 'docs',
				scripts: ['angular.js',
                                'https://code.angularjs.org/1.2.8/angular-route.js',
                                'http://maps.google.com/maps/api/js?sensor=false&.js',
                                'https://code.jquery.com/jquery-1.11.0.js',
                                'http://code.jquery.com/ui/1.10.4/jquery-ui.js',
                                'http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js',
                                'src/main/js/map services/layer-openlayersv2.js',
                                'src/main/js/map services/map-openlayersv2.js',
                                'src/main/js/map services/data-openlayersv2.js',
                                'src/main/js/map services/mapservices.js',
                                'src/main/js/map services/map-control-openlayersv2.js',
                                'src/main/js/core/map-services.js',
                                'src/main/js/core/map-directives.js',
                                'src/main/js/core/map-config.js',
                                'src/main/js/core/control-directives.js',
                                'src/main/js/core/feature-directives.js',
                                'src/main/js/core/layer-services.js',
                                'src/main/js/core/layer-directives.js',
                                'src/main/js/core/marker-directives.js',
                                'src/main/js/core/core.js',
                                'src/main/js/core/services.js',
                                'src/main/js/ui/ui-directives.js',
                                'src/main/js/config/directives.js'],
				html5Mode: false
			},
			api: {
				src: ['src/**/*.js', '!src/**/*.spec.js'],
				title: 'API Documentation'
			}
		}
	});
	grunt.loadNpmTasks('grunt-ngdocs');
	grunt.registerTask('default',['ngdocs']);
};<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
	jshint: {
	    options: {
		jshintrc: '.jshintrc'
	    },
	    gruntfile: {
		src: 'Gruntfile.js'
	    },
	    lib: {
		src: ['lib/**/*.js']
	    },
	    test: {
		src: ['test/**/*.js']
	    },
	    docco: {
		debug: {
		    src: ['lib/*.js'],
		    options: {
			output: 'docs/'
		    }
		}
	    }
	}
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-docco');

    // Default task.
    grunt.registerTask('default', ['jshint']);
    grunt.registerTask('docco', ['docco']);
};
<commit_msg>Solved with the help of SO http://stackoverflow.com/questions/22285942/grunt-throw-recursive-process-nexttick-detected/22409382#22409382<commit_after>'use strict';

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
	jshint: {
	    options: {
		jshintrc: '.jshintrc'
	    },
	    gruntfile: {
		src: 'Gruntfile.js'
	    },
	    lib: {
		src: ['lib/**/*.js']
	    },
	    test: {
		src: ['test/**/*.js']
	    }

	},
	docco: {
	    debug: {
		src: ['lib/*.js'],
		options: {
		    output: 'docs/'
		}
	    }
	}
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-docco');

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


<commit_before>/*
 Copyright, 2013, by Tomas Korcak. <korczis@gmail.com>

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */

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

    var path = require('path'),
        utils = require("./modules/utils");

    var config = utils.loadConfig(path.join(__dirname, "./config.js")),
        templatesDir = "./public/views/";

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-ember-templates');
    grunt.loadNpmTasks('grunt-express');
    grunt.loadNpmTasks('grunt-neuter');

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

        meta: {
            banner: '/*! <%=pkg.name%> - v<%=pkg.version%> (build <%=pkg.build%>) - ' +
                '<%=grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT")%> */'
        },

        clean: [
            './public/assets/*.js'
        ],

        emberTemplates: {
            compile: {
                options: {
                    templateName: function (filename) {
                        var res = filename;

                        res = res.replace(templatesDir, '');
                        res = res.replace(/^routes\//, "");

                        return res;
                    }
                },
                files: {
                    "./public/assets/templates.js": [
                        templatesDir + "**/*.hbs"
                    ]
                }
            }
        },

        express: {
            /*
            livereloadServer: {
                server: path.resolve(__dirname, 'modules/server/reloader.js'),
                bases: path.resolve(__dirname, 'public'),
                livereload: true, // if you just specify `true`, default port `35729` will be used
                serverreload: {
                    port: config.server.port
                }
            }
            */

            custom: {
                options: {
                    port: config.server.port,
                    bases: [
                        path.join(__dirname, "public"),
                        path.join(__dirname, "modules")
                    ],
                    server: path.join(__dirname, "modules/server/reloader.js"),
                    livereload: true,
                    serverreload: false
                }
            }
        }
    });

    // Build all assets required for running the app
    grunt.registerTask('build', [
        'emberTemplates'
    ]);

    grunt.registerTask('server', [
        'express',
        'watch'
    ]);

    // Default tasks.
    grunt.registerTask('default', [
        'build'
    ]);
};<commit_msg>Show stack<commit_after>/*
 Copyright, 2013, by Tomas Korcak. <korczis@gmail.com>

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */

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

    var path = require('path'),
        utils = require("./modules/utils");

    var config = utils.loadConfig(path.join(__dirname, "./config.js")),
        templatesDir = "./public/views/";

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-ember-templates');
    grunt.loadNpmTasks('grunt-express');
    grunt.loadNpmTasks('grunt-neuter');

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

        meta: {
            banner: '/*! <%=pkg.name%> - v<%=pkg.version%> (build <%=pkg.build%>) - ' +
                '<%=grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT")%> */'
        },

        clean: [
            './public/assets/*.js'
        ],

        emberTemplates: {
            compile: {
                options: {
                    templateName: function (filename) {
                        var res = filename;

                        res = res.replace(templatesDir, '');
                        res = res.replace(/^routes\//, "");

                        return res;
                    }
                },
                files: {
                    "./public/assets/templates.js": [
                        templatesDir + "**/*.hbs"
                    ]
                }
            }
        },

        express: {
            /*
            livereloadServer: {
                server: path.resolve(__dirname, 'modules/server/reloader.js'),
                bases: path.resolve(__dirname, 'public'),
                livereload: true, // if you just specify `true`, default port `35729` will be used
                serverreload: {
                    port: config.server.port
                }
            }
            */

            custom: {
                options: {
                    showStack: true,
                    port: config.server.port,
                    bases: [
                        path.join(__dirname, "public"),
                        path.join(__dirname, "modules")
                    ],
                    server: path.join(__dirname, "modules/server/reloader.js"),
                    livereload: true,
                    serverreload: false
                }
            }
        }
    });

    // Build all assets required for running the app
    grunt.registerTask('build', [
        'emberTemplates'
    ]);

    grunt.registerTask('server', [
        'express',
        // 'express-keepalive',
        'watch'
    ]);

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