forked from AmbientIT/AngularJS-TP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (47 loc) · 1.58 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
var config = {
jsSources: './app/src/**/*.js',
karmaConfigFile: './app/karma.config.js',
doc: './docs'
};
var gulp = require('gulp-help')(require('gulp')),
plugins = require('gulp-load-plugins')(),
path = require('path'),
karma = require('karma').server;
gulp.task('quality', 'lint the code once', function () {
gulp.src(config.jsSources)
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('jshint-stylish'));
});
gulp.task('jshint', 'continuously lint your code and log in the console with style ', ['quality'], function () {
gulp.watch(config.jsSources, ['quality']);
});
var pathToKarmaConfigFile = path.resolve(config.karmaConfigFile);
gulp.task('unit', 'run unit test once', function (done) {
karma.start({
configFile: pathToKarmaConfigFile,
singleRun: true,
autoWatch: false
}, done);
});
gulp.task('tdd', 'run unit tests continuously', function (done) {
karma.start({
configFile: pathToKarmaConfigFile
}, done);
});
gulp.task('documentation::clean', 'clean the ./doc folder', function () {
gulp.src(config.doc, {read: false})
.pipe(plugins.clean());
});
gulp.task('documentation', 'generate documentation', ['documentation::clean'], function () {
var options = {
html5Mode: true,
startPage: '/api',
title: "My Awesome Docs",
image: "path/to/my/image.png",
imageLink: "http://my-domain.com",
titleLink: "/api"
};
return gulp.src(config.jsSources)
.pipe(plugins.ngdocs.process(options))
.pipe(gulp.dest(config.doc));
});