This repository was archived by the owner on Dec 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
109 lines (102 loc) · 3.36 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
103
104
105
106
107
108
109
const gulp = require('gulp');
const gulpDocs = require('gulp-ngdocs');
const path = require('path');
const clean = require('gulp-clean');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const ngAnnotate = require('gulp-ng-annotate');
const config = {
paths: {
dist: '../dist/client',
docsDist: '../dist/client/docs'
}
};
const options = {
html5Mode: false,
startPage: '/dev',
title: 'Transcend Docs',
template: 'index.tmpl',
styles: [
'./styles/docs.css',
'//js.arcgis.com/3.17/esri/css/esri.css'
],
scripts: [
// Note, this needs to match with ngdocs config in the generic transcend module's Gruntfile.
config.paths.dist + '/' + config.combinedScriptsFile,
'//js.arcgis.com/3.17/init.js',
'//git/projects/JS/repos/lib-anychart/browse/AnyChart.js?at=refs%2Fheads%2Fmaster&raw',
'//git/projects/JS/repos/lib-anychart/browse/AnyChartHTML5.js?at=refs%2Fheads%2Fmaster&raw'
],
analytics: {
account: 'UA-55413605-8'
}
//loadDefaults: {
// angular: false,
// angularAnimate: false
//}
};
gulp.task('clean', function () {
return gulp.src(config.paths.dist)
.pipe(clean({force: true}));
});
gulp.task('clean-up', ['ngdocs', 'copy'], function () {
return gulp.src([config.paths.dist + '/' + config.combinedScriptsFile])
.pipe(clean({force: true}));
});
gulp.task('scripts', function () {
// Js.
return gulp.src(config.scripts)
.pipe(concat(config.combinedScriptsFile))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest(config.paths.dist));
});
gulp.task('ngdocs', ['clean', 'less', 'scripts'], function () {
return gulpDocs.sections({
api: {
glob: ['./src/api/**/*.ngdoc', './bower_components/transcend-*/*.*'],
title: 'API Reference'
},
dev: {
glob: ['./src/dev/**/*.ngdoc'],
title: 'Developer Reference'
},
gitflows: {
glob: ['./src/git/**/*.ngdoc'],
title: 'Git Workflows'
}
})
// return gulp.src(['./bower_components/transcend-*/*.*'])
.pipe(gulpDocs.process(options))
.pipe(gulp.dest(config.paths.docsDist));
});
// gulp.task('copy-includes', ['ngdocs'], function () {
// return gulp.src('./includes/**/*.*')
// .pipe(gulp.dest(config.paths.docsDist));
// });
//
// gulp.task('copy-bs-fonts', ['ngdocs'], function () {
// return gulp.src(['./bower_components/bootstrap/fonts/*.*', './bower_components/components-font-awesome/fonts/*.*'])
// .pipe(gulp.dest(config.paths.docsDist + '/css/fonts'));
// });
//
// gulp.task('copy-tss-fonts', ['ngdocs'], function () {
// return gulp.src('./bower_components/transcend-themes/fonts/*.*')
// .pipe(gulp.dest(config.paths.docsDist + '/css/themes/fonts'));
// });
//
// gulp.task('copy-ui-grid-fonts', ['ngdocs'], function () {
// return gulp.src(['./bower_components/angular-ui-grid/*.svg', './bower_components/angular-ui-grid/*.ttf', './bower_components/angular-ui-grid/*.woff', './bower_components/angular-ui-grid/*.eot'])
// .pipe(gulp.dest(config.paths.docsDist + '/css/styles'));
// });
//
// gulp.task('sync', ['clean-up'], function () {
// if (!args[config.syncDirArg]) {
// throw new Error('No \'' + config.syncDirArg + '\' argument passed to sync to')
// }
//
// return gulp.src(config.paths.docsDist + '/**/*.*')
// .pipe(gulp.dest(args[config.syncDirArg]));
// });
gulp.task('build', ['ngdocs']);
gulp.task('default', ['build']);