forked from hexojs/site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
52 lines (41 loc) · 1.56 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
var gulp = require('gulp'),
yuidoc = require('gulp-yuidoc'),
clean = require('gulp-clean'),
shell = require('gulp-shell'),
rename = require('gulp-rename');
gulp.task('clean-hexo', function(){
return gulp.src('tmp/hexo/', {read: false})
.pipe(clean());
});
gulp.task('clean-warehouse', function(){
return gulp.src('tmp/warehouse/', {read: false})
.pipe(clean());
});
gulp.task('clean-yuidoc', function(){
return gulp.src('source/_yuidoc/', {read: false})
.pipe(clean());
});
gulp.task('clean', ['clean-hexo', 'clean-warehouse', 'clean-yuidoc']);
gulp.task('clone-hexo', ['clean-hexo'], shell.task(['git clone https://github.com/tommy351/hexo.git -b dev tmp/hexo']));
gulp.task('clone-warehouse', ['clean-warehouse'], shell.task(['git clone https://github.com/tommy351/warehouse.git -b develop tmp/warehouse']));
gulp.task('clone', ['clone-hexo', 'clone-warehouse']);
gulp.task('yuidoc-hexo', ['clone-hexo'], function(){
return gulp.src('tmp/hexo/lib/**/*.js')
.pipe(yuidoc.parser({
project: require('./tmp/hexo/package.json')
}))
.pipe(rename('index.json'))
.pipe(gulp.dest('source/_yuidoc/'));
});
gulp.task('yuidoc-warehouse', ['clone-warehouse'], function(){
return gulp.src('tmp/warehouse/lib/**/*.js')
.pipe(yuidoc.parser({
project: require('./tmp/warehouse/package.json')
}))
.pipe(rename('warehouse.json'))
.pipe(gulp.dest('source/_yuidoc/'));
});
gulp.task('yuidoc', ['yuidoc-hexo', 'yuidoc-warehouse']);
gulp.task('default', ['yuidoc'], function(){
return gulp.start('clean-hexo', 'clean-warehouse');
});