Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update to latest grunt

  • Loading branch information...
commit 9a4d71188892b2d6ec0cbc6a136997ec3319970d 1 parent 8d9fa30
@jzaefferer jzaefferer authored
Showing with 91 additions and 86 deletions.
  1. +90 −85 grunt.js
  2. +1 −1  package.json
View
175 grunt.js
@@ -1,95 +1,100 @@
/*global config:true, task:true*/
-config.init({
- pkg: '<json:package.json>',
- meta: {
- banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
- '<%= template.today("m/d/yyyy") %>\n' +
- '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
- '* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' +
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
- },
- concat: {
- 'dist/jquery.validate.js': ['<banner>', '<file_strip_banner:jquery.validate.js>'],
- 'dist/additional-methods.js': ['<banner>', '<file_strip_banner:additional-methods.js>']
- },
- min: {
- 'dist/jquery.validate.min.js': ['<banner>', 'dist/jquery.validate.js'],
- 'dist/additional-methods.min.js': ['<banner>', 'dist/additional-methods.js']
- },
- zip: {
- dist: {
- src: [
- 'dist/additional-methods.js',
- 'dist/additional-methods.min.js',
- 'dist/jquery.validate.js',
- 'dist/jquery.validate.min.js',
- 'README.md',
- 'changelog.txt',
- 'grunt.js',
- 'package.json',
- 'demo/**/*',
- 'lib/**/*',
- 'localization/**/*',
- 'test/**/*'
- ],
- dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.zip'
- }
- },
- qunit: {
- files: ['test/index.html']
- },
- lint: {
- files: ['jquery.validate.js']
- },
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- eqnull: true,
- browser: true
- },
- globals: {
- jQuery: true,
- $: true,
- console: true
- }
- }
+module.exports = function(grunt) {
+
+grunt.initConfig({
+ pkg: '<json:package.json>',
+ meta: {
+ banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
+ '<%= grunt.template.today("m/d/yyyy") %>\n' +
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
+ },
+ concat: {
+ 'dist/jquery.validate.js': ['<banner>', '<file_strip_banner:jquery.validate.js>'],
+ 'dist/additional-methods.js': ['<banner>', '<file_strip_banner:additional-methods.js>']
+ },
+ min: {
+ 'dist/jquery.validate.min.js': ['<banner>', 'dist/jquery.validate.js'],
+ 'dist/additional-methods.min.js': ['<banner>', 'dist/additional-methods.js']
+ },
+ zip: {
+ dist: {
+ src: [
+ 'dist/additional-methods.js',
+ 'dist/additional-methods.min.js',
+ 'dist/jquery.validate.js',
+ 'dist/jquery.validate.min.js',
+ 'README.md',
+ 'changelog.txt',
+ 'grunt.js',
+ 'package.json',
+ 'demo/**/*.*',
+ 'lib/**/*.*',
+ 'localization/**/*.*',
+ 'test/**/*.*'
+ ],
+ dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.zip'
+ }
+ },
+ qunit: {
+ files: ['test/index.html']
+ },
+ lint: {
+ files: ['jquery.validate.js']
+ },
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ eqnull: true,
+ browser: true
+ },
+ globals: {
+ jQuery: true,
+ $: true,
+ console: true
+ }
+ }
});
-task.registerBasicTask('zip', 'Create a zip file for release', function(data) {
- var files = file.expand(data.src);
- log.writeln("Creating zip file " + data.dest);
+grunt.registerMultiTask('zip', 'Create a zip file for release', function() {
+ var files = grunt.file.expand(this.file.src);
+ // grunt.log.writeln(require('util').inspect(files));
+ grunt.log.writeln("Creating zip file " + this.file.dest);
- var done = this.async();
+ var done = this.async();
- var zipstream = require('zipstream');
- var fs = require('fs');
+ var zipstream = require('zipstream');
+ var fs = require('fs');
- var out = fs.createWriteStream(data.dest);
- var zip = zipstream.createZip({ level: 1 });
+ var out = fs.createWriteStream(this.file.dest);
+ var zip = zipstream.createZip({ level: 1 });
- zip.pipe(out);
+ zip.pipe(out);
- function addFile() {
- if (!files.length) {
- zip.finalize(function(written) {
- log.writeln(written + ' total bytes written');
- done();
- });
- return;
- }
- var file = files.shift();
- log.verbose.writeln('Zipping ' + file);
- zip.addFile(fs.createReadStream(file), { name: file }, addFile);
- }
- addFile();
+ function addFile() {
+ if (!files.length) {
+ zip.finalize(function(written) {
+ grunt.log.writeln(written + ' total bytes written');
+ done();
+ });
+ return;
+ }
+ var file = files.shift();
+ grunt.log.verbose.writeln('Zipping ' + file);
+ zip.addFile(fs.createReadStream(file), { name: file }, addFile);
+ }
+ addFile();
});
-task.registerTask('default', 'lint qunit');
-task.registerTask('release', 'default concat min zip');
+grunt.registerTask('default', 'lint qunit');
+grunt.registerTask('release', 'default concat min zip');
+
+};
View
2  package.json
@@ -28,7 +28,7 @@
],
"dependencies": {},
"devDependencies": {
- "grunt": "0.2.x",
+ "grunt": "0.3.x",
"zipstream": "0.2.x"
},
"keywords": []
Please sign in to comment.
Something went wrong with that request. Please try again.