forked from softwerkskammer/Agora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
115 lines (110 loc) · 3.87 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
module.exports = function (grunt) {
// See http://www.jshint.com/docs/#strict
"use strict";
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
jshint: {
files: ['**/*.js', '**/*.json', '.jshintrc', '!node_modules/**/*.js', '!node_modules/**/*.json', '!public/**/*.js', '!public/**/*.json', '!frontendtests/lib/**/*.js', '!frontendtests/lib/**/*.json'],
options: {
jshintrc: '.jshintrc'
}
},
watch: {
files: ['<%= jshint.files %>', '**/*.jade'],
tasks: ['default']
},
mochaTest: {
test: {
options: {
reporter: 'spec',
// Require blanket wrapper here to instrument other required
// files on the fly.
//
// NB. We cannot require blanket directly as it
// detects that we are not running mocha cli and loads differently.
//
// NNB. As mocha is 'clever' enough to only run the tests once for
// each file the following coverage task does not actually run any
// tests which is why the coverage instrumentation has to be done here
require: 'blanket',
colors: true
},
src: ['test/**/*.js']
},
coverage: {
options: {
reporter: 'html-cov',
// use the quiet flag to suppress the mocha console output
quiet: true,
// specify a destination file to capture the mocha
// output (the quiet option does not suppress this)
captureFile: 'coverage.html'
},
src: ['test/**/*.js']
},
'travis-cov': {
options: {
reporter: 'travis-cov'
},
src: ['test/**/*.js']
}
},
qunit: {
files: ['frontendtests/*.html']
},
sass: {
default: {
options: {
outputStyle: 'compressed',
sourceComments: 'none'
},
files: {
'public/stylesheets/screen.css': 'public/stylesheets/screen.scss'
}
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: [
'public/clientscripts/global/jquery-1.9.1.js',
'public/clientscripts/global/bootstrap.js',
'public/clientscripts/global/bootstrap-datepicker.js',
'public/clientscripts/global/bootstrap-markdown-patched.js',
'public/clientscripts/global/markdown.js',
'public/clientscripts/global/fullcalendar.js',
'public/clientscripts/global/bootstrap-colorpicker.js',
'public/clientscripts/global/bootstrap-datepicker.de.js',
'public/clientscripts/global/jquery.validate-1.11.1.js',
'public/clientscripts/global/additional-methods-1.11.1.js',
'public/clientscripts/global/messages_de.js',
'public/clientscripts/global/methods_de.js',
'public/clientscripts/global/bootstrap-timepicker-patched.js',
'public/clientscripts/global/agora.js'
],
dest: 'public/clientscripts/global.js',
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-sass');
// Default task.
grunt.registerTask('default', ['sass', 'concat', 'jshint', 'qunit', 'mochaTest']);
// Travis-CI task
grunt.registerTask('travis', ['default']);
};