forked from esvit/ng-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
75 lines (63 loc) · 2.21 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
var gulp = require('gulp');
require('gulp-grunt')(gulp); // add all the gruntfile tasks to gulp
var Dgeni = require('dgeni');
var dgeni_config = require('./docs/config');
var webserver = require("gulp-webserver");
var browserify = require('gulp-browserify');
var sequence = require('gulp-sequence');
var wait = require('gulp-wait');
var ghPages = require('gulp-gh-pages');
//serverStream
var serverStream;
gulp.task('build:doc-assets', function () {
gulp.src(['./docs/app/**/*']).pipe(gulp.dest('./dist/docs/app'))
});
gulp.task('compile:doc-src', function () {
gulp.src('dist/docs/app/js/app.js')
.pipe(browserify({insertGlobals: true}))
.pipe(gulp.dest('dist/docs/app/build'));
});
//Include all needed vendor CSS require by vendor libs
gulp.task('vendor-css', function () {
return gulp.src([
'./app/vendor/angular-material/angular-material.css',
'./Content/font-awesome/css/*.css'
]).pipe(gulp.dest('./docs/release/app/vendor/css'));
});
gulp.task('run:dgeni', function () {
var dgeni = new Dgeni([dgeni_config]);
return dgeni.generate().then(function (docs) {
console.log(docs.length, 'docs generated');
})
});
gulp.task('run:server', function () {
serverStream = gulp.src('./dist/docs')
.pipe(webserver({
port: 3030,
livereload:true,
open:true
}));
});
gulp.task('watch:files', function () {
gulp.watch(['docs/**/*.*'], ['build:doc-assets', 'run:dgeni', 'compile:doc-src'])
});
gulp.task('kill-server', function () {
if(serverStream) serverStream.emit('kill');
});
gulp.task('deploy:docs', function(){
return gulp.src('./dist/docs/**/*').pipe(ghPages(
{
remoteUrl: 'https://github.com/bigmeech/ng-table.git',
branch:'gh-pages',
origin: 'origin',
push:true,
message:"Update" + new Date()
}
))
});
gulp.task('dev', function (callback) {
sequence('grunt-default', 'build:doc-assets', 'run:dgeni', 'compile:doc-src', 'kill-server', 'run:server', 'watch:files')(callback);
});
gulp.task('default', function (callback) {
sequence('grunt-default', 'build:doc-assets', 'run:dgeni', 'compile:doc-src')(callback);
});