git.iko.soy/rowtype-yoga/purescript-unique
on v0.0.1 help sign in
52 lines 1.4 kB history raw
1'use strict';
3var gulp = require('gulp')
4 , run = require('gulp-run')
5 , purescript = require('gulp-purescript')
6 ;
8var 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};
18gulp.task('make', function() {
19 return gulp.src([paths.src].concat(paths.bowerSrc))
20 .pipe(purescript.pscMake({}))
21 .pipe(gulp.dest(paths.dest));
22});
24gulp.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});
30gulp.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});
37gulp.task('docs', function() {
38 return gulp.src(paths.docSrc)
39 .pipe(purescript.pscDocs())
40 .pipe(gulp.dest(paths.doc));
41});
43gulp.task('psci', function() {
44 return gulp.src([paths.src, paths.test, paths.example].concat(paths.bowerSrc))
45 .pipe(purescript.dotPsci());
46});
48gulp.task('watch', function() {
49 gulp.watch(paths.src, ['make', 'docs']);
50});
52gulp.task('default', ['make', 'docs']);