|
1 | 1 | (function () { |
2 | 2 | 'use strict'; |
3 | 3 |
|
| 4 | + var bumper = require('gulp-bump'); |
4 | 5 | var fs = require('fs'); |
5 | | - var path = require('path'); |
| 6 | + var git = require('gulp-git'); |
6 | 7 | var gulp = require('gulp'); |
7 | | - var sourcemaps = require('gulp-sourcemaps'); |
8 | | - var uglify = require('gulp-uglify'); |
| 8 | + var gzip = require('gulp-gzip'); |
| 9 | + var header = require('gulp-header'); |
| 10 | + var istanbul = require('gulp-istanbul'); |
| 11 | + var istanbulReport = require('gulp-istanbul-report'); |
9 | 12 | var jshint = require('gulp-jshint'); |
10 | | - var stylish = require('jshint-stylish'); |
11 | 13 | var jscs = require('gulp-jscs'); |
12 | 14 | var mocha = require('gulp-spawn-mocha'); |
13 | | - var tar = require('gulp-tar'); |
14 | | - var gzip = require('gulp-gzip'); |
15 | | - var bumper = require('gulp-bump'); |
16 | | - var git = require('gulp-git'); |
17 | | - var shell = require('gulp-shell'); |
| 15 | + var mochaPhantomJS = require('gulp-mocha-phantomjs'); |
| 16 | + var path = require('path'); |
| 17 | + var pkg = require('./package.json'); |
18 | 18 | var rename = require('gulp-rename'); |
19 | | - var sequence = require('gulp-sequence'); |
20 | 19 | var rimraf = require('gulp-rimraf'); |
21 | | - var istanbul = require('gulp-istanbul'); |
22 | | - var istanbulReport = require('gulp-istanbul-report'); |
23 | | - var mochaPhantomJS = require('gulp-mocha-phantomjs'); |
| 20 | + var sequence = require('gulp-sequence'); |
| 21 | + var shell = require('gulp-shell'); |
| 22 | + var sourcemaps = require('gulp-sourcemaps'); |
| 23 | + var stylish = require('jshint-stylish'); |
| 24 | + var tar = require('gulp-tar'); |
| 25 | + var uglify = require('gulp-uglify'); |
| 26 | + |
| 27 | + var banner = ['/*!', |
| 28 | + ' * <%= pkg.name %> - <%= pkg.description %>', |
| 29 | + ' * <%= pkg.homepage %>', |
| 30 | + ' * Version: <%= version %>', |
| 31 | + ' *', |
| 32 | + ' * Copyright 2016 Jerome Touffe-Blin', |
| 33 | + ' * Released under the <%= pkg.license %> license', |
| 34 | + ' * https://github.com/jtblin/angular-chart.js/blob/master/LICENSE', |
| 35 | + ' */', |
| 36 | + '' |
| 37 | + ].join('\n'); |
24 | 38 |
|
25 | 39 | gulp.task('clean', function () { |
26 | 40 | return gulp.src('./dist/*', { read: false }) |
|
72 | 86 |
|
73 | 87 | gulp.task('bower', function () { |
74 | 88 | return gulp.src('./angular-chart.js') |
| 89 | + .pipe(header(banner, { pkg : pkg, version: version() } )) |
75 | 90 | .pipe(gulp.dest('./dist')); |
76 | 91 | }); |
77 | 92 |
|
78 | 93 | gulp.task('js', ['lint', 'style', 'bower'], function () { |
79 | 94 | return gulp.src('./angular-chart.js') |
| 95 | + .pipe(header(banner, { pkg : pkg, version: version() } )) |
80 | 96 | .pipe(rename('angular-chart.min.js')) |
81 | 97 | .pipe(sourcemaps.init()) |
82 | | - .pipe(uglify()) |
| 98 | + .pipe(uglify({ preserveComments: 'license' })) |
83 | 99 | .pipe(sourcemaps.write('./')) |
84 | 100 | .pipe(gulp.dest('./dist')); |
85 | 101 | }); |
|
147 | 163 | gulp.task('assets', sequence('clean', 'js', 'build')); |
148 | 164 | gulp.task('test', sequence('cover', 'unit', 'integration', 'report')); |
149 | 165 | gulp.task('check', sequence(['lint', 'style'], 'test')); |
150 | | - gulp.task('deploy-patch', sequence('default', 'bump-patch', 'update', 'git-commit', 'git-push', 'npm')); |
151 | | - gulp.task('deploy-minor', sequence('default', 'bump-minor', 'update', 'git-commit', 'git-push', 'npm')); |
152 | | - gulp.task('deploy-major', sequence('default', 'bump-patch', 'update', 'git-commit', 'git-push', 'npm')); |
| 166 | + gulp.task('deploy-patch', sequence('docker-test', 'bump-patch', 'assets', 'update', 'git-commit', 'git-push', 'npm')); |
| 167 | + gulp.task('deploy-minor', sequence('docker-test', 'bump-minor', 'assets', 'update', 'git-commit', 'git-push', 'npm')); |
| 168 | + gulp.task('deploy-major', sequence('docker-test', 'bump-patch', 'assets', 'update', 'git-commit', 'git-push', 'npm')); |
153 | 169 |
|
154 | 170 | })(); |
0 commit comments