forked from otm/networkmap.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
145 lines (140 loc) · 3.27 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
concat: {
options: {
// define a string to put between each file in the concatenated output
separator: ';'
},
dist: {
// the files to concatenate
src: [
'lib/svg.js',
'lib/svg.draggable.js',
'lib/svg.math.js',
'lib/svg.path.js',
'lib/classList.js',
'src/networkMap.js',
'src/vec.js',
'src/event.configuration.js',
'src/widgets/integerinput.js',
'src/widgets/textinput.js',
'src/widgets/colorinput.js',
'src/widgets/accordion.js',
'src/widgets/list.js',
'src/widgets/select.js',
'src/widgets/modal.js',
'src/widgets/checkbox.js',
'src/widgets/gridinput.js',
'src/properties.js',
'src/datasource.js',
'src/events.js',
'src/colormap.js',
'src/colorlegend.js',
'src/settingsmanager.js',
'src/renderer/settingsManager.add.js',
'src/renderer/settingsManager.addLink.js',
'src/renderer/settingsManager.delete.js',
'src/renderer/settingsManager.modify.js',
'src/renderer/settingsManager.configure.js',
'src/renderer/link.utilizationLabel.js',
'src/graph.js',
'src/graph.module.settings.js',
'src/node.js',
'src/node.module.settings.js',
'src/node.events.js',
'src/linkpath.js',
'src/sublink.js',
'src/link.js',
'src/link.module.settings.js',
'src/link.module.edge.js'
],
// the location of the resulting JS file
dest: 'dist/<%= pkg.name %>.js'
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'spec/spec/*.js'],
options: {
// options here to override JSHint defaults
globals: {
console: true,
document: true,
undef: true
}
}
},
less: {
production: {
options: {
paths: ['resources/less'],
yuicompress: true
},
files: {
'dist/networkmap.css': 'resources/less/networkmap.less'
}
}
},
watch: {
scripts: {
files: ['<%= concat.dist.src %>', 'spec/spec/*.js'],
tasks: ['jshint', 'concat'],
options: {
interrupt: true
}
},
less: {
files: ['<%= less.production.options.paths %>/*.less'],
tasks: ['less'],
options: {
interrupt: true
}
},
markdown: {
files: ['README.md'],
tasks: ['markdown'],
options: {
interrupt: true
}
}
},
markdown: {
all:{
options:{
//markdownOptions: {
gfm: true,
highlight: 'manual'
//}
},
files: [
{
expand: true,
src: 'README.md',
dest: 'docs/html/',
ext: '.html'
}
]
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-markdown');
// Default task(s).
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less']);
};