-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.coffee
53 lines (49 loc) · 1.12 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
module.exports = ->
pkg = @file.readJSON 'package.json'
@initConfig
clean:
src: ['lib', 'reports']
copy:
js:
cwd: 'src'
expand: true
src: ['**/*.js']
dest: 'lib'
mkdir:
lib:
options:
create: ['lib']
reports:
options:
create: ['reports']
coffee:
build:
options:
bare: true
expand: true
cwd: 'src'
src: ['**/*.coffee']
dest: 'lib'
ext: '.js'
mochaTest:
test:
options:
require: 'coffee-script/register'
reporter: 'spec'
src: ['test/**/*.coffee']
jenkins:
options:
require: 'coffee-script/register'
reporter: 'xunit'
quiet: true
captureFile: 'reports/test-result.xml'
src: ['test/**/*.coffee']
@loadNpmTasks 'grunt-contrib-clean'
@loadNpmTasks 'grunt-contrib-coffee'
@loadNpmTasks 'grunt-contrib-copy'
@loadNpmTasks 'grunt-mkdir'
@loadNpmTasks 'grunt-mocha-test'
@registerTask 'test', ['mochaTest:test']
@registerTask 'build', ['mkdir:lib', 'coffee', 'copy:js']
@registerTask 'default', ['clean', 'test', 'build']
@registerTask 'jenkins', ['clean', 'mkdir:reports', 'mochaTest:jenkins', 'build']