-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.coffee
61 lines (52 loc) · 1.28 KB
/
Gulpfile.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
gulp = require 'gulp'
gutil = require 'gulp-util'
jade = require 'gulp-jade'
coffee = require 'gulp-coffee'
karma = require 'gulp-karma'
mainBowerFiles = require 'main-bower-files'
testFiles = [
'www/lib/angular.js'
'www/lib/jquery.js',
'www/lib/jasmine-jquery.js',
'www/lib/angular-mocks.js'
'www/**/app.js'
'www/**/*Spec.js'
]
gulp.task 'bower', () ->
return gulp.src(mainBowerFiles())
.pipe(gulp.dest('./www/lib'))
gulp.task 'jade', () ->
gulp.src('./src/**/*.jade')
.pipe(jade({}))
.pipe(gulp.dest('./www/'))
gulp.task 'coffee', () ->
gulp.src('./src/**/*.coffee')
.pipe(coffee({
bare: true
}))
.on('error', gutil.log)
.pipe(gulp.dest('./www/'))
gulp.task 'test', () ->
gulp.src(testFiles)
.pipe(karma({
configFile: 'karma.conf.js'
action: 'run'
}))
.on('error', (err) ->
throw err
)
gulp.task 'test-watch', () ->
gulp.src(testFiles)
.pipe(karma({
configFile: 'karma.conf.js'
action: 'watch'
}))
.on('error', (err) ->
throw err
)
gulp.task 'watch', () ->
gulp.watch './bower_components/**/*', ['bower']
gulp.watch 'src/**/*.jade', ['jade']
gulp.watch 'src/**/*.coffee', ['coffee']
gulp.watch 'src/**/*.coffee', ['test']
gulp.task 'default', ['bower', 'jade', 'coffee']