forked from algenty/grafana-flowcharting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
99 lines (90 loc) · 2.69 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
const path = require("path");
const plugin = require('./src/plugin.json');
const version = plugin.info.version;
module.exports = (grunt) => {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.initConfig({
clean: {
before_init: {
src: ['externals/**/*'],
},
after_init: {
src: ['externals/**/.git'],
},
},
copy: {
// Copy Shapes from draw.io to src/lib
shapes2src: {
cwd: 'externals/drawio/src/main/webapp/shapes',
expand: true,
src: ['**/*.js'],
dest: 'src/libs/shapes',
},
// Copy files not supported by toolkit to dist like css
src2dist: {
cwd: 'src',
expand: true,
src: ['css/**/*'],
dest: 'dist',
},
// Copy ressources to src/libs
mxRes2src: {
cwd: 'node_modules/mxgraph/javascript/src',
expand: true,
src: ['**/*', '!**/*.js'],
dest: 'src/libs/mxgraph/javascript/dist',
},
// Copy editor maxgraph libs to src/libs
mxEditor2src: {
cwd: 'externals/mxgraph/javascript/examples/grapheditor/www',
expand: true,
src: ['**/*', '!**/*.js'],
dest: 'dist/libs/mxgraph/javascript/dist',
},
stencils2src: {
cwd: 'externals/drawio/src/main/webapp/stencils',
expand: true,
src: ['**/*', '!**/*.js'],
dest: 'src/libs/mxgraph/javascript/dist/stencils',
},
},
compress: {
main: {
options: {
archive: "archives/agenty-flowcharting-panel-" + version + "-SNAPSHOT.zip",
},
expand: true,
cwd: '.',
src: ['**/*', '!src/**', '!node_modules/**', '!backups/**', '!bower_components/**', '!others/**', '!.git/**', '!archives/**', '!public/**', '!backup/**', '!spec/**', '!spec/__snapshots__/**','!externals/**'],
dest: 'grafana-flowcharting',
},
},
gitclone: {
mxgraph: {
options: {
repository: 'https://github.com/jgraph/mxgraph',
branch: 'master',
depth: 1,
tags: "v4.0.4",
directory: 'externals/mxgraph',
verbose: true,
}
},
drawio: {
options: {
repository: 'https://github.com/jgraph/drawio',
branch: 'master',
depth: 1,
tags : "v11.2.8",
directory: 'externals/drawio',
verbose: true,
}
}
},
});
grunt.registerTask('archive', ['compress:main']);
grunt.registerTask('init', ['clean:before_init','gitclone:mxgraph','gitclone:drawio','clean:after_init']);
};