-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
97 lines (87 loc) · 2.49 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["static/js/chiscore", "spec/javascript/target"],
watch: {
coffee: {
files: [
'spec/javascript/chiscore/**/*.coffee',
'static/coffee/chiscore/**/*.coffee'
],
tasks: 'coffee'
},
jst: {
files: ['static/templates/**/*.ejs'],
tasks: 'jst'
}
},
jst: {
chiscore: {
options: {
namespace: 'EJS',
processName: function(name) {
return name.replace("static/templates/", "").replace(".ejs", "");
}
},
expand: true,
cwd: 'static/templates',
src: ['**/*.ejs'],
ext: '.js',
dest: 'static/ejs'
}
},
jasmine: {
chiscore: {
src: [
"static/ejs/checkin.ejs",
"static/js/chiscore/chiscore.js",
"static/js/chiscore/checkin.js",
"static/js/chiscore/checkin-collection.js",
"static/js/chiscore/checkin-view.js",
"static/js/chiscore/services.js",
"static/js/chiscore/board-view.js",
"static/js/chiscore/checkin_board.js",
"static/js/chiscore/models/checkin.js",
"static/js/chiscore/active_board.js"
],
options: {
vendor: [
"static/js/jquery.min.js",
"static/js/select2.min.js",
"static/js/underscore.min.js",
"static/js/backbone.min.js",
],
specs: 'spec/javascript/target/**/*.js',
helpers: [
'spec/javascript/support/jasmine-jquery.js',
'spec/javascript/support/jasmine-fixture.js'
]
}
}
},
coffee: {
specs: {
expand: true,
cwd: 'spec/javascript/chiscore',
src: ['**/*.coffee'],
ext: '.js',
dest: 'spec/javascript/target'
},
sources: {
expand: true,
cwd: 'static/coffee/chiscore',
src: ['**/*.coffee'],
ext: '.js',
dest: 'static/js/chiscore'
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.registerTask('spec', ['clean', 'coffee', 'jst', 'jasmine']);
grunt.registerTask('build', ['clean', 'coffee', 'jst']);
grunt.registerTask('default', ['spec']);
};