@@ -0,0 +1,52 @@
1+'use strict';
2+
3+var gulp = require('gulp')
4+ , run = require('gulp-run')
5+ , purescript = require('gulp-purescript')
6+ ;
7+
8+var paths = {
9+ src: 'src/**/*.purs',
10+ doc: 'MODULE.md',
11+ docSrc: ['src/**/*.purs', '!src/**/Internal/**/*.purs' ],
12+ bowerSrc: 'bower_components/purescript-*/src/**/*.purs',
13+ dest: 'output',
14+ example: 'examples/*.purs',
15+ test: 'test/**/*.purs'
16+};
17+
18+gulp.task('make', function() {
19+ return gulp.src([paths.src].concat(paths.bowerSrc))
20+ .pipe(purescript.pscMake({}))
21+ .pipe(gulp.dest(paths.dest));
22+});
23+
24+gulp.task('test-make', function() {
25+ return gulp.src([paths.src, paths.test].concat(paths.bowerSrc))
26+ .pipe(purescript.pscMake({}))
27+ .pipe(gulp.dest(paths.dest));
28+});
29+
30+gulp.task('test', ['test-make'], function() {
31+ var env = {};
32+ for (var e in process.env) env[e] = process.env[e];
33+ env.NODE_PATH = 'output';
34+ run('node -e "require(\'Test.Main\').main();"', { 'env': env }).exec();
35+});
36+
37+gulp.task('docs', function() {
38+ return gulp.src(paths.docSrc)
39+ .pipe(purescript.pscDocs())
40+ .pipe(gulp.dest(paths.doc));
41+});
42+
43+gulp.task('psci', function() {
44+ return gulp.src([paths.src, paths.test, paths.example].concat(paths.bowerSrc))
45+ .pipe(purescript.dotPsci());
46+});
47+
48+gulp.task('watch', function() {
49+ gulp.watch(paths.src, ['make', 'docs']);
50+});
51+
52+gulp.task('default', ['make', 'docs']);