-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
66 lines (42 loc) · 2.18 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
#istanbul = require 'gulp-coffee-istanbul'
{task, async, sync, go, gutil} = require('ds-gulp-builder')(gulp = require('gulp'))
#{task, async, sync, go, gutil, errorHandler} = require('C://GIT//DSGulpBuilder//main//lib')(gulp = require('gulp'), -> gutil.env.production)
tasks = []
# Clear ./build and ./generated folders
clearFolders = [
task('clear-build').clearFolder('./build').keep('.git')
task('clear-generated').clearFolder('./generated').keep('.git')
task('clear-docs').clearFolder('./docs').keep('.git')
]
# ----------------------------
# Compile specs to ./generated/*.js This helps to debug a problem in some rear cases
if gutil.env.production
tasks.push task('compile-es5-src').coffee2js("./src").dest("./lib")
if gutil.env.compilespec
tasks.push task('compile-src').coffee2js("./src").dest("./generated/src")
tasks.push task('compile-specs').coffee2js("./spec").dest("./generated/spec")
# ----------------------------
# Build HTML verison
buildTasks = []
#buildTasks.push task('build-js').browserify('./src/index.coffee').dest('./build')
#
#buildTasks.push task('build-html').jade('./src').dest('./build')
#
#tasks.push sync [buildTasks, task('browser-sync', buildTasks).browserSync('./build')]
# ----------------------------
# Run specs
unless gutil.env.compilespec
# specsFilter = /\/200\/.*$/i
# specsFilter = /$/i
# tasks.push task('run-specs').jasmine('./spec', debug: true, filter: specsFilter, coverage: !!gutil.env.cover, includeStackTrace: !!gutil.env.stack, stackFilter: require('./src/utils/_lightStack')).watch(["./src/**/*.+(coffee|litcoffee|js)", "./src-gulp/**/*.+(coffee|litcoffee|js)"])
tasks.push task('run-specs').jasmine('./spec', debug: true, coverage: !!gutil.env.cover, includeStackTrace: !!gutil.env.stack, stackFilter: require('./src/utils/_lightStack')).watch(["./src/**/*.+(coffee|litcoffee|js)", "./src-gulp/**/*.+(coffee|litcoffee|js)"])
do (name = 'docco', src = "./spec/**/*.litcoffee", dest = './docs') ->
tasks.push name
gulp.task name, ->
gulp.watch src, [name]
gulp.src src
.pipe (require 'gulp-docco')()
.pipe gulp.dest dest # gulp.task name, ->
# ----------------------------
# Run
go sync [clearFolders, tasks]