@@ -4,13 +4,20 @@ var testacular = require('testacular');
4
4
module . exports = function ( grunt ) {
5
5
6
6
grunt . loadNpmTasks ( 'grunt-recess' ) ;
7
+ grunt . loadNpmTasks ( 'grunt-coffee' ) ;
7
8
8
9
// Project configuration.
9
10
grunt . initConfig ( {
10
11
pkg : '<json:package.json>' ,
11
12
meta : {
12
13
banner : '/**\n' + ' * <%= pkg.description %>\n' + ' * @version v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + ' * @link <%= pkg.homepage %>\n' + ' * @license MIT License, http://www.opensource.org/licenses/MIT\n' + ' */'
13
14
} ,
15
+ coffee : {
16
+ build : {
17
+ src : [ 'common/src/*.coffee' , 'modules/**/src/*.coffee' ] ,
18
+ extension : ".coffee.js"
19
+ }
20
+ } ,
14
21
concat : {
15
22
basic : {
16
23
src : [ '<banner:meta.banner>' , 'common/*.js' , 'modules/*/*/*.js' ] ,
@@ -53,7 +60,7 @@ module.exports = function(grunt) {
53
60
watch : {
54
61
files : [ 'modules/**/*.coffee' , 'modules/**/*.js' , 'common/**/*.js' ] ,
55
62
tasks : 'coffee concat:basic test'
56
- } ,
63
+ }
57
64
} ) ;
58
65
59
66
// Default task.
@@ -69,7 +76,7 @@ module.exports = function(grunt) {
69
76
var done = this . async ( ) ;
70
77
grunt . utils . spawn ( {
71
78
cmd : 'testacular-run' ,
72
- args : [ 'test/test-config.js' ] ,
79
+ args : [ 'test/test-config.js' ]
73
80
} , function ( error , result , code ) {
74
81
if ( error ) {
75
82
grunt . warn ( "Make sure the testacular server is online: run `grunt server`.\n" +
@@ -85,16 +92,4 @@ module.exports = function(grunt) {
85
92
}
86
93
} ) ;
87
94
} ) ;
88
-
89
- grunt . registerTask ( 'coffee' , 'compile coffee files' , function ( ) {
90
- var done = this . async ( ) ;
91
- grunt . utils . spawn ( {
92
- cmd : 'coffee' ,
93
- args : [ '-cb' , 'modules' ]
94
- } , function ( error , result , code ) {
95
- if ( error ) grunt . warn ( error . stderr ) ;
96
- else grunt . log . write ( result . stdout ) ;
97
- done ( ) ;
98
- } ) ;
99
- } ) ;
100
95
} ;
0 commit comments