forked from nicolas-t/Chocolat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
66 lines (56 loc) · 1.55 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
62
63
64
65
66
gulp = require 'gulp'
gutil = require 'gulp-util'
rename = require 'gulp-rename';
uglify = require 'gulp-uglify'
coffee = require 'gulp-coffee'
bump = require 'gulp-bump'
mochaPhantomJS = require 'gulp-mocha-phantomjs'
jshint = require 'gulp-jshint'
gulp.task 'compile-coffee', ->
gulp.src './test/*.coffee'
.pipe coffee({bare: true}).on('error', gutil.log)
.pipe gulp.dest './test/'
gulp.task 'testing', ->
gulp.src('./test/index.html')
.pipe(mochaPhantomJS());
gulp.task 'build-js', ->
gulp.src('./src/js/jquery.chocolat.js')
.pipe gulp.dest('./dist/js/')
.pipe(rename('jquery.chocolat.min.js'))
.pipe(uglify())
.pipe gulp.dest('./dist/js/')
gulp.task 'build-css', ->
gulp.src('./src/css/chocolat.css')
.pipe gulp.dest('./dist/css/')
gulp.task 'build-images', ->
gulp.src('./src/images/*')
.pipe gulp.dest('./dist/images/')
gulp.task 'lint', ->
gulp.src('./src/js/jquery.chocolat.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
gulp.task 'bump', ->
gulp.src(['./package.json', './bower.json'])
.pipe(bump())
.pipe gulp.dest('./')
gulp.task 'watch-test',->
gulp.watch(['./test/*.coffee', './src/js/*.js', './src/css/*.css'], ['test'])
gulp.task 'watch-src',->
gulp.watch(['./src/js/*.js', './src/css/*.css'], ['build-js', 'build-css'])
gulp.task 'test', [
'lint'
'build'
'compile-coffee'
'testing'
'watch-test'
]
gulp.task 'build', [
'build-js'
'build-css'
'build-images'
]
gulp.task 'default', [
'lint'
'build'
'watch-src'
]