/
Gruntfile.coffee
74 lines (64 loc) · 2.24 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
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
meta:
banner:
'// spine.paginator.js\n' +
'// version: <%= pkg.version %>\n' +
'// author: <%= pkg.author %>\n' +
'// license: <%= pkg.licenses[0].type %>\n'
coffee:
all:
files:
'dist/spine.paginator.js': 'src/spine.paginator.coffee'
'dist/spine.pagination_controller.js': 'src/spine.pagination_controller.coffee'
'examples/spine_pagination.js': 'examples/spine_pagination.coffee'
concat:
all:
options:
banner: '<%= meta.banner %>'
files:
'dist/spine.paginator.js': 'dist/spine.paginator.js'
'dist/spine.pagination_controller.js': 'dist/spine.pagination_controller.js'
uglify:
all:
options:
banner: '<%= meta.banner %>'
report: 'gzip'
files:
'dist/spine.paginator.min.js': 'dist/spine.paginator.js'
'dist/spine.pagination_controller.min.js': 'dist/spine.pagination_controller.js'
copy:
main:
files: [
{expand: true, flatten: true, src: ['dist/**'], dest: 'vendor/assets/javascripts/'}
]
jasmine:
all:
src: 'dist/*.js'
options:
specs: 'spec/spine.paginator/**/*.js'
helpers: 'spec/lib/**/*.js'
slim:
all:
files:
'examples/spine_pagination.html': 'examples/spine_pagination.slim'
sass:
all:
files:
'examples/spine_pagination.css': 'examples/spine_pagination.scss'
watch:
all:
files: ['src/*.coffee', 'examples/*.coffee', 'examples/*.slim', 'examples/*.scss']
tasks: ['build', 'spec']
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-jasmine'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-slim'
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.registerTask 'default', ['watch']
grunt.registerTask 'spec', ['jasmine']
grunt.registerTask 'build', ['coffee', 'concat', 'uglify', 'copy', 'slim', 'sass']