This repository has been archived by the owner on Jun 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgulpfile.js
102 lines (90 loc) · 2.31 KB
/
gulpfile.js
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
/*
* npm install gulp gulp-util gulp-concat gulp-coffee gulp-eco
* run `gulp`
*
*/
var gulp = require('gulp');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var coffee = require('gulp-coffee');
var eco = require('gulp-eco');
var shell = require('gulp-shell');
var paths = {
packages: [
'lib/init.js',
'lib/templates.js',
'lib/coffee.js'
],
scripts: [
'src/models/**/*.coffee',
'src/collections/**/*.coffee',
'src/views/**/*.coffee',
'src/routers/**/*.coffee'
],
specs: [
'spec/**/*.coffee'
],
spec_requirements: [
'lib/spec_helper.js',
'lib/templates.js',
'lib/coffee.js',
'lib/specs.js'
],
templates: [
'src/templates/**/*.eco'
]
};
gulp.task('scripts:init', function(){
return gulp.src(['src/init.coffee'])
.pipe(coffee({bare: true}))
.pipe(concat('init.js'))
.pipe(gulp.dest('lib'));
});
gulp.task('scripts', function(){
return gulp.src(paths.scripts)
.pipe(coffee())
.pipe(concat('coffee.js'))
.pipe(gulp.dest('lib'));
});
gulp.task('templates', function(){
return gulp.src(paths.templates)
.pipe(eco())
.pipe(concat('templates.js'))
.pipe(gulp.dest('lib'));
});
gulp.task('package', function(){
return gulp.src(paths.packages)
.pipe(concat('package.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('compile:specs', function(){
gulp.src(paths.specs)
.pipe(coffee())
.pipe(concat('specs.js'))
.pipe(gulp.dest('lib'));
});
gulp.task('assemble:specs', function(){
gulp.src(paths.spec_requirements)
.pipe(concat('specs-run.js'))
.pipe(gulp.dest('lib'));
});
gulp.task('run:specs', function(){
gulp.src('lib/specs-run.js')
.pipe(shell('./blinky_specs'));
});
gulp.task('test:specs', function(){
gulp.src('lib/specs-run.js')
.pipe(shell('./jenkins_specs'));
});
gulp.task('default', function(){
gulp.run('scripts');
gulp.run('templates');
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.templates, ['templates']);
gulp.watch(paths.scripts.concat(paths.specs).concat(paths.templates), ['compile:specs']);
gulp.watch(paths.spec_requirements.concat(['lib/spec_helper.js']), ['assemble:specs']);
gulp.watch(['src/init.coffee'], ['scripts:init']);
gulp.watch('lib/specs-run.js', ['run:specs']);
gulp.watch(['lib/**/*.js'], ['package']);
return
});