X-Git-Url: https://juplo.de/gitweb/?p=examples%2Fmaven-grunt-integration;a=blobdiff_plain;f=Gruntfile.js;fp=Gruntfile.js;h=a704356b8d0342279a065c2eb9f89c427feea5c4;hp=0000000000000000000000000000000000000000;hb=052d5a501799aa007e5ae4490651e923ba6f9b72;hpb=f30a436f80b983bd9afb1f9964161a8d56204e9b diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..a704356 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,35 @@ +module.exports = function(grunt) { + + grunt.loadNpmTasks('grunt-newer'); + + grunt.registerTask('frontend','Build HTML & CSS for Frontend', function() { + var + done = this.async(), + path = './src/main/frontend'; + + grunt.util.spawn({ + cmd: 'npm', + args: ['install'], + opts: { cwd: path, stdio: 'inherit' } + }, function (err, result, code) { + if (err || code > 0) { + grunt.fail.warn('Failed installing node modules in "' + path + '".'); + } + else { + grunt.log.ok('Installed node modules in "' + path + '".'); + } + + process.chdir(path); + require(path + '/Gruntfile.js')(grunt); + grunt.task.run('newer:copy'); + grunt.task.run('newer:less'); + grunt.task.run('newer:svgstore'); + + done(); + }); + }); + + + grunt.registerTask('default', [ 'frontend' ]); + +};