forked from jesseditson/winston-sns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
66 lines (55 loc) · 1.45 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
'use strict'
module.exports = (grunt)->
# load all grunt tasks
(require 'matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
_ = grunt.util._
path = require 'path'
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffeelint:
gruntfile:
src: '<%= watch.gruntfile.files %>'
lib:
src: '<%= watch.lib.files %>'
options:
no_trailing_whitespace:
level: 'error'
max_line_length:
level: 'warn'
value: 100
coffee:
lib:
expand: true
cwd: 'src/'
src: ['**/*.coffee']
dest: 'lib/'
ext: '.js'
watch:
options:
spawn: false
gruntfile:
files: 'Gruntfile.coffee'
tasks: ['coffeelint:gruntfile']
lib:
files: ['src/**/*.coffee']
tasks: ['coffeelint:lib', 'coffee:lib']
clean: ['out/']
grunt.event.on 'watch', (action, files, target)->
grunt.log.writeln "#{target}: #{files} has #{action}"
# coffeelint
grunt.config ['coffeelint', target], src: files
# coffee
coffeeData = grunt.config ['coffee', target]
files = [files] if _.isString files
files = files.map (file)-> path.relative coffeeData.cwd, file
coffeeData.src = files
grunt.config ['coffee', target], coffeeData
# tasks.
grunt.registerTask 'compile', [
'coffeelint'
'coffee'
]
grunt.registerTask 'default', [
'compile'
]