-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
52 lines (42 loc) · 1.09 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
'use strict'
var gulp = require('gulp')
, purescript = require('gulp-purescript')
;
var paths = {
src: 'src/**/*.purs',
bowerSrc: [
'bower_components/purescript-*/src/**/*.purs',
'bower_components/purescript-*/src/**/*.purs.hs'
],
dest: '',
docsDest: 'README.md'
};
var options = {};
var compile = function(compiler) {
var psc = compiler(options);
psc.on('error', function(e) {
console.error(e.message);
psc.end();
});
return gulp.src([paths.src].concat(paths.bowerSrc))
.pipe(psc)
.pipe(gulp.dest(paths.dest));
};
gulp.task('make', function() {
return compile(purescript.pscMake);
});
gulp.task('browser', function() {
return compile(purescript.psc);
});
gulp.task('docs', function() {
return gulp.src(paths.src)
.pipe(purescript.docgen())
.pipe(gulp.dest(paths.docsDest));
});
gulp.task('watch-browser', function() {
gulp.watch(paths.src, ['browser', 'docs']);
});
gulp.task('watch-make', function() {
gulp.watch(paths.src, ['make', 'docs']);
});
gulp.task('default', ['make', 'docs']);