X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Gruntfile.js;h=f5b0c10d3965b30fe48a5cd2adc21867262cc906;hb=eb7b1acdf465a9132636fa20d797a389a6164c54;hp=539aece7157ffd85354f14951fb94d10fdbdcc71;hpb=c9e454d4d9523c51ab4bc8587201a607718105cb;p=bootswatch diff --git a/Gruntfile.js b/Gruntfile.js index 539aece..f5b0c10 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,10 +2,12 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-recess'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-watch'); // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), + builddir: '.', meta: { banner: '/**\n' + ' * <%= pkg.description %>\n' + @@ -15,15 +17,14 @@ module.exports = function (grunt) { ' * @license <%= pkg.license %>' + ' */' }, swatch: { - amelia: {}, cerulean:{}, cosmo:{}, cyborg:{}, journal:{}, readable:{}, - shamrock:{}, simplex:{}, slate:{}, spacelab:{}, spruce:{}, superhero:{}, - united:{} + amelia:{}, cerulean:{}, cosmo:{}, cyborg:{}, flatly:{}, journal:{}, + readable:{}, simplex:{}, slate:{}, spacelab:{}, united:{}, yeti: {}, + custom:{} }, clean: { - build: { - src: ['*/build.less', '*/build-responsive.less', - '!global/build.less', '!global/build-responsive.less'] - } + build: { + src: ['*/build.less', '!global/build.less'] + } }, concat: { dist: { @@ -55,7 +56,7 @@ module.exports = function (grunt) { var dist = {}; concatSrc = 'global/build.less'; concatDest = theme + '/build.less'; - recessDest = theme + '/' + theme + '.css'; + recessDest = '<%=builddir%>/' + theme + '/bootstrap.css'; recessSrc = [ theme + '/' + 'build.less' ]; dist = {src: concatSrc, dest: concatDest}; @@ -65,32 +66,7 @@ module.exports = function (grunt) { grunt.config('recess.dist.options.compress', false); grunt.task.run(['concat', 'recess:dist', 'clean:build', - compress ? 'compress:'+recessDest+':'+theme+'/'+theme+'.min.css':'none']); - }); - - grunt.registerTask('build-responsive', 'build a responsive theme', function(theme, compress) { - var compress = compress == undefined ? true : compress; - - var concatSrc; - var concatDest; - var recessDest; - var recessSrc; - var files = {}; - var dist = {}; - - concatSrc = 'global/build-responsive.less'; - concatDest = theme + '/build-responsive.less'; - recessDest = theme + '/' + theme + '-responsive.css'; - recessSrc = [ theme + '/' + 'build-responsive.less' ]; - - dist = {src: concatSrc, dest: concatDest}; - grunt.config('concat.dist', dist); - files = {}; files[recessDest] = recessSrc; - grunt.config('recess.dist.files', files); - grunt.config('recess.dist.options.compress', false); - - grunt.task.run(['concat', 'recess:dist', 'clean:build', - compress ? 'compress:'+recessDest+':'+theme+'/'+theme+'-responsive.min.css':'none']); + compress ? 'compress:'+recessDest+':'+'<%=builddir%>/' + theme + '/bootstrap.min.css':'none']); }); grunt.registerTask('compress', 'compress a generic css', function(fileSrc, fileDst) { @@ -102,8 +78,12 @@ module.exports = function (grunt) { grunt.task.run(['recess:dist']); }); - grunt.registerMultiTask('swatch', 'build a theme, both not responsive and responsive', function() { + grunt.registerMultiTask('swatch', 'build a theme', function() { var t = this.target; - grunt.task.run('build:'+t, 'build-responsive:'+t); + grunt.task.run('build:'+t); + }); + + grunt.registerTask('default', 'build a theme', function() { + grunt.task.run('swatch'); }); -}; \ No newline at end of file +};