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
|
gulp = require 'gulp'
coffee = require 'gulp-coffee'
coffeeify = require 'gulp-coffeeify'
coffeelint = require 'gulp-coffeelint'
exec = require('child_process').exec
fs = require 'fs'
header = require 'gulp-header'
rename = require 'gulp-rename'
sass = require 'gulp-sass'
pkg = require './package.json'
gulp.task 'jqtree', ->
banner = fs.readFileSync('src/header.txt')
gulp.src './src/tree.jquery.coffee'
.pipe coffeeify()
.pipe header(banner, pkg: pkg)
.pipe gulp.dest('./')
gulp.task 'lib', ->
gulp.src './src/*.coffee'
.pipe coffee(bare: true)
.pipe gulp.dest('./lib')
gulp.task 'build_test', ->
gulp.src './src_test/test.js'
.pipe coffeeify()
.pipe rename('test_build.js')
.pipe gulp.dest('./test')
gulp.task 'jekyll', (cb) ->
exec 'jekyll build', (err, stdout, stderr) ->
console.log(stdout)
console.log(stderr)
cb(err)
gulp.task 'sass', ->
gulp.src './jqtree.scss'
.pipe sass(errLogToConsole: true)
.pipe gulp.dest('./')
gulp.task 'example_sass', ->
gulp.src './static/example.scss'
.pipe sass(errLogToConsole: true)
.pipe gulp.dest('./static')
gulp.task 'lint', ->
gulp.src './src/*.coffee'
.pipe coffeelint()
.pipe coffeelint.reporter()
gulp.task 'watch', ['default'], ->
gulp.watch ['./src/*.coffee', './src/test.js', './jqtree.scss', './static/example.scss'], ['default']
gulp.task 'default', ['jqtree', 'build_test', 'lib', 'sass', 'example_sass']
|