forked from angular/angular.io
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
51 lines (41 loc) · 1.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
var gulp = require('gulp');
var path = require('canonical-path');
var del = require('del');
var watch = require('gulp-watch');
var taskListing = require('gulp-task-listing');
var docShredder = require('../doc-shredder');
var shredOptions = {
examplesDir: "test_source",
fragmentsDir: "test_fragments"
};
gulp.task('help', taskListing);
gulp.task('shred', ['clean'], function() {
return docShredder.shred(shredOptions);
});
gulp.task('clean', function () {
var cleanPath = path.join(shredOptions.fragmentsDir, '**/*.*')
del([ cleanPath, '!**/*.ovr.*']).then(function (err, paths) {
// console.log('Deleted files/folders:\n', paths.join('\n'));
});
});
gulp.task('watch', function (cb) {
var pattern = path.join(shredOptions.examplesDir, "**/*.*");
watch([ pattern], function(event, done) {
console.log('Event type: ' + event.event); // added, changed, or deleted
console.log('Event path: ' + event.path); // The path of the modified file
docShredder.shredSingleDir(shredOptions, event.path);
});
});
gulp.task('map', function() {
var options = {
jadeDir: 'test_jade',
apiExamplesDir: 'test_source',
fragmentsDir: 'test_fragments',
devguideExamplesDir: 'test_source',
outputDir: '.'
}
return docShredder.buildShredMap(options).then(function(x) {
var docMaps = x.docMaps;
})
});
gulp.task('default', taskListing);