2012-07-18 18:31:44 +02:00
|
|
|
/*global module:false*/
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: '<json:package.json>',
|
|
|
|
meta: {
|
|
|
|
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
|
|
|
|
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
|
|
|
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
|
|
|
|
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
|
|
|
|
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
|
|
|
|
},
|
|
|
|
concat: {
|
|
|
|
dist_js: {
|
2012-07-23 15:15:26 +02:00
|
|
|
src: ['<banner:meta.banner>', '<file_strip_banner:src/jquery.coords.js>', '<file_strip_banner:src/jquery.collision.js>', 'src/utils.js', '<file_strip_banner:src/jquery.draggable.js>', '<file_strip_banner:src/<%= pkg.name %>.js>'],
|
2012-07-18 18:31:44 +02:00
|
|
|
dest: 'dist/<%= pkg.name %>.js'
|
|
|
|
},
|
|
|
|
dist_css: {
|
|
|
|
src: ['<banner:meta.banner>', 'src/<%= pkg.name %>.css'],
|
|
|
|
dest: 'dist/<%= pkg.name %>.css'
|
2012-07-30 12:49:28 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
dist_demo_js: {
|
|
|
|
src: ['<banner:meta.banner>', '<file_strip_banner:src/jquery.coords.js>', '<file_strip_banner:src/jquery.collision.js>', 'src/utils.js', '<file_strip_banner:src/jquery.draggable.js>', '<file_strip_banner:src/<%= pkg.name %>.js>'],
|
|
|
|
dest: 'gh-pages/dist/<%= pkg.name %>.js'
|
|
|
|
},
|
|
|
|
dist_demo_css: {
|
|
|
|
src: ['<banner:meta.banner>', 'src/<%= pkg.name %>.css'],
|
|
|
|
dest: 'gh-pages/dist/<%= pkg.name %>.css'
|
2012-07-18 18:31:44 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
min: {
|
|
|
|
dist: {
|
|
|
|
src: ['<banner:meta.banner>', '<config:concat.dist_js.dest>'],
|
|
|
|
dest: 'dist/<%= pkg.name %>.min.js'
|
2012-07-30 12:49:28 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
dist_demo: {
|
|
|
|
src: ['<banner:meta.banner>', '<config:concat.dist_js.dest>'],
|
|
|
|
dest: 'gh-pages/dist/<%= pkg.name %>.min.js'
|
2012-07-18 18:31:44 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mincss: {
|
|
|
|
compress: {
|
|
|
|
files: {
|
2012-07-30 12:49:28 +02:00
|
|
|
"dist/<%= pkg.name %>.min.css": ["dist/<%= pkg.name %>.css"],
|
|
|
|
"gh-pages/dist/<%= pkg.name %>.min.css": ["dist/<%= pkg.name %>.css"]
|
2012-07-18 18:31:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
qunit: {
|
|
|
|
files: ['test/**/*.html']
|
|
|
|
},
|
|
|
|
lint: {
|
|
|
|
files: ['grunt.js', 'src/**/*.js', 'test/**/*.js']
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
files: ['<config:lint.files>', 'src/<%= pkg.name %>.css'],
|
|
|
|
tasks: 'lint concat'
|
|
|
|
},
|
|
|
|
jshint: {
|
|
|
|
options: {
|
|
|
|
curly: true,
|
|
|
|
eqeqeq: true,
|
|
|
|
immed: true,
|
|
|
|
latedef: true,
|
|
|
|
newcap: true,
|
|
|
|
noarg: true,
|
|
|
|
sub: true,
|
|
|
|
undef: true,
|
|
|
|
boss: true,
|
|
|
|
eqnull: true,
|
|
|
|
browser: true
|
|
|
|
},
|
|
|
|
globals: {
|
|
|
|
jQuery: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
uglify: {},
|
|
|
|
yuidoc: {
|
|
|
|
compile: {
|
2012-07-27 13:51:10 +02:00
|
|
|
"name": 'gridster.js',
|
|
|
|
"description": 'gridster.js, a drag-and-drop multi-column jQuery grid plugin',
|
|
|
|
"version": '0.1.0',
|
|
|
|
"url": 'http://gridster.net/',
|
2012-07-18 18:31:44 +02:00
|
|
|
"logo": 'http://ducksboard.com/wp-content/themes/blog-theme-ducksboard/images/ducksboard.png',
|
|
|
|
options: {
|
|
|
|
paths: "src/",
|
2012-07-26 12:34:48 +02:00
|
|
|
outdir: "gh-pages/docs/"
|
2012-07-18 18:31:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib');
|
|
|
|
|
|
|
|
// Default task.
|
2012-07-26 12:34:48 +02:00
|
|
|
grunt.registerTask('default', 'lint qunit concat min mincss yuidoc');
|
2012-07-18 18:31:44 +02:00
|
|
|
|
|
|
|
};
|