forked from tgdwyer/WebCola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
102 lines (100 loc) · 2.73 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
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
require('./tasks/examples')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
default: {
files: ["<%= concat.dist.src %>", "Gruntfile.js", "templates/*"],
tasks: ["default"]
},
typescript: {
files: ["<%= typescript.base.src %>"],
tasks: ["typescript"]
},
test: {
files: ["WebCola/test/*.js"],
tasks: ["qunit"]
}
},
typescript: {
base: {
src: ['WebCola/src/*.ts'],
dest: 'WebCola/compiledtypescript.js',
options: {
module: 'amd',
target: 'es5',
sourcemap: false
}
},
examples: {
src: ['WebCola/examples/*.ts'],
options: {
module: 'amd',
target: 'es5',
sourcemap: false
}
}
},
concat: {
options: {},
dist: {
src: [
'WebCola/compiledtypescript.js',
'WebCola/src/d3adaptor.js',
'WebCola/src/rbtree.js',
'WebCola/src/scc.js',
'WebCola/src/handle_disconnected.js'
],
dest: 'WebCola/cola.v3.min.js'
}
},
umd: {
all: {
src: '<%= concat.dist.dest %>',
template: 'templates/umd.hbs',
objectToExport: 'cola',
deps: {
'default': ['d3']
}
}
},
uglify: {
dist: {
options: {
//sourceMap: 'WebCola/cola.min.map',
//sourceMapIn: 'WebCola/compiledtypescript.js.map',
//sourceMapRoot: 'WebCola'
},
files: {
'WebCola/cola.v3.min.js': [
'<%= concat.dist.dest %>'
]
}
}
},
qunit: {
all: ['WebCola/test/*.html']
},
examples: {
all: ["WebCola/examples/*.html"]
},
yuidoc: {
compile: {
name: 'cola.js',
description: 'Javascript constraint based layout for high-quality graph visualization and exploration using D3.js and other web-based graphics libraries.',
version: '1',
url: 'http://marvl.infotech.monash.edu/webcola',
options: {
paths: 'WebCola/src',
outdir: 'WebCola/doc'
}
}
}
});
grunt.registerTask('default', ['typescript:base', 'concat', 'umd', 'uglify', 'qunit']);
grunt.registerTask('nougly', ['typescript:base', 'concat', 'umd', 'qunit']);
grunt.registerTask('nougly-notest', ['typescript', 'concat']);
grunt.registerTask('docs', ['yuidoc', 'typescript:examples']);
grunt.registerTask('full', ['default', 'typescript:examples', 'examples']);
};