forked from ogobrecht/apex-plugin-dhtmlx-gantt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
58 lines (58 loc) · 2.13 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* global module */
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON("apexplugin.json"),
banner: '/**\n' +
' * Oracle APEX plugin <%= pkg.name %> helper - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) 2017<%= parseInt(grunt.template.today("yyyy")) > 2017 ? "-" + grunt.template.today("yyyy") : "" %> <%= pkg.author.name %> - <%= pkg.license %> license\n' +
' */\n',
jshint: {
files: [
"Gruntfile.js",
"apexplugin.json",
"sources/plugin-dhtmlxgantt-helper.js"
],
options: {
jshintrc: true
}
},
copy: {
server: {
src: "sources/plugin-dhtmlxgantt-helper.js",
dest: "server/plugin-dhtmlxgantt-helper.js",
options: {
process: function(content, srcpath) {
return grunt.template.process("<%= banner %>") + "\n" +
content.replace(/x\.x\.x/g, grunt.template.process("<%= pkg.version %>"));
}
}
}
},
uglify: {
options: {
banner: "<%= banner %>"
},
server: {
src: "server/plugin-dhtmlxgantt-helper.js",
dest: "server/plugin-dhtmlxgantt-helper.min.js"
},
},
watch: {
files: [
"Gruntfile.js",
"apexplugin.json",
"sources/*",
"LICENSE.txt"
],
tasks: ["default"]
}
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-notify");
grunt.registerTask("default", ["jshint", "copy", "uglify"]);
};