<commit_before>module.exports = function(grunt) {
  var hljs = require('highlight.js');
  hljs.LANGUAGES['scss'] = require('./lib/scss.js')(hljs);

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

    foundation: {
      js: ['js/foundation/foundation.js', 'js/foundation/foundation.*.js'],
      scss: ['scss/foundation.scss']
    },

    jst: {
      compile: {
        files: {
          'dist/docs/assets/js/templates.js': ['doc/templates/*.html']
        }
      }
    },

    assemble: {
      options: {
        marked: {
          highlight: function(code, lang) {
            if (lang === undefined) lang = 'bash';
            if (lang === 'html') lang = 'xml';
            if (lang === 'js') lang = 'javascript';
            return '
' + hljs.highlight(lang, code).value + '
';
          }
        }
      },
      dist: {
        options: {
          flatten: false,
          assets: 'dist/docs/assets',
          data: ['doc/data/*.json'],
          helpers: ['doc/helpers/*.js'],
          partials: ['doc/includes/**/*.{html,scss}'],
          layoutdir: 'doc/layouts',
          layout: 'default.html'
        },
        expand: true,
        cwd: 'doc/pages',
        src: '**/*.{html,md}',
        dest: 'dist/docs/'
      }
    },

    sass: {
      dist: {
        options: {
          includePaths: ['scss']
        },
        files: {
          'dist/assets/css/foundation.css': '<%= foundation.scss %>',
          'dist/assets/css/normalize.css': 'scss/normalize.scss',
          'dist/docs/assets/css/docs.css': 'doc/assets/scss/docs.scss'
        }
      }
    },

    autoprefixer: {
      options: {
        browsers: ['Explorer >= 9', 'Android >= 2', 'iOS >= 5', '> 1%']
      },
      dist: {
        src: ['dist/assets/css/foundation.css', 'dist/docs/assets/css/docs.css']
      }
    },

    cssmin: {
      dist_compressed: {
        files: {
          'dist/assets/css/foundation.min.css': 'dist/assets/css/foundation.css'
        }
      }
    },

    concat: {
      dist: {
        files: {
          'dist/assets/js/foundation.js': '<%= foundation.js %>'
        }
      }
    },

    uglify: {
      options: {
        preserveComments: 'some'
      },
      dist: {
        files: {
          'dist/assets/js/foundation.min.js': ['<%= foundation.js %>'],
          'dist/docs/assets/js/modernizr.js': ['<%= vendor %>/modernizr/modernizr.js'],
          'dist/docs/assets/js/all.js': ['vendor/lodash/dist/lodash.min.js','<%= vendor %>/fastclick/lib/fastclick.js', '<%= vendor %>/jquery-placeholder/jquery.placeholder.js', '<%= vendor %>/jquery.autocomplete/dist/jquery.autocomplete.js', '<%= foundation.js %>', 'doc/assets/js/docs.js']
        }
      },
      vendor: {
        files: {
          'dist/docs/assets/js/placeholder.js': '<%= vendor %>/jquery-placeholder/jquery.placeholder.js',
          'dist/docs/assets/js/fastclick.js': '<%= vendor %>/fastclick/lib/fastclick.js',
          'dist/docs/assets/js/jquery.cookie.js': '<%= vendor %>/jquery.cookie/jquery.cookie.js',
          'dist/docs/assets/js/jquery.js': '<%= vendor %>/jquery/dist/jquery.js',
          'dist/docs/assets/js/modernizr.js': '<%= vendor %>/modernizr/modernizr.js'
        }
      }
    },

    copy: {
      dist: {
        files: [
          {expand:true, cwd: 'doc/assets/', src: ['**/*','!{scss,js}/**/*'], dest: 'dist/docs/assets/', filter:'isFile'},
          {expand:true, cwd: 'js/', src: ['foundation/*.js'], dest: 'dist/assets/js', filter: 'isFile'},
          {src: '<%= vendor %>/jquery/jquery.min.js', dest: 'dist/docs/assets/js/jquery.js'},
          {expand:true, cwd: 'scss/', src: '**/*.scss', dest: 'dist/assets/scss/', filter: 'isFile'},
          {src: 'bower.json', dest: 'dist/assets/'}
        ]
      }
    },

    clean: ['dist/'],

    karma: {
      options: {
        configFile: 'karma.conf.js',
        runnerPort: 9999,
      },
      continuous: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS']
      },
      dev: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox'],
        reporters: 'dots'
      },
      dev_watch: {
        background: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox']
      },
      mac: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox', 'Safari'],
        reporters: 'dots'
      },
      win: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox', 'IE'],
        reporters: 'dots'
      }
    },

    watch: {
      grunt: { files: ['Gruntfile.js'] },
      karma: {
        files: [
          'dist/assets/js/*.js',
          'spec/**/*.js',
          'dist/assets/css/*.css'
        ],
        tasks: ['karma:dev_watch:run']
      },
      sass: {
        files: ['scss/**/*.scss', 'doc/assets/**/*.scss'],
        tasks: ['sass', 'cssmin'],
        options: {
          livereload:true
        }
      },
      js: {
        files: ['js/**/*.js', 'doc/assets/js/**/*.js'],
        tasks: ['copy', 'concat', 'uglify'],
        options: {livereload:true}
      },
      assemble_all: {
        files: ['doc/{includes,layouts}/**/*.html'],
        tasks: ['assemble'],
        options: {livereload:true}
      },
      assemble_pages: {
        files: ['doc/pages/**/*.html'],
        tasks: ['newer:assemble'],
        options: {livereload:true}
      },
      assets: {
        options: {cwd: 'doc/assets/', livereload: true},
        files: ['**/*','!{scss,js}/**/*'],
        tasks: ['copy']
      },
      jst: {
        files: ['doc/templates/*.html'],
        tasks: ['jst'],
        options: {livereload:false}
      }
    },

    rsync: {
      dist: {
        options: {
          args: ["--verbose"],
          src: "./dist/docs/",
          recursive: true,
          dest: "/home/deployer/sites/foundation-docs/current",
          host: "deployer@foundation5.zurb.com"
        }
      }
    }
  });

  grunt.loadNpmTasks('assemble');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-newer');
  grunt.loadNpmTasks('grunt-rsync');
  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-contrib-jst');
  grunt.loadNpmTasks('grunt-autoprefixer');
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  grunt.task.registerTask('watch_start', ['karma:dev_watch:start', 'watch']);
  grunt.registerTask('build:assets', ['clean', 'sass', 'autoprefixer', 'cssmin', 'concat', 'uglify', 'copy', 'jst']);
  grunt.registerTask('build', ['build:assets', 'assemble']);
  grunt.registerTask('travis', ['build', 'karma:continuous']);
  grunt.registerTask('develop', ['travis', 'watch_start']);
  grunt.registerTask('deploy', ['build', 'rsync:dist']);
  grunt.registerTask('default', ['build', 'watch']);
};
<commit_msg>Added autoprefixer to watch task in Gruntfile.js<commit_after>module.exports = function(grunt) {
  var hljs = require('highlight.js');
  hljs.LANGUAGES['scss'] = require('./lib/scss.js')(hljs);

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

    foundation: {
      js: ['js/foundation/foundation.js', 'js/foundation/foundation.*.js'],
      scss: ['scss/foundation.scss']
    },

    jst: {
      compile: {
        files: {
          'dist/docs/assets/js/templates.js': ['doc/templates/*.html']
        }
      }
    },

    assemble: {
      options: {
        marked: {
          highlight: function(code, lang) {
            if (lang === undefined) lang = 'bash';
            if (lang === 'html') lang = 'xml';
            if (lang === 'js') lang = 'javascript';
            return '
' + hljs.highlight(lang, code).value + '
';
          }
        }
      },
      dist: {
        options: {
          flatten: false,
          assets: 'dist/docs/assets',
          data: ['doc/data/*.json'],
          helpers: ['doc/helpers/*.js'],
          partials: ['doc/includes/**/*.{html,scss}'],
          layoutdir: 'doc/layouts',
          layout: 'default.html'
        },
        expand: true,
        cwd: 'doc/pages',
        src: '**/*.{html,md}',
        dest: 'dist/docs/'
      }
    },

    sass: {
      dist: {
        options: {
          includePaths: ['scss']
        },
        files: {
          'dist/assets/css/foundation.css': '<%= foundation.scss %>',
          'dist/assets/css/normalize.css': 'scss/normalize.scss',
          'dist/docs/assets/css/docs.css': 'doc/assets/scss/docs.scss'
        }
      }
    },

    autoprefixer: {
      options: {
        browsers: ['Explorer >= 9', 'Android >= 2', 'iOS >= 5', '> 1%']
      },
      dist: {
        src: ['dist/assets/css/foundation.css', 'dist/docs/assets/css/docs.css']
      }
    },

    cssmin: {
      dist_compressed: {
        files: {
          'dist/assets/css/foundation.min.css': 'dist/assets/css/foundation.css'
        }
      }
    },

    concat: {
      dist: {
        files: {
          'dist/assets/js/foundation.js': '<%= foundation.js %>'
        }
      }
    },

    uglify: {
      options: {
        preserveComments: 'some'
      },
      dist: {
        files: {
          'dist/assets/js/foundation.min.js': ['<%= foundation.js %>'],
          'dist/docs/assets/js/modernizr.js': ['<%= vendor %>/modernizr/modernizr.js'],
          'dist/docs/assets/js/all.js': ['vendor/lodash/dist/lodash.min.js','<%= vendor %>/fastclick/lib/fastclick.js', '<%= vendor %>/jquery-placeholder/jquery.placeholder.js', '<%= vendor %>/jquery.autocomplete/dist/jquery.autocomplete.js', '<%= foundation.js %>', 'doc/assets/js/docs.js']
        }
      },
      vendor: {
        files: {
          'dist/docs/assets/js/placeholder.js': '<%= vendor %>/jquery-placeholder/jquery.placeholder.js',
          'dist/docs/assets/js/fastclick.js': '<%= vendor %>/fastclick/lib/fastclick.js',
          'dist/docs/assets/js/jquery.cookie.js': '<%= vendor %>/jquery.cookie/jquery.cookie.js',
          'dist/docs/assets/js/jquery.js': '<%= vendor %>/jquery/dist/jquery.js',
          'dist/docs/assets/js/modernizr.js': '<%= vendor %>/modernizr/modernizr.js'
        }
      }
    },

    copy: {
      dist: {
        files: [
          {expand:true, cwd: 'doc/assets/', src: ['**/*','!{scss,js}/**/*'], dest: 'dist/docs/assets/', filter:'isFile'},
          {expand:true, cwd: 'js/', src: ['foundation/*.js'], dest: 'dist/assets/js', filter: 'isFile'},
          {src: '<%= vendor %>/jquery/jquery.min.js', dest: 'dist/docs/assets/js/jquery.js'},
          {expand:true, cwd: 'scss/', src: '**/*.scss', dest: 'dist/assets/scss/', filter: 'isFile'},
          {src: 'bower.json', dest: 'dist/assets/'}
        ]
      }
    },

    clean: ['dist/'],

    karma: {
      options: {
        configFile: 'karma.conf.js',
        runnerPort: 9999,
      },
      continuous: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS']
      },
      dev: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox'],
        reporters: 'dots'
      },
      dev_watch: {
        background: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox']
      },
      mac: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox', 'Safari'],
        reporters: 'dots'
      },
      win: {
        singleRun: true,
        browsers: ['TinyPhantomJS', 'SmallPhantomJS', 'TinyChrome', 'Firefox', 'IE'],
        reporters: 'dots'
      }
    },

    watch: {
      grunt: { files: ['Gruntfile.js'] },
      karma: {
        files: [
          'dist/assets/js/*.js',
          'spec/**/*.js',
          'dist/assets/css/*.css'
        ],
        tasks: ['karma:dev_watch:run']
      },
      sass: {
        files: ['scss/**/*.scss', 'doc/assets/**/*.scss'],
        tasks: ['sass', 'autoprefixer', 'cssmin'],
        options: {
          livereload:true
        }
      },
      js: {
        files: ['js/**/*.js', 'doc/assets/js/**/*.js'],
        tasks: ['copy', 'concat', 'uglify'],
        options: {livereload:true}
      },
      assemble_all: {
        files: ['doc/{includes,layouts}/**/*.html'],
        tasks: ['assemble'],
        options: {livereload:true}
      },
      assemble_pages: {
        files: ['doc/pages/**/*.html'],
        tasks: ['newer:assemble'],
        options: {livereload:true}
      },
      assets: {
        options: {cwd: 'doc/assets/', livereload: true},
        files: ['**/*','!{scss,js}/**/*'],
        tasks: ['copy']
      },
      jst: {
        files: ['doc/templates/*.html'],
        tasks: ['jst'],
        options: {livereload:false}
      }
    },

    rsync: {
      dist: {
        options: {
          args: ["--verbose"],
          src: "./dist/docs/",
          recursive: true,
          dest: "/home/deployer/sites/foundation-docs/current",
          host: "deployer@foundation5.zurb.com"
        }
      }
    }
  });

  grunt.loadNpmTasks('assemble');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-newer');
  grunt.loadNpmTasks('grunt-rsync');
  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-contrib-jst');
  grunt.loadNpmTasks('grunt-autoprefixer');
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  grunt.task.registerTask('watch_start', ['karma:dev_watch:start', 'watch']);
  grunt.registerTask('build:assets', ['clean', 'sass', 'autoprefixer', 'cssmin', 'concat', 'uglify', 'copy', 'jst']);
  grunt.registerTask('build', ['build:assets', 'assemble']);
  grunt.registerTask('travis', ['build', 'karma:continuous']);
  grunt.registerTask('develop', ['travis', 'watch_start']);
  grunt.registerTask('deploy', ['build', 'rsync:dist']);
  grunt.registerTask('default', ['build', 'watch']);
};
<|endoftext|>


<commit_before>/**
 * This file is used to build Handsontable from `src/*`
 *
 * Installation:
 * 1. Install Grunt (`npm install -g grunt`)
 * 2. Install NPM packages from `devDependencies` section in package.json (`npm install`)
 *
 * Build:
 * Execute `grunt` from root directory of this directory (where grunt.js is)
 * To execute automatically after each change, execute `grunt --force default watch`
 *
 * Result:
 * building Handsontable will create files:
 *  - jquery.handsontable.js
 *  - jquery.handsontable.css
 *  - dist/jquery.handsontable.full.js
 *  - dist/jquery.handsontable.full.css
 *
 * See https://github.com/cowboy/grunt for more information
 */
module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      dist: {
        src: [
          'tmp/intro.js',

          'tmp/core.js',
          'src/tableView.js',
          'src/helpers.js',
          'src/fillHandle.js',
          'src/undoRedo.js',
          'src/selectionPoint.js',

          'src/renderers/textRenderer.js',
          'src/renderers/autocompleteRenderer.js',
          'src/renderers/checkboxRenderer.js',
          'src/renderers/numericRenderer.js',

          'src/editors/textEditor.js',
          'src/editors/autocompleteEditor.js',
          'src/editors/checkboxEditor.js',
          'src/editors/dateEditor.js',

          'src/cellTypes.js',

          'src/pluginHooks.js',
          'src/plugins/autoColumnSize.js',
          'src/plugins/columnSorting.js',
          'src/plugins/contextMenu.js',
          'src/plugins/legacy.js',
          'src/plugins/manualColumnMove.js',
          'src/plugins/manualColumnResize.js',

          'src/3rdparty/jquery.autoresize.js',
          'src/3rdparty/sheetclip.js',
          'src/3rdparty/walkontable.js',
          'src/3rdparty/copypaste.js',

          'src/outro.js'
        ],
        dest: 'jquery.handsontable.js'
      },
      full_js: {
        src: [
          'jquery.handsontable.js',
          'lib/bootstrap-typeahead.js',
          'lib/numeral.js',
          'lib/jQuery-contextMenu/jquery.contextMenu.js'
          //'lib/jQuery-contextMenu/jquery.ui.position.js' //seems to have no effect when turned off on contextmenu.html
        ],
        dest: 'dist/jquery.handsontable.full.js'
      },
      full_css: {
        src: [
          'jquery.handsontable.css',
          'lib/jQuery-contextMenu/jquery.contextMenu.css'
        ],
        dest: 'dist/jquery.handsontable.full.css'
      }
    },
    watch: {
      files: ['src/*', 'src/editors/*', 'src/plugins/*', 'src/renderers/*', 'src/3rdparty/*', 'src/css/*', 'lib/*'],
      tasks: ['replace', 'concat', 'clean']
    },
    clean: {
      dist: ['tmp']
    },
    replace: {
      dist: {
        options: {
          variables: {
            version: '<%= pkg.version %>',
            timestamp: '<%= (new Date()).toString() %>'
          }
        },
        files: {
          'tmp/intro.js': 'src/intro.js',
          'tmp/core.js': 'src/core.js',
          'jquery.handsontable.css': 'src/css/jquery.handsontable.css'
        }
      }
    }
  });

  // Default task.
  grunt.registerTask('default', ['replace', 'concat', 'clean']);

  grunt.loadNpmTasks('grunt-replace');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-watch');
};<commit_msg>changing paths back to `src` from `tmp` in Gruntfile<commit_after>/**
 * This file is used to build Handsontable from `src/*`
 *
 * Installation:
 * 1. Install Grunt (`npm install -g grunt`)
 * 2. Install NPM packages from `devDependencies` section in package.json (`npm install`)
 *
 * Build:
 * Execute `grunt` from root directory of this directory (where grunt.js is)
 * To execute automatically after each change, execute `grunt --force default watch`
 *
 * Result:
 * building Handsontable will create files:
 *  - jquery.handsontable.js
 *  - jquery.handsontable.css
 *  - dist/jquery.handsontable.full.js
 *  - dist/jquery.handsontable.full.css
 *
 * See https://github.com/cowboy/grunt for more information
 */
