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:{},
26 src: ['*/build.less', '!global/build.less']
46 grunt.registerTask('none', function() {});
48 grunt.registerTask('build', 'build a regular theme', function(theme, compress) {
49 var compress = compress == undefined ? true : compress;
57 concatSrc = 'global/build.less';
58 concatDest = theme + '/build.less';
59 recessDest = '<%=builddir%>/' + theme + '/bootstrap.css';
60 recessSrc = [ theme + '/' + 'build.less' ];
62 dist = {src: concatSrc, dest: concatDest};
63 grunt.config('concat.dist', dist);
64 files = {}; files[recessDest] = recessSrc;
65 grunt.config('recess.dist.files', files);
66 grunt.config('recess.dist.options.compress', false);
68 grunt.task.run(['concat', 'recess:dist', 'clean:build',
69 compress ? 'compress:'+recessDest+':'+'<%=builddir%>/' + theme + '/bootstrap.min.css':'none']);
72 grunt.registerTask('compress', 'compress a generic css', function(fileSrc, fileDst) {
73 var files = {}; files[fileDst] = fileSrc;
74 grunt.log.writeln('compressing file ' + fileSrc);
76 grunt.config('recess.dist.files', files);
77 grunt.config('recess.dist.options.compress', true);
78 grunt.task.run(['recess:dist']);
81 grunt.registerMultiTask('swatch', 'build a theme', function() {
83 grunt.task.run('build:'+t);
86 grunt.registerTask('default', 'build a theme', function() {
87 grunt.task.run('swatch');