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