forked from ulaurson/dmn-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
111 lines (91 loc) · 2.32 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
'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-dmn-js/dist'
},
jshint: {
src: [
['<%=config.sources %>']
],
options: {
jshintrc: 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
}
},
bundle: {
viewer: {
name: 'dmn-viewer',
src: '<%= config.sources %>/Viewer.js',
dest: '<%= config.dist %>'
},
modeler: {
name: 'dmn-modeler',
src: '<%= config.sources %>/Modeler.js',
dest: '<%= config.dist %>'
}
},
less: {
options: {
paths: [
// in order to be able to import "bootstrap/less/**"
'node_modules'
]
},
styles: {
files: { '<%= config.dist %>/css/dmn-js.css': 'styles/dmn-js.less' }
}
},
copy: {
fonts: {
files: [
{expand: true, cwd: 'fonts', src: ['dmn-js*'], dest: '<%= config.dist %>/fonts'},
]
}
},
jsdoc: {
dist: {
src: [ '<%= config.sources %>/**/*.js' ],
options: {
destination: 'docs/api',
plugins: [ 'plugins/markdown' ]
}
}
}
});
// tasks
grunt.loadTasks('tasks');
grunt.registerTask('test', [ 'karma:single' ]);
grunt.registerTask('auto-test', [ 'karma:unit' ]);
grunt.registerTask('build', [ 'bundle', 'less', 'copy:fonts' ]);
grunt.registerTask('default', [ 'jshint', 'test', 'build', 'jsdoc' ]);
};