|
1 | 1 | 'use strict' |
2 | 2 |
|
3 | 3 | var gulp = require('gulp') |
| 4 | + , bump = require('gulp-bump') |
| 5 | + , filter = require('gulp-filter') |
| 6 | + , git = require('gulp-git') |
4 | 7 | , purescript = require('gulp-purescript') |
5 | 8 | , run = require('gulp-run') |
6 | 9 | , runSequence = require('run-sequence') |
| 10 | + , tagVersion = require('gulp-tag-version') |
7 | 11 | ; |
8 | 12 |
|
9 | 13 | var paths = |
@@ -36,17 +40,41 @@ var compile = function(compiler, src, opts) { |
36 | 40 |
|
37 | 41 | function docs (target) { |
38 | 42 | return function() { |
39 | | - var docgen = purescript.docgen(); |
40 | | - docgen.on('error', function(e) { |
| 43 | + var pscDocs = purescript.pscDocs(); |
| 44 | + pscDocs.on('error', function(e) { |
41 | 45 | console.error(e.message); |
42 | | - docgen.end(); |
| 46 | + pscDocs.end(); |
43 | 47 | }); |
44 | 48 | return gulp.src(paths.docs[target].src) |
45 | | - .pipe(docgen) |
| 49 | + .pipe(pscDocs) |
46 | 50 | .pipe(gulp.dest(paths.docs[target].dest)); |
47 | 51 | } |
48 | 52 | } |
49 | 53 |
|
| 54 | +gulp.task('tag', function() { |
| 55 | + return gulp.src(['bower.json', 'package.json']) |
| 56 | + .pipe(git.commit('Update versions.')) |
| 57 | + .pipe(filter('bower.json')) |
| 58 | + .pipe(tagVersion()); |
| 59 | +}); |
| 60 | + |
| 61 | +// For whatever reason, these cannot be factored out... |
| 62 | +gulp.task('bump-major', function() { |
| 63 | + return gulp.src(['bower.json', 'package.json']) |
| 64 | + .pipe(bump({type: 'major'})) |
| 65 | + .pipe(gulp.dest('./')); |
| 66 | +}); |
| 67 | +gulp.task('bump-minor', function() { |
| 68 | + return gulp.src(['bower.json', 'package.json']) |
| 69 | + .pipe(bump({type: 'minor'})) |
| 70 | + .pipe(gulp.dest('./')); |
| 71 | +}); |
| 72 | +gulp.task('bump-patch', function() { |
| 73 | + return gulp.src(['bower.json', 'package.json']) |
| 74 | + .pipe(bump({type: 'patch'})) |
| 75 | + .pipe(gulp.dest('./')); |
| 76 | +}); |
| 77 | + |
50 | 78 | gulp.task('make', function() { |
51 | 79 | return compile(purescript.pscMake, [paths.src], {}); |
52 | 80 | }); |
|
0 commit comments