-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
36 lines (32 loc) · 1.15 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
module.exports = gruntFunction = (grunt) ->
gruntConfig =
urequire:
_all:
dependencies: imports: {lodash: ['_']}
template:
name: 'nodejs'
banner: true
lib:
path: 'source/code'
dstPath: 'build/code'
resources: [ 'inject-version' ]
spec:
path: 'source/spec'
dstPath: 'build/spec'
dependencies: imports:
umatch: 'umatch'
chai: 'chai'
specHelpers: 'spH'
resources: [
['import-keys',
'specHelpers': 'equalSet, equal, tru, fals'
'chai': 'expect' ] ]
afterBuild: require 'urequire-ab-specrunner'
specWatch: derive: 'spec', watch: true
splitTasks = (tasks)-> if (tasks instanceof Array) then tasks else tasks.split(/\s/).filter((f)->!!f)
grunt.registerTask shortCut, "urequire:#{shortCut}" for shortCut of gruntConfig.urequire
grunt.registerTask shortCut, splitTasks tasks for shortCut, tasks of {
default: 'lib spec'
}
grunt.loadNpmTasks task for task of grunt.file.readJSON('package.json').devDependencies when task.lastIndexOf('grunt-', 0) is 0
grunt.initConfig gruntConfig