html2canvas/grunt.js

74 lines
1.8 KiB
JavaScript
Raw Normal View History

2012-11-25 22:59:31 +04:00
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*\n <%= pkg.title || pkg.name %> <%= pkg.version %>' +
'<%= pkg.homepage ? " <" + pkg.homepage + ">\n" : "" %>' +
' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
'\n\n Released under <%= _.pluck(pkg.licenses, "type").join(", ") %> License\n*/',
pre: '(function(window, document, undefined){',
post: '})(window,document);'
},
lint: {
2012-12-29 17:02:05 +04:00
files: ['build/<%= pkg.name %>.js']
2012-11-25 22:59:31 +04:00
},
qunit: {
files: ['tests/qunit/index.html']
},
concat: {
dist: {
src: ['<banner:meta.banner>', '<banner:meta.pre>','src/*.js', 'src/renderers/Canvas.js', '<banner:meta.post>'],
dest: 'build/<%= pkg.name %>.js'
}
},
min: {
dist: {
src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
dest: 'build/<%= pkg.name %>.min.js'
}
},
watch: {
files: '<config:lint.files>',
tasks: 'lint qunit'
},
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: {}
});
2012-12-29 17:02:05 +04:00
var selenium = require("./tests/selenium.js");
grunt.registerTask('webdriver', 'Browser render tests', function(arg1) {
var done = this.async();
if (arguments.length === 0) {
selenium.tests();
2012-12-30 18:29:01 +04:00
} else {
selenium[arg1].apply(null, arguments);
2012-12-29 17:02:05 +04:00
}
});
2012-11-25 22:59:31 +04:00
// Default task.
2012-12-29 17:02:05 +04:00
grunt.registerTask('default', 'concat lint qunit webdriver min');
2012-11-25 22:59:31 +04:00
};