module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      dist: {
        src: [
          'src/intro.js',

          'src/core.js',
          'src/tableView.js',
          'src/helpers.js',
          'src/fillHandle.js',
          'src/undoRedo.js',
          'src/selectionPoint.js',

          'src/renderers/textRenderer.js',
          'src/renderers/autocompleteRenderer.js',
          'src/renderers/checkboxRenderer.js',
          'src/renderers/numericRenderer.js',

          'src/editors/textEditor.js',
          'src/editors/autocompleteEditor.js',
          'src/editors/checkboxEditor.js',
          'src/editors/dateEditor.js',

          'src/cellTypes.js',

          'src/pluginHooks.js',
          'src/plugins/autoColumnSize.js',
          'src/plugins/columnSorting.js',
          'src/plugins/contextMenu.js',
          'src/plugins/legacy.js',
          'src/plugins/manualColumnMove.js',
          'src/plugins/manualColumnResize.js',

          'src/3rdparty/jquery.autoresize.js',
          'src/3rdparty/sheetclip.js',
          'src/3rdparty/walkontable.js',
          'src/3rdparty/copypaste.js',

          'src/outro.js'
        ],
        dest: 'jquery.handsontable.js'
      },
      full_js: {
        src: [
          'jquery.handsontable.js',
          'lib/bootstrap-typeahead.js',
          'lib/numeral.js',
          'lib/jQuery-contextMenu/jquery.contextMenu.js'
          //'lib/jQuery-contextMenu/jquery.ui.position.js' //seems to have no effect when turned off on contextmenu.html
        ],
        dest: 'dist/jquery.handsontable.full.js'
      },
      full_css: {
        src: [
          'jquery.handsontable.css',
          'lib/jQuery-contextMenu/jquery.contextMenu.css'
        ],
        dest: 'dist/jquery.handsontable.full.css'
      }
    },
    watch: {
      files: ['src/*', 'src/editors/*', 'src/plugins/*', 'src/renderers/*', 'src/3rdparty/*', 'src/css/*', 'lib/*'],
      tasks: ['replace', 'concat', 'clean']
    },
    clean: {
      dist: ['tmp']
    },
    replace: {
      dist: {
        options: {
          variables: {
            version: '<%= pkg.version %>',
            timestamp: '<%= (new Date()).toString() %>'
          }
        },
        files: {
          'tmp/intro.js': 'src/intro.js',
          'tmp/core.js': 'src/core.js',
          'jquery.handsontable.css': 'src/css/jquery.handsontable.css'
        }
      }
    }
  });

  // Default task.
  grunt.registerTask('default', ['replace', 'concat', 'clean']);

  grunt.loadNpmTasks('grunt-replace');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-watch');
};<|endoftext|>


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

  grunt.loadNpmTasks('grunt-bump');

};<commit_msg>Travis CI support<commit_after>module.exports = function(grunt){

grunt.initConfig({
  license: {
    options: {
    	output: 'LICENSES'
    },
    your_target: {
    	output: 'LICENSES2'
    },
  },
})

  grunt.loadNpmTasks('grunt-bump');
  grunt.loadNpmTasks('grunt-license');

};<|endoftext|>


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

  var path = require('path');
  require('time-grunt')(grunt);

  require('load-grunt-config')(grunt, {
    // path to task.js files, defaults to grunt dir
    configPath: path.join(process.cwd(), 'grunt_modules')
  });

  grunt.registerTask('build', [
    'jshint',
    'clean',
    'ngtemplates',
    'concat',
    'copy:assets',
    'copy:htmlmocks',
    'ngdocs'
  ]);

  grunt.registerTask('dev', [
    'test',
    'build',
    'apimocker',
    'configureProxies:server',
    'connect:server',
    'watch'
  ]);

  grunt.registerTask('dev-docs', [
    'ngdocs',
    'connect:docs',
    'watch:docs'
  ]);

  grunt.registerTask('test', [
    'ngtemplates',
    'karma:helloWorld'
  ]);

  grunt.registerTask('default', [
    'deps-ok',
    'test',
    'build',
    'karma:dist'
  ]);
};
<commit_msg>switch grunt test to karma:all<commit_after>module.exports = function (grunt) {
  'use strict';

  var path = require('path');
  require('time-grunt')(grunt);

  require('load-grunt-config')(grunt, {
    // path to task.js files, defaults to grunt dir
    configPath: path.join(process.cwd(), 'grunt_modules')
  });

  grunt.registerTask('build', [
    'jshint',
    'clean',
    'ngtemplates',
    'concat',
    'copy:assets',
    'copy:htmlmocks',
    'ngdocs'
  ]);

  grunt.registerTask('dev', [
    'test',
    'build',
    'apimocker',
    'configureProxies:server',
    'connect:server',
    'watch'
  ]);

  grunt.registerTask('dev-docs', [
    'ngdocs',
    'connect:docs',
    'watch:docs'
  ]);

  grunt.registerTask('test', [
    'ngtemplates',
    'karma:all'
  ]);

  grunt.registerTask('default', [
    'deps-ok',
    'test',
    'build',
    'karma:dist'
  ]);
};
<|endoftext|>


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

      //Assemble *.js files
        concat: {
          main: {
            files: [{
              src: ['dev/js/*.js', '!dev/js/assembled.js'],
              dest: 'dev/js/assembled.js'
            }]
          },
          head: {
            files: [{
              src: ['dev/js/head/*.js', '!dev/js/head/head.js'],
              dest: 'dev/js/head/head.js'
            }]
          }
        },

      //Uglify assembled *.js file
        uglify: {
          options: {
            mangle: false
          },
          vendor: {
            files: [{
                expand: true,
                cwd: 'dev/js/vendor',
                src: '**/*.js',
                dest: 'build/js/vendor',
                ext: '.min.js'
            }]
          },
          main: {
              files: {
                  'build/js/assembled.min.js': 'dev/js/assembled.js'
              }
          },
          head: {
            files: {
                'build/js/head/head.min.js': 'dev/js/head/head.js'
            }
          }
        },

      //Compile *.scss files
        sass: {
          main: {
            options: {
              style: 'expanded',
              sourcemap: 'none'
            },
            files: [{
              expand: true,
              cwd: 'dev/styles',
              src: ['**/*.{sass,scss}', '!components/**/*.*'],
              dest: 'dev/css',
              ext: '.css'
            }]
          }
        },

      //Compile *.less files
        less: {
          main: {
            files: [{
              expand: true,
              cwd: 'dev/styles',
              src: ['**/*.less', '!components/**/*.*'],
              dest: 'dev/css',
              ext: '.css'
            }]
          }
        },

      //Combine media queries in result *.css files
        cmq: {
          options: {
            log: false
          },
          main: {
            files: {
              'dev/css': ['dev/css/*.css']
            }
          }
        },

      //Autoprefixer
        autoprefixer: {
          options: {
            browsers: ['last 2 versions', 'ie 8', 'ie 9']
            //By default >1%, last 2 versions, Firefox ESR, Opera 12.1;
          },
          main: {
            files:[{
              expand: true,
              flatten: true,
              src: 'dev/css/*.css',
              dest: 'dev/css/'
            }]
          }
        },

      //Minify and organize *.css files
        csso: {
          options: {
            keepSpecialComments: '*'
          },
          main: {
            files:[{
              expand: true,
              cwd: 'dev/css/',
              src: ['*.css', '!*.min.css'],
              dest: 'build/css/',
              ext: '.min.css'
            }]
          }
        },

      //Compile *.jade files
        jade: {
          main: {
            options: {
                client: false,
                pretty: true
            },
            files: [ {
              cwd: "dev/markup",
              src: ['**/*.jade', '!components/**/*.*'],
              dest: "dev/html/",
              expand: true,
              ext: ".html"
            } ]
          }
        },

      //Compile *.haml files
        haml: {
          main: {
            files: [ {
              cwd: "dev/markup",
              src: ['**/*.haml', '!components/**/*.*'],
              dest: "dev/html/",
              expand: true,
              ext: ".html"
            } ]
          }
        },

      //Minify *.html files
        htmlmin: {
            main: {
              options: {
                collapseWhitespace: true,
                minifyJS: true,
                minifyCSS: true
              },
              files: [ {
                cwd: "dev/html",
                src: "*.html",
                dest: "build/",
                expand: true,
                ext: ".html"
              } ]
            }
        },

      //Minify image files
        imagemin: {
          main: {
            options: {
              optimizationLevel: 7
            },
            files: [{
              expand: true,
              cwd: 'dev/img',
              src: ['**/*.{png,jpg,gif}'],
              dest: 'build/img/'
            }]
          }
        },

      //Copy some folders or files (ex. *.php) from dev to build
        copy: {
          php: {
            files: [{
              expand: true,
              cwd: 'dev/php/',
              src: '**',
              dest: 'build/php/'
            }]
          },
          fonts: {
            files: [{
              expand: true,
              cwd: 'dev/fonts/',
              src: ['**/*.{eot,svg,ttf,woff}'],
              dest: 'build/fonts/'
            }]
          },
          js: {
            files: [{
              expand: true,
              cwd: 'dev/js/',
              src: [
                '**/assembled.js',
                '**/vendor.js',
                '**/head.js'],
              dest: 'build/js/'
            }]
          },
          livejs: {
            files: [{
              expand: true,
              cwd: 'dev/devtools/',
              src: '**/live.js',
              dest: 'build/js/'
            }]
          },
          css: {
            files: [{
              expand: true,
              cwd: 'dev/css',
              src: ['**/*.css'],
              dest: 'build/css/'
            }]
          },
          html: {
            files: [{
              expand: true,
              cwd: 'dev/html',
              src: ['**/*.html'],
              dest: 'build/'
            }]
          },
          helpers: {
            files: [{
              expand: true,
              cwd: 'dev/main/helpers',
              src: ['**/*.*', '**/.htaccess'],
              dest: 'build'
            }]
          }
        },

      //Assemble bower components in right order
        bower_concat: {
          main: {
            dest: 'dev/js/vendor/vendor.js'
          }
        },

      //Copy bower components to the custom folder
        // bowercopy: {
        //   options: {
        //     clean: true,
        //     ignore: ['modernizr']
        //   },
        //   jquery: {
        //     options: {
        //         destPrefix: 'dev/js/vendor'
        //     },
        //     files: {
        //       'jquery': 'jquery/dist/jquery.js'
        //     },
        //   }
        // },

      //Delete .gitkeep files. If you don't use Bower - just run `grunt clean`
        clean: {
          gitkeep: ['dev/**/.gitkeep', 'build/**/.gitkeep'],
          less: 'dev/**/*.less',
          sass: 'dev/**/*.scss',
          haml: 'dev/**/*.haml',
          jade: 'dev/**/*.jade',
          debug: ['build/js/**/*.js',
                  '!build/js/**/*.min.js',
                  'build/css/**/*.css',
                  '!build/css/**/*.min.css'],
          bower: 'bower_components'
        },

      //Delete some dev code and references from files
        processhtml: {
          dist: {
            files: {
              'dev/html/index.html': 'dev/html/index.html'
            }
          }
        },

      //Watch for changes
        watch: {
          all: {
            files: ['dev/html/**/*.html',
                    'dev/styles/**/*.{scss,less}',
                    'dev/css/*.css',
                    'dev/js/**/*.js',
                    'dev/img/**/*.{png,jpg,gif}',
                    'dev/markup/**/*.{haml,jade}',
                    'dev/php/**/*.php',
                    'dev/fonts/**/*.{eot,svg,ttf,woff}'],
            tasks: ['default'],
            options: {
              spawn: false,
            },
          },
        }

    });

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-combine-media-queries');
    grunt.loadNpmTasks('grunt-autoprefixer');
    grunt.loadNpmTasks('grunt-csso');
    grunt.loadNpmTasks('grunt-contrib-jade');
    grunt.loadNpmTasks('grunt-haml2html');
    grunt.loadNpmTasks('grunt-contrib-htmlmin');
    grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-newer');

    grunt.loadNpmTasks('grunt-bower-concat');
    // grunt.loadNpmTasks('grunt-bowercopy');
    grunt.loadNpmTasks('grunt-contrib-clean');

    grunt.loadNpmTasks('grunt-preprocess');

    grunt.registerTask('default', ['newer:concat',
                                   'newer:sass',
                                   'newer:less',
                                   'newer:jade',
                                   'newer:haml',
                                   'preprocess',
                                   'newer:imagemin',
                                   'newer:copy',
                                   'watch'
    ]);

    grunt.registerTask('bower-dev', ['bower_concat',
                                     // 'bowercopy',
                                     'clean:gitkeep',
                                     'clean:bower'
    ]);

    grunt.registerTask('build', ['processhtml',
                                 'cmq',
                                 'autoprefixer',
                                 'uglify',
                                 'csso',
                                 'htmlmin',
                                 'clean:debug'
    ]);
};<commit_msg>minor processhtml fixes<commit_after>module.exports = function(grunt) {
    grunt.initConfig({

      //Assemble *.js files
        concat: {
          main: {
            files: [{
              src: ['dev/js/*.js', '!dev/js/assembled.js'],
              dest: 'dev/js/assembled.js'
            }]
          },
          head: {
            files: [{
              src: ['dev/js/head/*.js', '!dev/js/head/head.js'],
              dest: 'dev/js/head/head.js'
            }]
          }
        },

      //Uglify assembled *.js file
        uglify: {
          options: {
            mangle: false
          },
          vendor: {
            files: [{
                expand: true,
                cwd: 'dev/js/vendor',
                src: '**/*.js',
                dest: 'build/js/vendor',
                ext: '.min.js'
            }]
          },
          main: {
              files: {
                  'build/js/assembled.min.js': 'dev/js/assembled.js'
              }
          },
          head: {
            files: {
                'build/js/head/head.min.js': 'dev/js/head/head.js'
            }
          }
        },

      //Compile *.scss files
        sass: {
          main: {
            options: {
              style: 'expanded',
              sourcemap: 'none'
            },
            files: [{
              expand: true,
              cwd: 'dev/styles',
              src: ['**/*.{sass,scss}', '!components/**/*.*'],
              dest: 'dev/css',
              ext: '.css'
            }]
          }
        },

      //Compile *.less files
        less: {
          main: {
            files: [{
              expand: true,
              cwd: 'dev/styles',
              src: ['**/*.less', '!components/**/*.*'],
              dest: 'dev/css',
              ext: '.css'
            }]
          }
        },

      //Combine media queries in result *.css files
        cmq: {
          options: {
            log: false
          },
          main: {
            files: {
              'dev/css': ['dev/css/*.css']
            }
          }
        },

      //Autoprefixer
        autoprefixer: {
          options: {
            browsers: ['last 2 versions', 'ie 8', 'ie 9']
            //By default >1%, last 2 versions, Firefox ESR, Opera 12.1;
          },
          main: {
            files:[{
              expand: true,
              flatten: true,
              src: 'dev/css/*.css',
              dest: 'dev/css/'
            }]
          }
        },

      //Minify and organize *.css files
        csso: {
          options: {
            keepSpecialComments: '*'
          },
          main: {
            files:[{
              expand: true,
              cwd: 'dev/css/',
              src: ['*.css', '!*.min.css'],
              dest: 'build/css/',
              ext: '.min.css'
            }]
          }
        },

      //Compile *.jade files
        jade: {
          main: {
            options: {
                client: false,
                pretty: true
            },
            files: [ {
              cwd: "dev/markup",
              src: ['**/*.jade', '!components/**/*.*'],
              dest: "dev/html/",
              expand: true,
              ext: ".html"
            } ]
          }
        },

      //Compile *.haml files
        haml: {
          main: {
            files: [ {
              cwd: "dev/markup",
              src: ['**/*.haml', '!components/**/*.*'],
              dest: "dev/html/",
              expand: true,
              ext: ".html"
            } ]
          }
        },

      //Minify *.html files
        htmlmin: {
            main: {
              options: {
                collapseWhitespace: true,
                minifyJS: true,
                minifyCSS: true
              },
              files: [ {
                cwd: "dev/html",
                src: "*.html",
                dest: "build/",
                expand: true,
                ext: ".html"
              } ]
            }
        },

      //Minify image files
        imagemin: {
          main: {
            options: {
              optimizationLevel: 7
            },
            files: [{
              expand: true,
              cwd: 'dev/img',
              src: ['**/*.{png,jpg,gif}'],
              dest: 'build/img/'
            }]
          }
        },

      //Copy some folders or files (ex. *.php) from dev to build
        copy: {
          php: {
            files: [{
              expand: true,
              cwd: 'dev/php/',
              src: '**',
              dest: 'build/php/'
            }]
          },
          fonts: {
            files: [{
              expand: true,
              cwd: 'dev/fonts/',
              src: ['**/*.{eot,svg,ttf,woff}'],
              dest: 'build/fonts/'
            }]
          },
          js: {
            files: [{
              expand: true,
              cwd: 'dev/js/',
              src: [
                '**/assembled.js',
                '**/vendor.js',
                '**/head.js'],
              dest: 'build/js/'
            }]
          },
          livejs: {
            files: [{
              expand: true,
              cwd: 'dev/devtools/',
              src: '**/live.js',
              dest: 'build/js/'
            }]
          },
          css: {
            files: [{
              expand: true,
              cwd: 'dev/css',
              src: ['**/*.css'],
              dest: 'build/css/'
            }]
          },
          html: {
            files: [{
              expand: true,
              cwd: 'dev/html',
              src: ['**/*.html'],
              dest: 'build/'
            }]
          },
          helpers: {
            files: [{
              expand: true,
              cwd: 'dev/main/helpers',
              src: ['**/*.*', '**/.htaccess'],
              dest: 'build'
            }]
          }
        },

      //Assemble bower components in right order
        bower_concat: {
          main: {
            dest: 'dev/js/vendor/vendor.js'
          }
        },

      //Copy bower components to the custom folder
        // bowercopy: {
        //   options: {
        //     clean: true,
        //     ignore: ['modernizr']
        //   },
        //   jquery: {
        //     options: {
        //         destPrefix: 'dev/js/vendor'
        //     },
        //     files: {
        //       'jquery': 'jquery/dist/jquery.js'
        //     },
        //   }
        // },

      //Delete .gitkeep files. If you don't use Bower - just run `grunt clean`
        clean: {
          gitkeep: ['dev/**/.gitkeep', 'build/**/.gitkeep'],
          less: 'dev/**/*.less',
          sass: 'dev/**/*.scss',
          haml: 'dev/**/*.haml',
          jade: 'dev/**/*.jade',
          debug: ['build/js/**/*.js',
                  '!build/js/**/*.min.js',
                  'build/css/**/*.css',
                  '!build/css/**/*.min.css'],
          bower: 'bower_components'
        },

      //Delete some dev code and references from files
        processhtml: {
          dist: {
            files: [{
              expand: true,
              cwd: 'dev/html',
              src: ['**/*.html'],
              dest: 'dev/html',
              ext: '.html'
            }],
          }
        },

      //Watch for changes
        watch: {
          all: {
            files: ['dev/html/**/*.html',
                    'dev/styles/**/*.{scss,less}',
                    'dev/css/*.css',
                    'dev/js/**/*.js',
                    'dev/img/**/*.{png,jpg,gif}',
                    'dev/markup/**/*.{haml,jade}',
                    'dev/php/**/*.php',
                    'dev/fonts/**/*.{eot,svg,ttf,woff}'],
            tasks: ['default'],
            options: {
              spawn: false,
            },
          },
        }

    });

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-combine-media-queries');
    grunt.loadNpmTasks('grunt-autoprefixer');
    grunt.loadNpmTasks('grunt-csso');
    grunt.loadNpmTasks('grunt-contrib-jade');
    grunt.loadNpmTasks('grunt-haml2html');
    grunt.loadNpmTasks('grunt-contrib-htmlmin');
    grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-newer');

    grunt.loadNpmTasks('grunt-bower-concat');
    // grunt.loadNpmTasks('grunt-bowercopy');
    grunt.loadNpmTasks('grunt-contrib-clean');

    grunt.loadNpmTasks('grunt-processhtml');

    grunt.registerTask('default', ['newer:concat',
                                   'newer:sass',
                                   'newer:less',
                                   'newer:jade',
                                   'newer:haml',
                                   'preprocess',
                                   'newer:imagemin',
                                   'newer:copy',
                                   'watch'
    ]);

    grunt.registerTask('bower-dev', ['bower_concat',
                                     // 'bowercopy',
                                     'clean:gitkeep',
                                     'clean:bower'
    ]);

    grunt.registerTask('build', ['processhtml',
                                 'cmq',
                                 'autoprefixer',
                                 'uglify',
                                 'csso',
                                 'htmlmin',
                                 'clean:debug'
    ]);
};<|endoftext|>


