forked from andrewminer/crafting-guide-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
57 lines (44 loc) · 1.64 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
###
# Crafting Guide - Gruntfile.coffee
#
# Copyright (c) 2014 by Redwood Labs
# All rights reserved.
###
fs = require 'fs'
util = require 'util'
########################################################################################################################
module.exports = (grunt)->
grunt.loadTasks tasks for tasks in grunt.file.expand './node_modules/grunt-*/tasks'
grunt.config.init
mochaTest:
options:
bail: true
color: true
reporter: 'dot'
require: [
'coffee-script/register'
'./test/test_helper.coffee'
]
verbose: true
src: ['./test/**/*.test.coffee']
watch:
data_files:
files: ['./data/**/*.cg']
tasks: ['mochaTest']
grunt.registerTask 'default', 'build'
grunt.registerTask 'build', [ ]
grunt.registerTask 'dist', [ 'test' ]
grunt.registerTask 'use-local-deps', ->
grunt.file.mkdir './node_modules'
grunt.file.delete './node_modules/crafting-guide', force:true
grunt.file.delete './node_modules/crafting-guide-common', force:true
fs.symlinkSync '../../crafting-guide/', './node_modules/crafting-guide'
fs.symlinkSync '../../crafting-guide-common/', './node_modules/crafting-guide-common'
grunt.registerTask 'test', ['mochaTest']
args = process.argv[..]
while args.length > 0
switch args[0]
when '--grep'
args.shift()
grunt.config.merge mochaTest:options:grep:args[0]
args.shift()