1 module.exports = function (grunt) {
2 grunt.loadNpmTasks('grunt-recess');
3 grunt.loadNpmTasks('grunt-contrib-concat');
4 grunt.loadNpmTasks('grunt-contrib-clean');
5 grunt.loadNpmTasks('grunt-contrib-watch');
7 // Project configuration.
9 pkg: grunt.file.readJSON('package.json'),
13 ' * <%= pkg.description %>\n' +
14 ' * @version v<%= pkg.version %> - ' +
15 '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
16 ' * @link <%= pkg.homepage %>\n' +
17 ' * @license <%= pkg.license %>' + ' */'
20 amelia:{}, cerulean:{}, cosmo:{}, cyborg:{}, flatly:{}, journal:{},
21 readable:{}, simplex:{}, slate:{}, spacelab:{}, superhero:{}, united:{}
25 src: ['*/build.less', '!global/build.less']
45 grunt.registerTask('none', function() {});
47 grunt.registerTask('build', 'build a regular theme', function(theme, compress) {
48 var compress = compress == undefined ? true : compress;
56 concatSrc = 'global/build.less';
57 concatDest = theme + '/build.less';
58 recessDest = '<%=builddir%>/' + theme + '/bootstrap.css';
59 recessSrc = [ theme + '/' + 'build.less' ];
61 dist = {src: concatSrc, dest: concatDest};
62 grunt.config('concat.dist', dist);
63 files = {}; files[recessDest] = recessSrc;
64 grunt.config('recess.dist.files', files);
65 grunt.config('recess.dist.options.compress', false);
67 grunt.task.run(['concat', 'recess:dist', 'clean:build',
68 compress ? 'compress:'+recessDest+':'+'<%=builddir%>/' + theme + '/bootstrap.min.css':'none']);
71 grunt.registerTask('compress', 'compress a generic css', function(fileSrc, fileDst) {
72 var files = {}; files[fileDst] = fileSrc;
73 grunt.log.writeln('compressing file ' + fileSrc);
75 grunt.config('recess.dist.files', files);
76 grunt.config('recess.dist.options.compress', true);
77 grunt.task.run(['recess:dist']);
80 grunt.registerMultiTask('swatch', 'build a theme', function() {
82 grunt.task.run('build:'+t);
85 grunt.registerTask('default', 'build a theme', function() {
86 grunt.task.run('swatch');