-
Notifications
You must be signed in to change notification settings - Fork 20
/
Gruntfile.coffee
58 lines (52 loc) · 1.92 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
module.exports = gruntFunction = (grunt) ->
gruntConfig =
urequire: # eat your own dogfood
_all:
dependencies: imports:
lodash: '_'
uberscore: '_B'
'utils/UError': 'UError'
resources:[
[ '+inject-_B.logger', ['**/*.js'],
(m)-> m.beforeBody = "var l = new _B.Logger('uRequire/#{m.path}');"] ]
runtimeInfo: false
bare: true
template: name: 'nodejs'
verbose: true
debugLevel: 0
lib:
path: 'source/code'
dstPath: 'build/code'
main: 'urequire'
template: banner: true
resources: [ 'inject-version' ]
preSpec:
path: 'source/spec'
dstPath: 'build/spec'
copy: /./
dependencies:
imports:
chai: 'chai'
specHelpers: 'spH'
replace: '../code/utils/UError' : 'utils/UError'
resources: [
['import-keys',
specHelpers: """
equal, notEqual, ok, notOk, tru, fals, deepEqual, notDeepEqual, exact, notExact, iqual,
notIqual, ixact, notIxact, like, notLike, likeBA, notLikeBA, equalSet, notEqualSet"""
chai: 'expect' ] ]
spec:
derive: 'preSpec',
afterBuild: require('urequire-ab-specrunner').options
mochaOptions: "-t 10000 --bail"
specWatch: derive: 'spec', watch: after: 'copy'
copy: wiki: files: [ expand: true, cwd: "source/code/config", src: ["*.md"], dest: "wiki/"]
clean: build: 'build', temp: 'temp'
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: 'clean lib spec copy'
develop: 'clean lib specWatch'
}
require('load-grunt-tasks')(grunt)
grunt.initConfig gruntConfig