-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
80 lines (71 loc) · 2.1 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
'use strict'
var gulp = require('gulp')
, bump = require('gulp-bump')
, filter = require('gulp-filter')
, git = require('gulp-git')
, purescript = require('gulp-purescript')
, runSequence = require('run-sequence')
, tagVersion = require('gulp-tag-version')
;
var paths =
{ src: 'src/**/*.purs'
, bowerFFIJs: [ 'bower_components/purescript-*/src/**/*.js'
]
, bowerSrc: [ 'bower_components/purescript-*/src/**/*.purs'
]
, dest: ''
, docgen: { 'Node.UUID': 'docs/Node/UUID.md'
}
, ffi: 'src/**/*.js'
};
gulp.task('tag', function() {
return gulp.src(['bower.json', 'package.json'])
.pipe(git.commit('Update versions.'))
.pipe(filter('bower.json'))
.pipe(tagVersion());
});
// For whatever reason, these cannot be factored out...
gulp.task('bump-major', function() {
return gulp.src(['bower.json', 'package.json'])
.pipe(bump({type: 'major'}))
.pipe(gulp.dest('./'));
});
gulp.task('bump-minor', function() {
return gulp.src(['bower.json', 'package.json'])
.pipe(bump({type: 'minor'}))
.pipe(gulp.dest('./'));
});
gulp.task('bump-patch', function() {
return gulp.src(['bower.json', 'package.json'])
.pipe(bump({type: 'patch'}))
.pipe(gulp.dest('./'));
});
gulp.task('bump-tag-major', function() {
return runSequence('bump-major', 'tag');
});
gulp.task('bump-tag-minor', function() {
return runSequence('bump-minor', 'tag');
});
gulp.task('bump-tag-patch', function() {
return runSequence('bump-patch', 'tag');
});
gulp.task('psc', function() {
return purescript.psc({
src: paths.bowerSrc.concat(paths.src),
ffi: paths.bowerFFIJs.concat(paths.ffi)
});
});
gulp.task('docs', function() {
return purescript.pscDocs({
src: paths.bowerSrc.concat(paths.src),
docgen: paths.docgen
});
});
gulp.task('watch', function() {
gulp.watch([paths.src], function() {
return runSequence('psc', 'docs')
});
});
gulp.task('default', function() {
return runSequence('psc', 'docs')
});