forked from node-cache/node-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
84 lines (72 loc) · 1.85 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
banner: """
/*
* <%= pkg.name %> <%= pkg.version %> ( <%= grunt.template.today( 'yyyy-mm-dd' )%> )
* <%= pkg.homepage %>
*
* Released under the MIT license
* <%= pkg.homepage %>/blob/master/LICENSE
*
* Maintained by <%= pkg.maintainers.name %> ( <%= pkg.maintainers.url %> )
*/
"""
watch:
module:
files: ["_src/**/*.coffee"]
tasks: [ "coffee:base" ]
coffee:
base:
expand: true
cwd: '_src',
src: ["**/*.coffee"]
dest: ''
ext: '.js'
clean:
base:
src: [ "lib", "test", "*.js" ]
includereplace:
pckg:
options:
globals:
version: "<%= pkg.version %>"
prefix: "@@"
suffix: ''
files:
"index.js": ["index.js"]
usebanner:
options:
banner: "<%= banner %>"
base:
files:
"index.js": ["index.js"]
"lib/node_cache.js": ["lib/node_cache.js"]
"test/node_cache-test.js": ["test/node_cache-test.js"]
mochacli:
options:
require: [ "should", "coffee-coverage/register-istanbul" ]
reporter: "spec"
bail: false
timeout: 3000
slow: 3
compilers: "coffee:coffee-script/register"
main:
src: [ "_src/test/mocha_test.coffee" ]
# Load npm modules
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-include-replace"
grunt.loadNpmTasks "grunt-banner"
grunt.loadNpmTasks "grunt-mocha-cli"
# ALIAS TASKS
grunt.registerTask "default", "build"
grunt.registerTask "clear", [ "clean:base" ]
grunt.registerTask "test", "mochacli:main"
# Shortcuts
grunt.registerTask "b", "build"
grunt.registerTask "w", "watch"
# build the project
grunt.registerTask "build", [ "clear", "coffee:base", "usebanner:base", "includereplace:pckg" ]