Commit aec9e27d authored by Daniel Gerhardt's avatar Daniel Gerhardt

Add 'package' task for Grunt build

The 'package' task creates a web archive for servlet containers after
building.
parent cc1958aa
......@@ -6,6 +6,7 @@ module.exports = function (grunt) {
var appPath = "src/main/webapp";
var buildPath = appPath + "/build";
var warPath = "target";
/* Files matching the following patterns will be checked by JSHint and JSCS */
var lintJs = [
......@@ -105,6 +106,22 @@ module.exports = function (grunt) {
}
},
war: {
dist: {
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
options: {
war_dist_folder: warPath,
war_name: "arsnova-mobile",
webxml_display_name: "ARSnova Mobile"
},
/* jscs:enable requireCamelCaseOrUpperCaseIdentifiers */
expand: true,
cwd: buildPath + "/<%= senchaEnv %>/ARSnova",
src: "**",
dest: ""
}
},
watch: {
js: {
files: [lintJs, ".jscs.json", ".jshintrc"],
......@@ -158,8 +175,10 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-jscs");
grunt.loadNpmTasks("grunt-newer");
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-war");
grunt.registerTask("lint", ["jscs", "jshint"]);
grunt.registerTask("refresh", "shell:refresh");
grunt.registerTask("package", ["refresh", "build", "war"]);
grunt.registerTask("default", ["lint", "refresh", "build"]);
};
......@@ -15,6 +15,7 @@
"grunt-jscs": "^1.2",
"grunt-newer": "^1.1",
"grunt-shell": "^1.1",
"grunt-war": "^0.4",
"time-grunt": "^1.0"
},
"private": true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment