forked from iceddev/frozen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
147 lines (141 loc) · 3.79 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
146
147
/*global module:false, process:false*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
jshint: {
test: [
'src/**/*.js',
'specs/**/*.js',
],
docs: [
'src/**/*.js'
],
examples: [
'src/**/*.js',
'specs/**/*.js',
'examples/**/*.js',
'!examples/scripts/**/*.js'
],
all: [
'jsdoc_config.json',
'bower.json',
'package.json',
'Gruntfile.js',
'dojoConfig.js',
'frozen.profile.js',
'src/**/*.js',
'specs/**/*.js',
'examples/**/*.js',
'!examples/scripts/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
connect: {
test: {},
docs: {},
examples: {},
all: {
options: {
keepalive: true
}
},
options: {
hostname: '0.0.0.0',
port: 8000,
keepalive: false
}
},
open: {
test: {
path: 'http://<%= connect.options.hostname %>:<%= connect.options.port %>/_SpecRunner.html'
},
docs: {
path: 'http://<%= connect.options.hostname %>:<%= connect.options.port %>/docs/'
},
examples: {
path: 'http://<%= connect.options.hostname %>:<%= connect.options.port %>/examples/'
}
},
watch: {
test: {
files: '<%= jshint.test %>',
tasks: ['jshint:test', 'jasmine:all', 'jasmine:all:build', 'open:test']
},
docs: {
files: '<%= jshint.docs %>',
tasks: ['jshint:docs', 'jsdoc:all', 'copy:docs']
},
examples: {
files: '<%= jshint.examples %>',
tasks: ['jshint:examples', 'dojo']
},
all: {
files: '<%= jshint.all %>',
tasks: ['build']
}
},
dojo: {
frozen: {},
options: {
dojo: 'deps/dojo/dojo.js',
profile: 'frozen.profile.js',
'package': './',
dojoConfig: 'dojoConfig.js',
cwd: './'
}
},
jsdoc: {
all: {
src: ['src/**/*.js', 'package.json', 'README.md'],
dest: 'docs',
options: {
configure: 'jsdoc_config.json',
'private': false,
template: process.cwd() + '/node_modules/frozen-jsdoc-template'
}
}
},
copy: {
docs: {
files: [
{ dest: 'examples/index.html', src: 'docs/examples.html' },
{ expand: true, cwd: 'docs/', dest: 'examples/', src: ['styles/*.css', 'scripts/*.js'] }
]
}
},
jasmine: {
all: {
options: {
specs: 'specs/**/*Spec.js',
}
},
options: {
src: 'src/**/*.js',
helpers: [
'deps/Box2d.min.js',
'dojoConfig.js',
'deps/dojo/dojo.js'
],
host: 'http://127.0.0.1:8000/',
template: 'specs/fixtures/_SpecRunner.tmpl'
}
}
});
grunt.loadNpmTasks('grunt-dojo');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-connect');
// Default task.
grunt.registerTask('default', ['jshint:all', 'connect:test', 'jasmine:all']);
grunt.registerTask('build', ['jshint:all', 'connect:test', 'jasmine:all', 'jsdoc:all', 'dojo']);
grunt.registerTask('test', ['jshint:test', 'connect:test', 'jasmine:all', 'jasmine:all:build', 'open:test', 'watch:test']);
grunt.registerTask('docs', ['jshint:docs', 'jsdoc:all', 'copy:docs', 'connect:docs', 'open:docs', 'watch:docs']);
grunt.registerTask('examples', ['jshint:examples', 'dojo', 'connect:examples', 'open:examples', 'watch:examples']);
};