1 | 'use strict';
|
2 |
|
3 | var gulp = require('gulp');
|
4 | var bump = require('../');
|
5 |
|
6 | gulp.task('bump', function(){
|
7 | var options = {
|
8 | type: 'minor'
|
9 | };
|
10 | gulp.src('./package.json')
|
11 | .pipe(bump(options))
|
12 | .pipe(gulp.dest('./build'));
|
13 | });
|
14 |
|
15 | gulp.task('version', function(){
|
16 | gulp.src('./package.json')
|
17 | .pipe(bump({version: '1.2.3'}))
|
18 | .pipe(gulp.dest('./version'));
|
19 | });
|
20 |
|
21 | gulp.task('xml', function(){
|
22 | gulp.src('./file.xml')
|
23 | .pipe(bump())
|
24 | .pipe(gulp.dest('./build'));
|
25 | });
|
26 |
|
27 |
|
28 | gulp.task('wptheme', function(){
|
29 | gulp.src('./style.css')
|
30 | .pipe(bump())
|
31 | .pipe(gulp.dest('./build'));
|
32 | });
|
33 |
|
34 |
|
35 | gulp.task('wpplugin', function(){
|
36 | gulp.src('./plugin.php')
|
37 | .pipe(bump())
|
38 | .pipe(gulp.dest('./build'));
|
39 | });
|
40 |
|
41 |
|
42 | gulp.task('phpconstant', function(){
|
43 | var constant = "MY_PLUGIN_VERSION";
|
44 | gulp.src('./plugin.php')
|
45 | .pipe(bump({
|
46 | key: constant,
|
47 | regex: new RegExp('([<|\'|"]?(' + constant + ')[>|\'|"]?[ ]*[:=,]?[ ]*[\'|"]?[a-z]?)(\\d+.\\d+.\\d+)(-[0-9A-Za-z.-]+)?(\\+[0-9A-Za-z\\.-]+)?([\'|"|<]?)', 'i')
|
48 | }))
|
49 | .pipe(gulp.dest('./build'));
|
50 | });
|
51 |
|
52 | gulp.task('key', function(){
|
53 | gulp.src('./key.json')
|
54 | .pipe(bump({key: 'appversion'}))
|
55 | .pipe(gulp.dest('./build'));
|
56 | });
|
57 |
|
58 | gulp.task('patch', function(){
|
59 | gulp.src('./package.json')
|
60 | .pipe(bump())
|
61 | .pipe(gulp.dest('./build'));
|
62 | });
|
63 |
|
64 | gulp.task('default', ['bump']);
|