-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.coffee
172 lines (156 loc) · 4.53 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
'use strict'
module.exports = (grunt) ->
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
grunt.initConfig
clean:
dev: ['./public/scripts', './public/styles']
dist: ['./dist', './build']
coffee:
options:
bare: true
sourceRoot: ''
dev:
options:
sourceMap: true
files: [
expand: true
cwd: './app/client/scripts'
src: '{,**/}*.coffee'
dest: './public/scripts'
ext: '.js'
]
dist:
options:
sourceMap: false
files: [
expand: true
cwd: './app/client/scripts'
src: '{,**/}*.coffee'
dest: './build/scripts'
ext: '.js'
]
copy:
coffee:
files: [
expand: true
cwd: './app/client/scripts'
src: '{,*/}*.coffee'
dest: './public/scripts'
]
index:
files: [
expand: true
cwd: './app/server/views'
src: 'index.erb'
rename: -> './app/server/views/generated/index_production.erb'
]
images:
files: [
expand: true
cwd: './public/vendor/components/jquery-ui/themes/smoothness'
src: 'images/*'
dest: './dist'
]
regarde:
coffee:
files: ['./app/client/scripts/{,**/}*.coffee']
tasks: ['coffee:dev', 'copy:coffee']
ngtemplates:
files: [ './app/client/templates/{,**/}*.html']
tasks: ['ngtemplates:dev']
compass:
files: ['./app/client/styles/*.{scss,sass}']
tasks: ['compass:dev']
livereload:
files: [
'server/views/index.erb'
'./public/scripts/{,**/}*.js'
'./public/styles/{,**/}*.css'
'./public/images/{,**/}*.{png,jpg,jpeg}'
]
tasks: ['livereload']
compass:
options:
sassDir: './app/client/styles'
importPath: './public/vendor/components'
dev:
options:
cssDir: './public/styles'
dist:
options:
cssDir: './build/styles'
ngtemplates:
options:
base: './app/client/templates'
module: 'singularApp'
dev:
src: './app/client/templates/**/*.html'
dest: 'public/scripts/templates.js'
dist:
src: './app/client/templates/**/*.html'
dest: 'build/scripts/templates.js'
useminPrepare:
html: './app/server/views/generated/index_production.erb'
options:
dest: './dist'
usemin:
html: ['./app/server/views/generated/index_production.erb']
options:
basedir: './dist'
rev:
assets:
files: [
src: [
'./dist/app.js',
'./dist/vendor.js',
'./dist/ie.js',
'./dist/styles.css'
]
]
ngmin:
dist:
files: [
expand: true,
cwd: './build/scripts'
src: '{,**/}*.js'
dest: './build/scripts'
]
karma:
options:
configFile: './test/jasmine/karma.conf.js'
unit:
singleRun: true
watch:
autoWatch: true
coffeelint:
options:
max_line_length:
value: 120
all: ['./app/client/scripts/{,**/}*.coffee']
shell:
options:
stdout: true
failOnError: true
minitest:
command: 'bundle exec ruby test/unit/suite.rb'
webtest:
command: 'bundle exec ruby test/webtest/suite.rb'
git_add:
command: 'git add .'
git_rm:
command: 'git rm `git ls-files --deleted`'
options:
failOnError: false
git_commit:
command: 'git commit -m "Dist & deploy to heroku" && git push'
heroku:
command: 'git push heroku master && heroku open'
grunt.registerTask 'checks', ['coffeelint']
grunt.registerTask 'watch', ['clean:dev', 'livereload-start', 'coffee:dev', 'copy:coffee', 'ngtemplates:dev', 'compass:dev', 'regarde']
grunt.registerTask 'minimize', ['copy:index', 'useminPrepare', 'concat', 'cssmin', 'uglify', 'copy:images', 'rev', 'usemin']
grunt.registerTask 'dist', ['clean:dist', 'coffee:dist', 'ngtemplates:dist', 'ngmin', 'compass:dist', 'checks', 'test', 'minimize']
grunt.registerTask 'deploy', ['dist', 'shell:git_add', 'shell:git_rm', 'shell:git_commit', 'shell:heroku']
grunt.registerTask 'test', ['karma:unit', 'shell:minitest']
grunt.registerTask 'webtest', ['shell:webtest']
grunt.registerTask 'autotest', ['karma:watch']
grunt.registerTask 'default', ['watch']