forked from Semantic-Org/Semantic-UI-Angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
63 lines (52 loc) · 1.61 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var del = require('del');
var plugins = require('gulp-load-plugins')();
var karma = require('karma').server;
var Dgeni = require('dgeni');
var runSequence = require("run-sequence");
var es = require('event-stream');
gulp.task('jshint', function() {
return gulp.src('src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('dgeni', function() {
var dgeni = new Dgeni([require('./docs/config/dgeni-config.js')]);
return dgeni.generate().catch(function(error) {
console.error(error);
process.exit(1);
});
});
gulp.task('docs-assets', function() {
var semanticAssets = gulp.src('node_modules/semantic-ui-css/**/*')
.pipe(gulp.dest('dist/docs/lib/semantic-ui-css'));
var angularAssets = gulp.src('node_modules/angular/**/*')
.pipe(gulp.dest('dist/docs/lib/angular'));
var docsApp = gulp.src('docs/app/**/*')
.pipe(gulp.dest('dist/docs/app'));
return es.concat(docsApp, semanticAssets, angularAssets);
});
gulp.task('clean-build', function(done) {
del(['./dist'], done);
});
gulp.task('test', ['jshint'], function(done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
autoWatch: false,
singleRun: true
}, done);
});
gulp.task('test-dev', ['jshint'], function(done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
autoWatch: true,
singleRun: false
}, done);
});
gulp.task('docs', function(cb) {
runSequence('clean-build', ['dgeni', 'docs-assets'], cb);
});
gulp.task('default', ['jshint'], function(cb) {
runSequence(['jshint', 'docs'], cb);
});