forked from bpmn-io/bpmn-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
129 lines (103 loc) · 2.74 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
/* global process */
// 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: '../bower-bpmn-js/dist'
},
eslint: {
check: {
src: [
'{lib,test}/**/*.js'
]
},
fix: {
src: [
'{lib,test}/**/*.js'
],
options: {
fix: true
}
}
},
release: {
options: {
tagName: 'v<%= version %>',
commitMessage: 'chore(project): release v<%= version %>',
tagMessage: 'chore(project): tag v<%= version %>'
}
},
karma: {
options: {
configFile: '<%= config.tests %>/config/karma.unit.js'
},
single: {
singleRun: true,
autoWatch: false,
browsers: TEST_BROWSERS
},
unit: {
browsers: TEST_BROWSERS
},
translations: {
singleRun: true,
autoWatch: false,
reporters: [ 'dots', 'translation-reporter' ],
plugins: [
'karma-*',
require('./test/config/translation-reporter')
],
envPreprocessor: [
'TRANSLATIONS'
],
browsers: TEST_BROWSERS
}
},
bundle: {
viewer: {
name: 'bpmn-viewer',
src: '<%= config.sources %>/Viewer.js',
dest: '<%= config.dist %>'
},
navigated_viewer: {
name: 'bpmn-navigated-viewer',
src: '<%= config.sources %>/NavigatedViewer.js',
dest: '<%= config.dist %>'
},
modeler: {
name: 'bpmn-modeler',
src: '<%= config.sources %>/Modeler.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' }
]
}
}
});
grunt.loadTasks('tasks');
// tasks
grunt.registerTask('extract-translations', [ 'karma:translations' ]);
grunt.registerTask('test', [ 'karma:single' ]);
grunt.registerTask('lint', [ 'eslint:check' ]);
grunt.registerTask('auto-test', [ 'karma:unit' ]);
grunt.registerTask('build', [ 'bundle', 'copy' ]);
grunt.registerTask('default', [ 'lint', 'test', 'build' ]);
};