Matteo Scandolo | 2b62674 | 2015-11-04 16:03:59 +0100 | [diff] [blame] | 1 | var gulp = require('gulp'); |
| 2 | var uglify = require('gulp-uglify'); |
Matteo Scandolo | 57404dc | 2016-04-13 16:20:13 -0700 | [diff] [blame^] | 3 | var concat = require('gulp-concat'); |
Matteo Scandolo | 2b62674 | 2015-11-04 16:03:59 +0100 | [diff] [blame] | 4 | var ngAnnotate = require('gulp-ng-annotate'); |
| 5 | var angularFilesort = require('gulp-angular-filesort'); |
Matteo Scandolo | 57404dc | 2016-04-13 16:20:13 -0700 | [diff] [blame^] | 6 | var gulpDocs = require('gulp-ngdocs'); |
Matteo Scandolo | 2b62674 | 2015-11-04 16:03:59 +0100 | [diff] [blame] | 7 | |
| 8 | module.exports = function(options){ |
| 9 | gulp.task('helpers', function(){ |
| 10 | return gulp.src([options.xosHelperSource + '**/*.js']) |
| 11 | .pipe(angularFilesort()) |
| 12 | .pipe(concat('ngXosHelpers.js')) |
| 13 | .pipe(ngAnnotate()) |
| 14 | .pipe(uglify()) |
| 15 | .pipe(gulp.dest(options.ngXosVendor)); |
| 16 | }); |
Matteo Scandolo | 57404dc | 2016-04-13 16:20:13 -0700 | [diff] [blame^] | 17 | |
| 18 | gulp.task('docs', function(){ |
| 19 | return gulp.src(options.xosHelperSource + '**/*.js') |
| 20 | .pipe(gulpDocs.process({ |
| 21 | title: 'XOS Helpers Module', |
| 22 | scripts: [ |
| 23 | 'http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js', |
| 24 | 'http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-animate.min.js' |
| 25 | ] |
| 26 | })) |
| 27 | .pipe(gulp.dest('./docs')); |
| 28 | }); |
Matteo Scandolo | 2b62674 | 2015-11-04 16:03:59 +0100 | [diff] [blame] | 29 | }; |