-
Notifications
You must be signed in to change notification settings - Fork 34
/
Gruntfile.coffee
108 lines (91 loc) · 2.89 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
pkg = grunt.file.readJSON('package.json')
require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks)
# Project configuration.
grunt.initConfig
pkg: pkg
meta:
banner: '/*!\n * <%= pkg.title %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * <%= pkg.homepage %>/\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> ' +
'<%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n'
clean:
options:
force: true
runner: pkg.directories.build
coffee:
runner:
options:
join: true
bare: false
files:
'<%= pkg.directories.build %>/<%= pkg.name %>.js': '<%= pkg.directories.build %>/<%= pkg.name %>.coffee'
tests:
expand: true
options:
bare: true
flatten: false
cwd: '<%= pkg.directories.test %>/'
src: '**/*.coffee'
dest: '<%= pkg.directories.test %>/'
ext: '.js'
concat:
coffee:
src: [
'<%= pkg.directories.lib %>/utils.coffee'
'<%= pkg.directories.lib %>/runner.coffee'
'<%= pkg.directories.lib %>/expose.coffee'
]
dest: '<%= pkg.directories.build %>/<%= pkg.name %>.coffee'
runner:
options:
banner: '<%= meta.banner %>'
process: true
src: '<%= pkg.directories.build %>/<%= pkg.name %>.js'
dest: '<%= pkg.directories.build %>/<%= pkg.name %>.js'
coffeelint:
runner: '<%= pkg.directories.lib %>/*.coffee'
options:
line_endings: level: 'error'
no_backticks: level: 'error'
space_operators: level: 'error'
no_implicit_braces: level: 'error'
no_implicit_parens: level: 'error'
no_empty_param_list: level: 'error'
max_line_length: level: 'ignore'
uglify:
options:
banner: '<%= meta.banner %>'
runner:
files:
'<%= pkg.directories.build %>/<%= pkg.name %>-min.js': '<%= concat.runner.dest %>'
jasmine:
runner:
src: '<%= pkg.directories.build %>/<%= pkg.name %>.js'
options:
keepRunner: true
outfile: 'SpecRunner.html'
vendor: [
'components/jquery/dist/jquery.js'
]
specs: '<%= pkg.directories.test %>/tests/*Spec.js'
helpers: [
'<%= pkg.directories.test %>/helpers/*.js',
'components/jasmine-matchers/dist/jasmine-matchers.js',
'components/jasmine-sinon/lib/sinon-1.0.0/sinon-1.0.0.js',
'components/jasmine-sinon/lib/jasmine-sinon.js'
]
grunt.registerTask 'default', [
'coffeelint:runner'
'clean:runner'
'concat:coffee'
'coffee:runner'
'concat:runner'
'uglify:runner'
]
grunt.registerTask 'test', [
'default'
'coffee:tests'
'jasmine:runner'
]