<commit_before>module.exports = function(grunt) {
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-mocha-cov');
  grunt.loadTasks('tasks');

  grunt.initConfig({
    jshint: {
      options: {
        reporter: require('jshint-stylish'),
        eqeqeq: true,
        es3: true,
        indent: 2,
        newcap: true,
        quotmark: 'single'
      },
      all: ['tasks/*.js']
    },
    mochacov: {
      lcov: {
        options: {
          reporter: 'mocha-lcov-reporter',
          instrument: true,
          ui: 'mocha-given',
          require: 'coffee-script/register',
          output: 'coverage/coverage.lcov'
        },
        src: ['test/helpers.coffee', 'test/**/*.coffee', '!test/acceptance.coffee'],
      },
      html: {
        options: {
          reporter: 'html-cov',
          ui: 'mocha-given',
          require: 'coffee-script/register',
          output: 'coverage/coverage.html'
        },
        src: ['test/helpers.coffee', 'test/**/*.coffee', '!test/acceptance.coffee']
      }
    },
    mochaTest: {
      options: {
        reporter: 'spec',
        ui: 'mocha-given',
        require: 'coffee-script/register'
      },
      unit: {
        src: ['test/helpers.coffee', 'test/**/*.coffee', '!test/acceptance.coffee']
      },
      e2e: {
        options: {
          timeout: 10000
        },
        src: ['test/acceptance.coffee']
      }
    },
    npm: {
      setEmail: {
        cmd: 'config set email tandrewnichols@gmail.com'
      },
      config: {
        cmd: 'config get email'
      },
      ls: {
        options: {
          json: true,
          depth: 0
        }
      }
    },
    travis: {
      options: {
        targets: {
          test: '{{ version }}',
          when: 'v0.10',
          tasks: ['mochacov:lcov', 'matrix:v0.10']
        }
      }
    },
    matrix: {
      'v0.10': 'codeclimate < coverage/coverage.lcov'
    }
  });

  grunt.registerTask('mocha', ['mochaTest']);
  grunt.registerTask('default', ['jshint:all', 'mocha']);
  grunt.registerTask('coverage', ['mochacov:html']);
  grunt.registerTask('ci', ['jshint:all', 'mocha', 'travis']);
};
<commit_msg>Call loadNpmTasks<commit_after>module.exports = function(grunt) {
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-mocha-cov');
  grunt.loadNpmTasks('grunt-travis-matrix');
  grunt.loadTasks('tasks');

  grunt.initConfig({
    jshint: {
      options: {
        reporter: require('jshint-stylish'),
        eqeqeq: true,
        es3: true,
        indent: 2,
        newcap: true,
        quotmark: 'single'
      },
      all: ['tasks/*.js']
    },
    mochacov: {
      lcov: {
        options: {
          reporter: 'mocha-lcov-reporter',
          instrument: true,
          ui: 'mocha-given',
          require: 'coffee-script/register',
          output: 'coverage/coverage.lcov'
        },
        src: ['test/helpers.coffee', 'test/**/*.coffee', '!test/acceptance.coffee'],
      },
      html: {
        options: {
          reporter: 'html-cov',
          ui: 'mocha-given',
          require: 'coffee-script/register',
          output: 'coverage/coverage.html'
        },
        src: ['test/helpers.coffee', 'test/**/*.coffee', '!test/acceptance.coffee']
      }
    },
    mochaTest: {
      options: {
        reporter: 'spec',
        ui: 'mocha-given',
        require: 'coffee-script/register'
      },
      unit: {
        src: ['test/helpers.coffee', 'test/**/*.coffee', '!test/acceptance.coffee']
      },
      e2e: {
        options: {
          timeout: 10000
        },
        src: ['test/acceptance.coffee']
      }
    },
    npm: {
      setEmail: {
        cmd: 'config set email tandrewnichols@gmail.com'
      },
      config: {
        cmd: 'config get email'
      },
      ls: {
        options: {
          json: true,
          depth: 0
        }
      }
    },
    travis: {
      options: {
        targets: {
          test: '{{ version }}',
          when: 'v0.10',
          tasks: ['mochacov:lcov', 'matrix:v0.10']
        }
      }
    },
    matrix: {
      'v0.10': 'codeclimate < coverage/coverage.lcov'
    }
  });

  grunt.registerTask('mocha', ['mochaTest']);
  grunt.registerTask('default', ['jshint:all', 'mocha']);
  grunt.registerTask('coverage', ['mochacov:html']);
  grunt.registerTask('ci', ['jshint:all', 'mocha', 'travis']);
};
<|endoftext|>


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

  grunt.initConfig({
    /**
     * Variable initialized with the contents of the package.json file
     */
    pkg: grunt.file.readJSON('package.json'),

    /**
     * Meta information used in different tasks
     */
    meta: {
      /**
       * Copyright and license banner
       */
      woodman: 'Woodman - v<%= pkg.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
        ' Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
        ' MIT license\n' +
        ' <%= pkg.homepage %>\n',
      log4j: 'Based on Apache Log4j 2\n' +
        ' Copyright © 1999-2013 Apache Software Foundation. All Rights Reserved.\n' +
        ' Apache License, Version 2.0\n' +
        ' http://logging.apache.org/log4j/2.x/\n',
      requirejs: 'Built with RequireJS optimizer r.js 2.1.2\n' +
        ' Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.\n' +
        ' new BSD or MIT licensed\n' +
        ' http://github.com/jrburke/requirejs\n',
      almond: 'Includes Almond 0.2.3\n' +
        ' Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved\n' +
        ' Available via the MIT or new BSD license\n' +
        ' http://github.com/jrburke/almond\n',
      socketio: 'Includes Socket.IO.js build:0.9.11, development\n' +
        ' Copyright(c) 2011 LearnBoost <dev@learnboost.com>\n' +
        ' MIT Licensed\n',
      log4javascript: 'Portions adapted from log4javascript\n' +
        ' Copyright Tim Down\n' +
        ' Apache License, Version 2.0\n' +
        ' http://log4javascript.org/\n',
      fullBanner: '/*!\n' +
        '<%= meta.woodman %>' +
        '\n<%= meta.log4j %>' +
        '\n<%= meta.requirejs %>' +
        '\n<%= meta.almond %>' +
        '\n<%= meta.socketio %>' +
        '\n<%= meta.log4javascript %>' +
        '*/\n',
      disabledBanner: '/*!\n' +
        '<%= meta.woodman %>' +
        '\n<%= meta.log4j %>' +
        '\n<%= meta.requirejs %>' +
        '*/\n',
      consoleBanner: '/*!\n' +
        '<%= meta.woodman %>' +
        '\n<%= meta.log4j %>' +
        '\n<%= meta.requirejs %>' +
        '\n<%= meta.almond %>' +
        '\n<%= meta.log4javascript %>' +
        '*/\n'
    },

    /**
     * Ensures source code follows code guidelines
     */
    jshint: {
      options: {
        indent: 2,
        evil: true,
        regexdash: true,
        browser: true,
        wsh: false,
        trailing: true,
        sub: true,
        undef: true,
        eqeqeq: true,
        unused: true,
        predef: [
          'require'
        ]
      },
      all: [
        'Gruntfile.js',
        'lib/**/*.js'
      ]
    },

    /**
     * Woodman compilation task (using require.js optimizer)
     *
     * There are a number of distributions available. Differences between
     * distributions include:
     * - the list of appenders and layouts supported by default
     * - how the Woodman library gets exposed to the global scope
     * (global variable, named AMD module, anonymous AMD module)
     */
    requirejs: {
      /**
       * Global standalone distribution that includes all known appenders and
       * layouts. Some of them may not work depending on the environment under
       * which the distribution is run.
       *
       * The Woodman library is exposed as:
       * - window.woodman (client-side) or to the global "this" scope (node.js)
       * - a named AMD module "woodman" if "define" is defined
       * - a node.js module if "module" is defined
       *
       * Note the "require" call with the fourth parameter set to "true" to
       * force synchronous load of modules.
       */
      woodman: {
        options: {
          wrap: {
            start: '/*! Full distribution */\n' +
              '(function(root, rootDefine, rootRequire, rootModule) {\n',
            end: 'require(["./woodman"], function (woodman) {\n' +
              '  if (rootDefine) rootDefine(woodman);\n' +
              '  if (root) root.woodman = woodman;\n' +
              '  if (rootModule) rootModule.exports = woodman;\n' +
              '}, null, true);\n' +
              '}(((typeof window !== "undefined") ? window : this),' +
              ' ((typeof define === "function") ? define : null),' +
              ' ((typeof require === "function") ? require : null),' +
              ' ((typeof module !== "undefined") ? module : null)' +
              '));'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman'],
          out: 'dist/woodman.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Same as above but the Woodman library is only exposed as an anonymous
       * AMD module.
       *
       * In particular, the library does not leak anything to the global scope
       * in that distribution (but "define" needs to be defined).
       */
      'woodman-amd': {
        options: {
          wrap: {
            start: '/*! Full distribution, AMD module */\n' +
              '(function(rootDefine, rootRequire) {\n',
            end: 'require(["./woodman"], function (woodman) {\n' +
              '  if (rootDefine) rootDefine(woodman);\n' +
              '}, null, true);\n' +
              '}(((typeof define === "function") ? define : null),' +
              ' ((typeof require === "function") ? require : null))' +
              ');'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman'],
          out: 'dist/woodman-amd.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Standalone distribution for browsers. Available appenders are those
       * that run in Web browsers.
       *
       * The Woodman library is exposed as window.woodman in that distribution.
       */
      browser: {
        options: {
          wrap: {
            start: '/*! Browser distribution */\n' +
              '(function () {\n',
            end: 'require(["./woodman-browser"], function (woodman) {' +
              '  window.woodman = woodman;\n' +
              '}, null, true);\n' +
              '}());'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-browser'],
          out: 'dist/woodman-browser.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Same as above but the Woodman library is only exposed as an anonymous
       * AMD module.
       *
       * In particular, the library does not leak anything to the global scope
       * in that distribution (but "define" needs to be defined).
       */
      'browser-amd': {
        options: {
          wrap: {
            start: '/*! Browser distribution, AMD module */\n' +
              'define([], function () {\n',
            end: '  var woodman = null;\n' +
              '  require(["./woodman-browser"], function (wood) {\n' +
              '    woodman = wood;\n' +
              '  }, null, true);\n' +
              '  return woodman;\n' +
              '});'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-browser'],
          out: 'dist/woodman-browser-amd.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Standalone compilation for execution in node.js. Available appenders
       * are those that run in the node.js environment.
       *
       * The Woodman library is exposed as a regular node.js module.
       */
      node: {
        options: {
          wrap: {
            start: '/*! Node.js distribution */\n' +
              '(function(rootRequire) {\n',
            end: 'require(["./woodman-node"], function (woodman) {\n' +
              '  module.exports = woodman; }, null, true);\n' +
              '}(require));'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-node'],
          out: 'dist/woodman-node.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Same as above but the Woodman library is only exposed as an anonymous
       * AMD module.
       */
      'node-amd': {
        options: {
          wrap: {
            start: '/*! Node.js distribution, AMD module */\n' +
              '(function(rootDefine, rootRequire) {\n',
            end: 'require(["./woodman-node"], function (woodman) {\n' +
              '  if (rootDefine) rootDefine(woodman);\n' +
              '}, null, true);\n' +
              '}(((typeof define === "function") ? define : null),' +
              ' ((typeof require === "function") ? require : null))' +
              ');'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-node'],
          out: 'dist/woodman-node-amd.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Standalone minimal distribution that only supports the "Console"
       * appender.
       *
       * In particular, the library does not leak anything to the global scope
       * in that distribution (but "define" needs to be defined).
       */
      'woodman-console': {
        options: {
          wrap: {
            start: '/*! Console-only distribution */\n' +
              '(function(root, rootDefine, rootRequire, rootModule) {\n',
            end: 'require(["./woodman-console"], function (woodman) {\n' +
              '  if (rootDefine) rootDefine(woodman);\n' +
              '  if (root) root.woodman = woodman;\n' +
              '  if (rootModule) rootModule.exports = woodman;\n' +
              '}, null, true);\n' +
              '}(((typeof window !== "undefined") ? window : this),' +
              ' ((typeof define === "function") ? define : null),' +
              ' ((typeof require === "function") ? require : null),' +
              ' ((typeof module !== "undefined") ? module : null)' +
              '));'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-console'],
          out: 'dist/woodman-console.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Global standalone distribution that only includes Woodman's "disabled"
       * shim, for use in production environments instead of the generic Woodman
       * distribution to suppress all traces.
       */
      disabled: {
        options: {
          wrap: {
            start: '/*! Disabled distribution */\n' +
              '(function(root, rootdefine) {\n' +
              'var woodman = null;\n' +
              'var define = function (name, deps, fn) { woodman = fn(); };\n',
            end: '\n' +
              'if (rootdefine) rootdefine("woodman", woodman);\n' +
              'else if ((typeof module !== "undefined") && module.exports) {\n' +
              ' rootdefine = require("amdefine")(module);\n' +
              ' rootdefine(woodman);\n' +
              '}\n' +
              'if (root) root.woodman = woodman;\n' +
              '}((typeof window !== "undefined") ? window : this,' +
              ' (typeof define === "function") ? define : null));'
          },
          baseUrl: 'lib/',
          name: 'woodman-disabled',
          out: 'dist/woodman-disabled.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      }
    },

    /**
     * Adds Copyright and license banner to all distributions
     */
    concat: {
      options: {
        stripBanners: true,
        banner: '<%= meta.fullBanner %>'
      },
      woodman: {
        src: 'dist/woodman.js',
        dest: 'dist/woodman.js'
      },
      'woodman-amd': {
        src: 'dist/woodman-amd.js',
        dest: 'dist/woodman-amd.js'
      },
      browser: {
        src: 'dist/woodman-browser.js',
        dest: 'dist/woodman-browser.js'
      },
      'browser-amd': {
        src: 'dist/woodman-browser-amd.js',
        dest: 'dist/woodman-browser-amd.js'
      },
      node: {
        src: 'dist/woodman-node.js',
        dest: 'dist/woodman-node.js'
      },
      'node-amd': {
        src: 'dist/woodman-node-amd.js',
        dest: 'dist/woodman-node-amd.js'
      },
      'woodman-console': {
        options: {
          banner: '<%= meta.consoleBanner %>'
        },
        src: 'dist/woodman-console.js',
        dest: 'dist/woodman-console.js'
      },
      disabled: {
        options: {
          banner: '<%= meta.disabledBanner %>'
        },
        src: 'dist/woodman-disabled.js',
        dest: 'dist/woodman-disabled.js'
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-jshint');

  grunt.registerTask('build', ['jshint', 'requirejs', 'concat']);
  grunt.registerTask('default', 'build');
};
<commit_msg>Fixed distributions to expose AMD modules that r.js can pick up (#20)<commit_after>/*global module:false*/
module.exports = function (grunt) {

  grunt.initConfig({
    /**
     * Variable initialized with the contents of the package.json file
     */
    pkg: grunt.file.readJSON('package.json'),

    /**
     * Meta information used in different tasks
     */
    meta: {
      /**
       * Copyright and license banner
       */
      woodman: 'Woodman - v<%= pkg.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
        ' Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
        ' MIT license\n' +
        ' <%= pkg.homepage %>\n',
      log4j: 'Based on Apache Log4j 2\n' +
        ' Copyright © 1999-2013 Apache Software Foundation. All Rights Reserved.\n' +
        ' Apache License, Version 2.0\n' +
        ' http://logging.apache.org/log4j/2.x/\n',
      requirejs: 'Built with RequireJS optimizer r.js 2.1.2\n' +
        ' Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.\n' +
        ' new BSD or MIT licensed\n' +
        ' http://github.com/jrburke/requirejs\n',
      almond: 'Includes Almond 0.2.3\n' +
        ' Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved\n' +
        ' Available via the MIT or new BSD license\n' +
        ' http://github.com/jrburke/almond\n',
      socketio: 'Includes Socket.IO.js build:0.9.11, development\n' +
        ' Copyright(c) 2011 LearnBoost <dev@learnboost.com>\n' +
        ' MIT Licensed\n',
      log4javascript: 'Portions adapted from log4javascript\n' +
        ' Copyright Tim Down\n' +
        ' Apache License, Version 2.0\n' +
        ' http://log4javascript.org/\n',
      fullBanner: '/*!\n' +
        '<%= meta.woodman %>' +
        '\n<%= meta.log4j %>' +
        '\n<%= meta.requirejs %>' +
        '\n<%= meta.almond %>' +
        '\n<%= meta.socketio %>' +
        '\n<%= meta.log4javascript %>' +
        '*/\n',
      disabledBanner: '/*!\n' +
        '<%= meta.woodman %>' +
        '\n<%= meta.log4j %>' +
        '\n<%= meta.requirejs %>' +
        '*/\n',
      consoleBanner: '/*!\n' +
        '<%= meta.woodman %>' +
        '\n<%= meta.log4j %>' +
        '\n<%= meta.requirejs %>' +
        '\n<%= meta.almond %>' +
        '\n<%= meta.log4javascript %>' +
        '*/\n'
    },

    /**
     * Ensures source code follows code guidelines
     */
    jshint: {
      options: {
        indent: 2,
        evil: true,
        regexdash: true,
        browser: true,
        wsh: false,
        trailing: true,
        sub: true,
        undef: true,
        eqeqeq: true,
        unused: true,
        predef: [
          'require'
        ]
      },
      all: [
        'Gruntfile.js',
        'lib/**/*.js'
      ]
    },

    /**
     * Woodman compilation task (using require.js optimizer)
     *
     * There are a number of distributions available. Differences between
     * distributions include:
     * - the list of appenders and layouts supported by default
     * - how the Woodman library gets exposed to the global scope
     * (global variable, named AMD module, anonymous AMD module)
     */
    requirejs: {
      /**
       * Global standalone distribution that includes all known appenders and
       * layouts. Some of them may not work depending on the environment under
       * which the distribution is run.
       *
       * The Woodman library is exposed as:
       * - window.woodman (client-side) or to the global "this" scope (node.js)
       * - an anonymous AMD module if "define" is defined
       * - a node.js module if "module" is defined
       *
       * Note the "require" call with the fourth parameter set to "true" to
       * force synchronous load of modules. Also note that the call to "define"
       * is made outside at the global level (instead of within the "require"
       * callback) because RequireJS r.js optimizer would miss it otherwise
       * if it is run against that distribution (to build an app that uses
       * Woodman).
       */
      woodman: {
        options: {
          wrap: {
            start: '/*! Full distribution */\n' +
              '(function (root, rootRequire, rootModule) {\n',
            end: 'require(["./woodman"], function (woodman) {\n' +
              '  if (root) root.woodman = woodman;\n' +
              '  if (rootModule) rootModule.exports = woodman;\n' +
              '}, null, true);\n' +
              '}(((typeof window !== "undefined") ? window : this),' +
              ' ((typeof require === "function") ? require : null),' +
              ' ((typeof module !== "undefined") ? module : null)' +
              '));\n' +
              'if (typeof define === "function") {\n' +
              '  define([], ((typeof window !== "undefined") ? window : this).woodman);\n' +
              '};'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman'],
          out: 'dist/woodman.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Same as above but the Woodman library is only exposed as an anonymous
       * AMD module.
       *
       * In particular, the library does not leak anything to the global scope
       * in that distribution (but "define" needs to be defined).
       */
      'woodman-amd': {
        options: {
          wrap: {
            start: '/*! Full distribution, AMD module */\n' +
              '(function (rootRequire) {\n' +
              '  define([], function () {\n',
            end: '    var woodman = null;\n' +
              '    require(["./woodman"], function (wood) {\n' +
              '      woodman = wood;\n' +
              '    }, null, true);\n' +
              '    return woodman;\n' +
              '  });\n' +
              '})((typeof require === "function") ? require : null);'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman'],
          out: 'dist/woodman-amd.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Standalone distribution for browsers. Available appenders are those
       * that run in Web browsers.
       *
       * The Woodman library is exposed as window.woodman in that distribution.
       */
      browser: {
        options: {
          wrap: {
            start: '/*! Browser distribution */\n' +
              '(function () {\n',
            end: '  require(["./woodman-browser"], function (woodman) {' +
              '    window.woodman = woodman;\n' +
              '  }, null, true);\n' +
              '}());'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-browser'],
          out: 'dist/woodman-browser.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Same as above but the Woodman library is only exposed as an anonymous
       * AMD module.
       *
       * In particular, the library does not leak anything to the global scope
       * in that distribution (but "define" needs to be defined).
       */
      'browser-amd': {
        options: {
          wrap: {
            start: '/*! Browser distribution, AMD module */\n' +
              'define([], function () {\n',
            end: '  var woodman = null;\n' +
              '  require(["./woodman-browser"], function (wood) {\n' +
              '    woodman = wood;\n' +
              '  }, null, true);\n' +
              '  return woodman;\n' +
              '});'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-browser'],
          out: 'dist/woodman-browser-amd.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Standalone compilation for execution in node.js. Available appenders
       * are those that run in the node.js environment.
       *
       * The Woodman library is exposed as a regular node.js module.
       */
      node: {
        options: {
          wrap: {
            start: '/*! Node.js distribution */\n' +
              '(function(rootRequire) {\n',
            end: '  require(["./woodman-node"], function (woodman) {\n' +
              '    module.exports = woodman;\n' +
              '  }, null, true);\n' +
              '}(require));'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-node'],
          out: 'dist/woodman-node.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Same as above but the Woodman library is only exposed as an anonymous
       * AMD module.
       */
      'node-amd': {
        options: {
          wrap: {
            start: '/*! Node.js distribution, AMD module */\n' +
              '(function (rootRequire) {\n' +
              '  define([], function () {\n',
            end: '    var woodman = null;\n' +
              '    require(["./woodman-node"], function (wood) {\n' +
              '      woodman = wood;\n' +
              '    }, null, true);\n' +
              '    return woodman;\n' +
              '  });\n' +
              '})((typeof require === "function") ? require : null);'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-node'],
          out: 'dist/woodman-node-amd.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Standalone minimal distribution that only supports the "Console"
       * appender.
       *
       * In particular, the library does not leak anything to the global scope
       * in that distribution (but "define" needs to be defined).
       */
      'woodman-console': {
        options: {
          wrap: {
            start: '/*! Console-only distribution */\n' +
              '(function (root, rootRequire, rootModule) {\n',
            end: 'require(["./woodman-console"], function (woodman) {\n' +
              '  if (root) root.woodman = woodman;\n' +
              '  if (rootModule) rootModule.exports = woodman;\n' +
              '}, null, true);\n' +
              '}(((typeof window !== "undefined") ? window : this),' +
              ' ((typeof require === "function") ? require : null),' +
              ' ((typeof module !== "undefined") ? module : null)' +
              '));\n' +
              'if (typeof define === "function") {\n' +
              '  define([], ((typeof window !== "undefined") ? window : this).woodman);\n' +
              '};'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-console'],
          out: 'dist/woodman-console.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      },

      /**
       * Global standalone distribution that only includes Woodman's "disabled"
       * shim, for use in production environments instead of the generic Woodman
       * distribution to suppress all traces.
       */
      disabled: {
        options: {
          wrap: {
            start: '/*! Disabled distribution */\n' +
              '(function (root, rootRequire, rootModule) {\n',
            end: 'require(["./woodman-disabled"], function (woodman) {\n' +
              '  if (root) root.woodman = woodman;\n' +
              '  if (rootModule) rootModule.exports = woodman;\n' +
              '}, null, true);\n' +
              '}(((typeof window !== "undefined") ? window : this),' +
              ' ((typeof require === "function") ? require : null),' +
              ' ((typeof module !== "undefined") ? module : null)' +
              '));\n' +
              'if (typeof define === "function") {\n' +
              '  define([], ((typeof window !== "undefined") ? window : this).woodman);\n' +
              '};'
          },
          baseUrl: 'lib/',
          name: '../deps/almond',
          include: ['woodman-disabled'],
          out: 'dist/woodman-disabled.js',
          preserveLicenseComments: false,
          optimize: 'uglify'
        }
      }
    },

    /**
     * Adds Copyright and license banner to all distributions
     */
    concat: {
      options: {
        stripBanners: true,
        banner: '<%= meta.fullBanner %>'
      },
      woodman: {
        src: 'dist/woodman.js',
        dest: 'dist/woodman.js'
      },
      'woodman-amd': {
        src: 'dist/woodman-amd.js',
        dest: 'dist/woodman-amd.js'
      },
      browser: {
        src: 'dist/woodman-browser.js',
        dest: 'dist/woodman-browser.js'
      },
      'browser-amd': {
        src: 'dist/woodman-browser-amd.js',
        dest: 'dist/woodman-browser-amd.js'
      },
      node: {
        src: 'dist/woodman-node.js',
        dest: 'dist/woodman-node.js'
      },
      'node-amd': {
        src: 'dist/woodman-node-amd.js',
        dest: 'dist/woodman-node-amd.js'
      },
      'woodman-console': {
        options: {
          banner: '<%= meta.consoleBanner %>'
        },
        src: 'dist/woodman-console.js',
        dest: 'dist/woodman-console.js'
      },
      disabled: {
        options: {
          banner: '<%= meta.disabledBanner %>'
        },
        src: 'dist/woodman-disabled.js',
        dest: 'dist/woodman-disabled.js'
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-jshint');

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


<commit_before>module.exports = function(grunt) {
    var path = require('path');
    var moduleDir = grunt.option('module-dir') || '..',
        json = grunt.file.readJSON(moduleDir + '/package.json'),
        appName = json.name + '-tests',
        workspaceDir = "tmp",
        projectDir = workspaceDir + '/' + appName,
        projectAppifiedDir = projectDir + '/appify';

    grunt.initConfig({
        pkg: json,

        titanium: {
            create: {
                options: {
                    command: 'create',
                    id: 'grunttitanium.' + appName.replace('-', ''),
                    name: appName,
                    projectDir: projectDir,
                    workspaceDir: workspaceDir
                }
            },
            build: {
                options: {
                    command: 'build',
                    platform: 'ios',
                    projectDir: projectAppifiedDir
                }
            },
            clean: {
                options: {
                    command: 'clean',
                    projectDir: projectAppifiedDir
                }
            }
        },
        copy: {
            specs: {
                expand: true,
                cwd: moduleDir + '/spec',
                src: './**',
                dest: projectAppifiedDir + '/spec'
            },
            'jasmin-expect': {
                expand: true,
                cwd: path.dirname(require.resolve('jasmine-expect')),
                src: './**',
                dest: projectAppifiedDir + '/Resources/jasmine-expect'
            }
        },
        mkdir: {
            appify: {
                options: {
                    create: [projectAppifiedDir]
                }
            }
        },
        unzip: {
            module: {
                src: [
                    'dist/<%= pkg.name %>-commonjs-<%= pkg.version %>.zip'
                ],
                dest: projectAppifiedDir
            }
        },
        tishadow: {
            test: {
                command: 'spec',
                options: {
                    projectDir: projectAppifiedDir
                }
            },
            appify: {
                command: 'appify',
                options: {
                    projectDir: projectDir,
                    dest: 'appify'
                }
            },
            clear: {
                command: 'clear',
                options: {
                    projectDir: projectAppifiedDir
                }
            }
        },
        titaniumifier: {
            build: {
                files: {
                    'dist': [moduleDir]
                },
                options: {
                    bundle: true,
                    module: true
                }
            }
        },
    });

    grunt.loadNpmTasks('grunt-titanium');
    grunt.loadNpmTasks('grunt-tishadow');
    grunt.loadNpmTasks('grunt-titaniumifier');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-zip');
    grunt.loadNpmTasks('grunt-mkdir');

    grunt.registerTask('tiapp:addmodule', function() {
        var tiapp = require('tiapp.xml').load(projectAppifiedDir + '/tiapp.xml');

        tiapp.setModule(json.name, json.version);
        tiapp.write();
        grunt.log.ok('Module "' + json.name + '" version ' + json.version + ' added');
    });

    grunt.registerTask('test', [
        'copy:specs',
        'tishadow:test'
    ]);

    grunt.registerTask('test:clear', [
        'tishadow:clear'
    ]);

    grunt.registerTask('appify', [
        'mkdir:appify',
        'tishadow:appify',
        'unzip:module',
        'copy:jasmin-expect',
        'tiapp:addmodule'
    ]);

    grunt.registerTask('app:setup', [
        'titanium:create',
        'titaniumifier:build',
        'appify'
    ]);

    grunt.registerTask('app:build', [
        'titanium:build'
    ]);

    grunt.registerTask('clear', [
        'test:clear',
        'titanium:clean',
    ]);

    grunt.registerTask('module:build', [
        'titaniumifier:build',
        'unzip:module',
        'tiapp:addmodule'
    ]);

    grunt.registerTask('module:setup', [
        'module:build',
        'appify',
        'app:build'
    ]);

    grunt.registerTask('default', ['app:setup', 'app:build']);

};<commit_msg>fix titanium create task to remove underline character from project id<commit_after>module.exports = function(grunt) {
    var path = require('path');
    var moduleDir = grunt.option('module-dir') || '..',
        json = grunt.file.readJSON(moduleDir + '/package.json'),
        appName = json.name + '-tests',
        workspaceDir = "tmp",
        projectDir = workspaceDir + '/' + appName,
        projectAppifiedDir = projectDir + '/appify';

    grunt.initConfig({
        pkg: json,

        titanium: {
            create: {
                options: {
                    command: 'create',
                    id: 'grunttitanium.' + appName.replace(/-|_/g, ''),
                    name: appName,
                    projectDir: projectDir,
                    workspaceDir: workspaceDir
                }
            },
            build: {
                options: {
                    command: 'build',
                    platform: 'ios',
                    projectDir: projectAppifiedDir
                }
            },
            clean: {
                options: {
                    command: 'clean',
                    projectDir: projectAppifiedDir
                }
            }
        },
        copy: {
            specs: {
                expand: true,
                cwd: moduleDir + '/spec',
                src: './**',
                dest: projectAppifiedDir + '/spec'
            },
            'jasmin-expect': {
                expand: true,
                cwd: path.dirname(require.resolve('jasmine-expect')),
                src: './**',
                dest: projectAppifiedDir + '/Resources/jasmine-expect'
            }
        },
        mkdir: {
            appify: {
                options: {
                    create: [projectAppifiedDir]
                }
            }
        },
        unzip: {
            module: {
                src: [
                    'dist/<%= pkg.name %>-commonjs-<%= pkg.version %>.zip'
                ],
                dest: projectAppifiedDir
            }
        },
        tishadow: {
            test: {
                command: 'spec',
                options: {
                    projectDir: projectAppifiedDir
                }
            },
            appify: {
                command: 'appify',
                options: {
                    projectDir: projectDir,
                    dest: 'appify'
                }
            },
            clear: {
                command: 'clear',
                options: {
                    projectDir: projectAppifiedDir
                }
            }
        },
        titaniumifier: {
            build: {
                files: {
                    'dist': [moduleDir]
                },
                options: {
                    bundle: true,
                    module: true
                }
            }
        },
    });

    grunt.loadNpmTasks('grunt-titanium');
    grunt.loadNpmTasks('grunt-tishadow');
    grunt.loadNpmTasks('grunt-titaniumifier');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-zip');
    grunt.loadNpmTasks('grunt-mkdir');

    grunt.registerTask('tiapp:addmodule', function() {
        var tiapp = require('tiapp.xml').load(projectAppifiedDir + '/tiapp.xml');

        tiapp.setModule(json.name, json.version);
        tiapp.write();
        grunt.log.ok('Module "' + json.name + '" version ' + json.version + ' added');
    });

    grunt.registerTask('test', [
        'copy:specs',
        'tishadow:test'
    ]);

    grunt.registerTask('test:clear', [
        'tishadow:clear'
    ]);

    grunt.registerTask('appify', [
        'mkdir:appify',
        'tishadow:appify',
        'unzip:module',
        'copy:jasmin-expect',
        'tiapp:addmodule'
    ]);

    grunt.registerTask('app:setup', [
        'titanium:create',
        'titaniumifier:build',
        'appify'
    ]);

    grunt.registerTask('app:build', [
        'titanium:build'
    ]);

    grunt.registerTask('clear', [
        'test:clear',
        'titanium:clean',
    ]);

    grunt.registerTask('module:build', [
        'titaniumifier:build',
        'unzip:module',
        'tiapp:addmodule'
    ]);

    grunt.registerTask('module:setup', [
        'module:build',
        'appify',
        'app:build'
    ]);

    grunt.registerTask('default', ['app:setup', 'app:build']);

};<|endoftext|>


<commit_before>module.exports = function(grunt){
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		jshint: {
			files: ['src/lds.<%= pkg.name %>.js'],
			options: {
				jshintrc: '.jshintrc'
			}
		},
		// https://npmjs.org/package/grunt-include-replace
		includereplace: {
			dist: {
				options: {
					// Global variables available in all files
					globals: {
						version: '<%= pkg.version %>',
						date: '<%= grunt.template.today("yyyy/mm/dd") %>'
					},
					// Optional variable prefix & suffix, defaults as shown
					prefix: '@@',
					suffix: ''
				},
				// Files to perform replacements and includes with
				src: 'src/lds.<%= pkg.name %>.js',
				// Destinaion directory to copy files to
				dest: 'dist/'
			}
		},
		// https://github.com/gruntjs/grunt-contrib-uglify
		uglify:{
			options: {
				compress:false,
				preserveComments:'some' // preserve the blocks of comments that start with a /*!
			},
			dist:{
				src:['dist/lds.<%= pkg.name %>.js'],
				dest:'dist/lds.<%= pkg.name %>.min.js'
			},
			cdn:{
				src:['dist/lds.<%= pkg.name %>.js'],
				dest:'build/lds.<%= pkg.name %><%= pkg.version %>.min.js'
			}
		},
		copy: {
			cdn: {
				files: [
					{
						src:"dist/lds.<%= pkg.name %>.js",
						dest:"../../cdn/trunk/src/main/resources/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js"
					},
					{
						src:"dist/lds.<%= pkg.name %>.js",
						dest:"../../cdn/tags/test/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js"
					},
					{
						src:"dist/lds.<%= pkg.name %>.js",
						dest:"../../cdn/tags/stage/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js"
					},
					{
						src:"dist/lds.<%= pkg.name %>.js",
						dest:'../../cdn/tags/prod/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js'
					}
				]
			}
		}
	});
	//grunt plugins
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-include-replace');

	grunt.registerTask('default',['jshint', 'includereplace', 'uglify:dist']);
	// only needed to be run by Aaron to put copies out on the CDN
	grunt.registerTask('cdn',['copy:cdn']);
};
<commit_msg>updating to match grunt file used in other projects<commit_after>/* jshint node: true */
module.exports = function(grunt) {
	"use strict";
	grunt.initConfig({
		pkg: grunt.file.readJSON("package.json"),
		jshint: {
			files: ["src/lds.<%= pkg.name %>.js"],
			options: {
				jshintrc: true
			}
		},
		// https://npmjs.org/package/grunt-include-replace
		includereplace: {
			dist: {
				options: {
					// Global variables available in all files
					globals: {
						version: "<%= pkg.version %>",
						date: "<%= grunt.template.today(\"yyyy / mm / dd \") %>"
					},
					// Optional variable prefix & suffix, defaults as shown
					prefix: "@@",
					suffix: ""
				},
				cwd: "src/",
				expand: true,
				src: "*.js",
				dest: "dist/"
			}
		},
		// https://github.com/gruntjs/grunt-contrib-uglify
		uglify: {
			options: {
				compress: false,
				preserveComments: "some" // preserve the blocks of comments that start with a /*!
			},
			dist: {
				src: ["dist/lds.<%= pkg.name %>.js"],
				dest: "dist/lds.<%= pkg.name %>.min.js"
			},
			cdn: {
				src: ["dist/lds.<%= pkg.name %>.js"],
				dest: "build/lds.<%= pkg.name %><%= pkg.version %>.min.js"
			}
		},
		copy: {
			cdn: {
				files: [{
					src: "dist/lds.<%= pkg.name %>.js",
					dest: "../../cdn/trunk/src/main/resources/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js"
				}, {
					src: "dist/lds.<%= pkg.name %>.js",
					dest: "../../cdn/tags/test/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js"
				}, {
					src: "dist/lds.<%= pkg.name %>.js",
					dest: "../../cdn/tags/stage/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js"
				}, {
					src: "dist/lds.<%= pkg.name %>.js",
					dest: "../../cdn/tags/prod/ml/ldsorg/ver/scripts/<%= pkg.folder %>/lds.<%= pkg.name %><%= pkg.version %>.min.js"
				}]
			}
		}
	});
	//grunt plugins
	grunt.loadNpmTasks("grunt-contrib-copy");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-include-replace");

	grunt.registerTask("default", ["jshint", "includereplace", "uglify:dist"]);
	// only needed to be run by Aaron to put copies out on the CDN
	grunt.registerTask("cdn", ["copy:cdn"]);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {

	// Project configuration.
	grunt.initConfig({

		// Configuration to be run (and then tested).
		jsontl: {
			test: {
				files: [{
					expand: true,
					src: ['data.old.json'],
					dest: 'test/tmp',
					cwd: 'test/tmp',
					ext: '.new.json'
				}],
				transform: 'test/tmp/transform.jsontl',
				options: {
					prettyPrint: true
				}
			}
		},

		// Unit tests.
		mochaTest: {
			src: ['test/test.js'],
			options: {
				bail: true
			}
		},

		clean: {
			src: ['test/tmp/']
		}
	});

	// Actually load this plugin's task(s).
	grunt.loadTasks('tasks');

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-internal');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-mocha-test');

	// Setup a test helper to create some folders to clean.
	grunt.registerTask('copy', 'Copy fixtures to a temp location.', function () {
		grunt.file.copy('test/fixtures/data.json', 'test/tmp/data.old.json');
		grunt.file.copy('test/fixtures/transform.jsontl', 'test/tmp/transform.jsontl');
	});

	// Whenever the 'test' task is run, first create some files to be transformed,
	// then run this plugin's task(s), then test the result.
	grunt.registerTask('test', ['copy', 'jsontl', 'mochaTest', 'clean']);

	// By default, run tranform, but don't clean up.
	grunt.registerTask('default', ['copy', 'jsontl', 'mochaTest']);
};
<commit_msg>updated test task to simple file spec<commit_after>'use strict';

module.exports = function (grunt) {

	// Project configuration.
	grunt.initConfig({

		// Configuration to be run (and then tested).
		jsontl: {
			test: {
				files: {
					'test/tmp/data.new.json': ['test/tmp/data.old.json']
				},
				transform: 'test/tmp/transform.jsontl',
				options: {
					prettyPrint: true
				}
			}
		},

		// Unit tests.
		mochaTest: {
			src: ['test/test.js'],
			options: {
				bail: true
			}
		},

		clean: {
			src: ['test/tmp/']
		}
	});

	// Actually load this plugin's task(s).
	grunt.loadTasks('tasks');

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-internal');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-mocha-test');

	// Setup a test helper to create some folders to clean.
	grunt.registerTask('copy', 'Copy fixtures to a temp location.', function () {
		grunt.file.copy('test/fixtures/data.json', 'test/tmp/data.old.json');
		grunt.file.copy('test/fixtures/transform.jsontl', 'test/tmp/transform.jsontl');
	});

	// Whenever the 'test' task is run, first create some files to be transformed,
	// then run this plugin's task(s), then test the result.
	grunt.registerTask('test', ['clean', 'copy', 'jsontl', 'mochaTest', 'clean']);

	// By default, run tranform, but don't clean up.
	grunt.registerTask('default', ['copy', 'jsontl', 'mochaTest']);
};
<|endoftext|>


<commit_before>/*
**  Microkernel -- Microkernel for Server Applications
**  Copyright (c) 2015-2017 Ralf S. Engelschall <rse@engelschall.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.
*/

/* global module: true */
module.exports = function (grunt) {
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-contrib-watch");
    grunt.loadNpmTasks("grunt-browserify");
    grunt.loadNpmTasks("grunt-mocha-test");
    grunt.loadNpmTasks("grunt-eslint");
    grunt.loadNpmTasks("grunt-jscs");

    grunt.initConfig({
        version: grunt.file.readYAML("VERSION.yml"),
        jshint: {
            options: {
                jshintrc: "jshint.json"
            },
            "gruntfile":  [ "Gruntfile.js" ],
            "microkernel": [ "src/**/*.js", "tst/**/*.js" ]
        },
        eslint: {
            options: {
                configFile: "eslint.json"
            },
            "microkernel": [ "src/**/*.js", "tst/**/*.js" ]
        },
        jscs: {
            "microkernel": {
                options: {
                    config: "jscs.json"
                },
                files: {
                    src: [ "src/**/*.js", "tst/**/*.js" ]
                }
            }
        },
        browserify: {
            "microkernel": {
                files: {
                    "lib/microkernel.js": [ "src/microkernel.js" ]
                },
                options: {
                    transform: [
                        [ "browserify-replace", { replace: [
                            { from: /\$major/g, to: "<%= version.major %>" },
                            { from: /\$minor/g, to: "<%= version.minor %>" },
                            { from: /\$micro/g, to: "<%= version.micro %>" },
                            { from: /\$date/g,  to: "<%= version.date  %>" }
                        ]}],
                        [ "babelify", { presets: [ "es2015" ] } ]
                    ],
                    plugin: [
                        [ "minifyify", { map: "microkernel.map", output: "lib/microkernel.map" } ],
                        [ "browserify-derequire" ],
                        [ "browserify-header" ]
                    ],
                    external: [
                        "glob",
                        "gdo"
                    ],
                    browserifyOptions: {
                        standalone: "Microkernel",
                        debug: true
                    }
                }
            }
        },
        mochaTest: {
            "microkernel": {
                src: [ "tst/microkernel-*.js" ]
            },
            options: {
                reporter: "spec",
                require: "tst/common.js"
            }
        },
        clean: {
            clean: [],
            distclean: [ "node_modules" ]
        },
        watch: {
            "src": {
                files: [ "src/**/*.js", "tst/**/*.js" ],
                tasks: [ "default" ],
                options: {}
            }
        }
    });

    grunt.registerTask("default", [ "jshint", "eslint", "jscs", "browserify", "mochaTest" ]);
    grunt.registerTask("test", [ "mochaTest" ]);
    grunt.registerTask("dev", [ "default", "watch" ]);
};

<commit_msg>switch to ESLint YAML syntax<commit_after>/*
**  Microkernel -- Microkernel for Server Applications
**  Copyright (c) 2015-2017 Ralf S. Engelschall <rse@engelschall.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.
*/

/* global module: true */
module.exports = function (grunt) {
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-contrib-watch");
    grunt.loadNpmTasks("grunt-browserify");
    grunt.loadNpmTasks("grunt-mocha-test");
    grunt.loadNpmTasks("grunt-eslint");
    grunt.loadNpmTasks("grunt-jscs");

    grunt.initConfig({
        version: grunt.file.readYAML("VERSION.yml"),
        jshint: {
            options: {
                jshintrc: "jshint.json"
            },
            "gruntfile":  [ "Gruntfile.js" ],
            "microkernel": [ "src/**/*.js", "tst/**/*.js" ]
        },
        eslint: {
            options: {
                configFile: "eslint.yaml"
            },
            "microkernel": [ "src/**/*.js", "tst/**/*.js" ]
        },
        jscs: {
            "microkernel": {
                options: {
                    config: "jscs.json"
                },
                files: {
                    src: [ "src/**/*.js", "tst/**/*.js" ]
                }
            }
        },
        browserify: {
            "microkernel": {
                files: {
                    "lib/microkernel.js": [ "src/microkernel.js" ]
                },
                options: {
                    transform: [
                        [ "browserify-replace", { replace: [
                            { from: /\$major/g, to: "<%= version.major %>" },
                            { from: /\$minor/g, to: "<%= version.minor %>" },
                            { from: /\$micro/g, to: "<%= version.micro %>" },
                            { from: /\$date/g,  to: "<%= version.date  %>" }
                        ]}],
                        [ "babelify", { presets: [ "es2015" ] } ]
                    ],
                    plugin: [
                        [ "minifyify", { map: "microkernel.map", output: "lib/microkernel.map" } ],
                        [ "browserify-derequire" ],
                        [ "browserify-header" ]
                    ],
                    external: [
                        "glob",
                        "gdo"
                    ],
                    browserifyOptions: {
                        standalone: "Microkernel",
                        debug: true
                    }
                }
            }
        },
        mochaTest: {
            "microkernel": {
                src: [ "tst/microkernel-*.js" ]
            },
            options: {
                reporter: "spec",
                require: "tst/common.js"
            }
        },
        clean: {
            clean: [],
            distclean: [ "node_modules" ]
        },
        watch: {
            "src": {
                files: [ "src/**/*.js", "tst/**/*.js" ],
                tasks: [ "default" ],
                options: {}
            }
        }
    });

    grunt.registerTask("default", [ "jshint", "eslint", "jscs", "browserify", "mochaTest" ]);
    grunt.registerTask("test", [ "mochaTest" ]);
    grunt.registerTask("dev", [ "default", "watch" ]);
};

<|endoftext|>