-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntfile.js
99 lines (78 loc) · 2.08 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
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
// configures browsers to run test against
// any of [ 'PhantomJS', 'Chrome', 'Firefox', 'IE']
var TEST_BROWSERS = ((process.env.TEST_BROWSERS || '').replace(/^\s+|\s+$/, '') || 'PhantomJS').split(/\s*,\s*/g);
// project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
config: {
sources: 'lib',
tests: 'test',
dist: '../../stratas/stratas-app/qplat-ui/stratas-web-ui/src/main/webapp/static/resources/libs/sparta-bpmn-modeler'
},
jshint: {
src: [
['<%=config.sources %>']
],
options: {
jshintrc: true
}
},
karma: {
options: {
configFile: '<%= config.tests %>/config/karma.unit.js'
},
single: {
singleRun: true,
autoWatch: false,
browsers: TEST_BROWSERS
},
unit: {
browsers: TEST_BROWSERS
}
},
jsdoc: {
dist: {
src: [ '<%= config.sources %>/**/*.js' ],
options: {
destination: 'docs/api',
plugins: [ 'plugins/markdown' ]
}
}
},
bundle: {
modeler: {
name: 'bpmn-modeler',
src: '<%= config.sources %>/SpartaModeler.js',
dest: '<%= config.dist %>'
}
},
copy: {
bpmn_js: {
files: [
{ expand: true, cwd: 'assets', src: [ '**' ], dest: '<%= config.dist %>/assets' }
]
},
diagram_js: {
files: [
{ expand: true, cwd: 'node_modules/diagram-js/assets', src: [ '**' ], dest: '<%= config.dist %>/assets' }
]
},
},
exec : {
rsync : {
cwd : 'C:/dev/Git/stratas',
command : 'vagrant rsync'
}
}
});
grunt.loadTasks('tasks');
// tasks
grunt.registerTask('test', [ 'karma:single' ]);
grunt.registerTask('auto-test', [ 'karma:unit' ]);
grunt.registerTask('build', ['bundle', 'exec:rsync' ]);
grunt.registerTask('default', [ 'jshint', 'test', 'bundle', 'jsdoc' ]);
};