-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
62 lines (55 loc) · 1.5 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
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['app/js/*.js', 'test/e2e/*.js', 'test/unit/*.js'],
options: {
globalstrict: true,
browser: true,
globals: {
jQuery: true,
Chess: true,
ChessBoard: true,
angular: true,
describe: true,
it: true,
xit: true,
inject: true,
module: true,
element: true,
expect: true,
beforeEach: true,
browser: true
}
}
},
jasmine : {
src : 'app/**/*.js',
options : {
specs : 'test/unit/**/*.js',
}
},
compress: {
main: {
options: {
archive: 'build/kinghunt.zip'
},
files: [
{src: ['app/**', 'VERSION', 'manifest.webapp']}, // includes files in path and its subdirs
]
}
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('version', 'Write a VERSION file to include in the archive', function() {
var now = new Date();
var pkg = grunt.config('pkg');
var contents = 'version ' + pkg.version + '\nBuilt: ' + now + '\n';
grunt.file.write('VERSION', contents);
});
grunt.registerTask('test', ['jshint', 'jasmine']);
grunt.registerTask('build', ['version', 'compress:main']);
};