2014-02-02 19:20:52 +00:00
|
|
|
/* jshint node:true */
|
|
|
|
module.exports = function( grunt ){
|
|
|
|
'use strict';
|
2014-01-30 16:11:02 +00:00
|
|
|
|
2014-02-02 19:22:05 +00:00
|
|
|
grunt.initConfig({
|
2014-02-02 19:24:02 +00:00
|
|
|
// setting folder templates
|
|
|
|
dirs: {
|
|
|
|
css: 'assets/css',
|
|
|
|
fonts: 'assets/fonts',
|
|
|
|
images: 'assets/images',
|
|
|
|
js: 'assets/js'
|
|
|
|
},
|
|
|
|
|
2014-02-02 19:49:30 +00:00
|
|
|
// Compile all .less files.
|
2014-02-02 19:22:05 +00:00
|
|
|
less: {
|
|
|
|
compile: {
|
|
|
|
options: {
|
|
|
|
// These paths are searched for @imports
|
2014-02-02 19:38:00 +00:00
|
|
|
paths: ['<%= dirs.css %>/']
|
2014-02-02 19:22:05 +00:00
|
|
|
},
|
|
|
|
files: {
|
2014-02-02 19:49:30 +00:00
|
|
|
'<%= dirs.css %>/activation.css': '<%= dirs.css %>/activation.less',
|
|
|
|
'<%= dirs.css %>/admin.css': '<%= dirs.css %>/admin.less',
|
|
|
|
'<%= dirs.css %>/chosen.css': '<%= dirs.css %>/chosen.less',
|
|
|
|
'<%= dirs.css %>/dashboard.css': '<%= dirs.css %>/dashboard.less',
|
|
|
|
'<%= dirs.css %>/menu.css': '<%= dirs.css %>/menu.less',
|
|
|
|
'<%= dirs.css %>/prettyPhoto.css': '<%= dirs.css %>/prettyPhoto.less',
|
|
|
|
'<%= dirs.css %>/woocommerce-layout.css': '<%= dirs.css %>/woocommerce-layout.less',
|
|
|
|
'<%= dirs.css %>/woocommerce-smallscreen.css': '<%= dirs.css %>/woocommerce-smallscreen.less',
|
2014-02-02 19:24:02 +00:00
|
|
|
'<%= dirs.css %>/woocommerce.css': '<%= dirs.css %>/woocommerce.less'
|
2014-02-02 19:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2014-01-30 16:41:07 +00:00
|
|
|
|
2014-02-02 19:38:00 +00:00
|
|
|
// Minify all .css files.
|
2014-02-02 19:22:05 +00:00
|
|
|
cssmin: {
|
2014-02-02 19:38:00 +00:00
|
|
|
minify: {
|
|
|
|
expand: true,
|
|
|
|
cwd: '<%= dirs.css %>/',
|
|
|
|
src: ['*.css'],
|
|
|
|
dest: '<%= dirs.css %>/',
|
|
|
|
ext: '.css'
|
|
|
|
}
|
2014-02-02 19:22:05 +00:00
|
|
|
},
|
2014-01-30 16:41:07 +00:00
|
|
|
|
2014-02-02 19:22:05 +00:00
|
|
|
shell: {
|
|
|
|
generatemos: {
|
|
|
|
command: [
|
|
|
|
'cd i18n/languages',
|
|
|
|
'for i in *.po; do msgfmt $i -o ${i%%.*}.mo; done',
|
|
|
|
'ls'
|
|
|
|
].join( '&&' )
|
|
|
|
}
|
|
|
|
},
|
2014-01-30 16:51:05 +00:00
|
|
|
|
2014-02-02 19:22:05 +00:00
|
|
|
});
|
2014-01-30 16:11:02 +00:00
|
|
|
|
2014-02-02 19:22:05 +00:00
|
|
|
// Load NPM tasks to be used here
|
|
|
|
grunt.loadNpmTasks( 'grunt-shell' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-less' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
|
2014-01-30 16:34:23 +00:00
|
|
|
|
2014-02-02 19:22:05 +00:00
|
|
|
// Register tasks
|
|
|
|
grunt.registerTask( 'default', []);
|
|
|
|
grunt.registerTask( 'dev', ['less:compile', 'cssmin', 'shell:generatemos' ] );
|
2014-01-30 16:11:02 +00:00
|
|
|
|
2014-02-02 19:20:52 +00:00
|
|
|
};
|