-
Notifications
You must be signed in to change notification settings - Fork 21
/
Gruntfile.coffee
87 lines (77 loc) · 2.59 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
85
86
87
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
clean: ['lib','dist']
coffee:
glob_to_multiple:
expand: true
cwd: 'src'
src: ['*.coffee']
dest: 'lib'
ext: '.js'
coffeelint:
options:
no_empty_param_list:
level: 'error'
max_line_length:
level: 'ignore'
src: ['src/*.coffee']
test: ['spec/*.coffee']
gruntfile: ['Gruntfile.coffee']
browserify:
options:
banner: '/* <%= pkg.name %> - v<%= pkg.version %> - @license: <%= pkg.license %>; @author: Jean Christophe Roy; @site: <%= pkg.homepage %> */\n'
browserifyOptions:
standalone: 'fuzzaldrin'
dist:
src: 'lib/fuzzaldrin.js'
dest: 'dist-browser/fuzzaldrin-plus.js'
uglify:
options:
compress: true
preserveComments: false
banner: '/* <%= pkg.name %> - v<%= pkg.version %> - @license: <%= pkg.license %>; @author: Jean Christophe Roy; @site: <%= pkg.homepage %> */\n'
dist:
src: 'dist-browser/fuzzaldrin-plus.js',
dest: 'dist-browser/fuzzaldrin-plus.min.js'
shell:
test:
command: 'node node_modules/jasmine-focused/bin/jasmine-focused --coffee --captureExceptions spec'
options:
stdout: true
stderr: true
failOnError: true
mkdir:
command: 'mkdir dist'
options:
stdout: true
stderr: true
nugetpack:
options:
properties:'versiondir=<%= pkg.version %>'
verbosity: 'detailed'
dist:
src: 'fuzzaldrin-plus.nuspec'
dest: 'dist/'
options:
version: '<%= pkg.version %>'
nugetpush:
dist:
src: 'dist/*.nupkg'
options:
apiKey: '<specify API key before executing nugetpush task>'
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-shell')
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-browserify')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-nuget')
grunt.loadNpmTasks('grunt-bower-task')
grunt.registerTask('lint', ['coffeelint'])
grunt.registerTask('test', ['default', 'shell:test'])
grunt.registerTask('prepublish', ['clean', 'test', 'distribute'])
grunt.registerTask('default', ['coffee', 'lint'])
grunt.registerTask('distribute', ['default', 'browserify', 'uglify'])
grunt.registerTask('packnuget', ['shell:mkdir', 'nugetpack'])
grunt.registerTask('publishnuget', ['packnuget', 'nugetpush'])