-
Notifications
You must be signed in to change notification settings - Fork 13
/
gulpfile.js
47 lines (38 loc) · 1.37 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
var gulp = require('gulp'),
coffee = require('gulp-coffee'),
gutil = require('gulp-util'),
coffeelint = require('gulp-coffeelint'),
mocha = require('gulp-mocha'),
es = require('event-stream'),
rename = require("gulp-rename"),
debug = require('gulp-debug'),
insert = require('gulp-insert');
require('coffee-script/register');
var srcDir = './src/',
outDir = './out/',
testDir = './test/';
gulp.task('lint', function () {
return gulp.src([srcDir + '**/*.coffee'])
.pipe(coffeelint())
.pipe(coffeelint.reporter());
});
gulp.task('build', function() {
src = gulp.src([srcDir + 'lib/**/*.coffee'])
/*.pipe(debug())*/
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(gulp.dest(outDir + "/lib"));
bin = gulp.src([srcDir + 'bin/**/*.coffee'])
/*.pipe(debug())*/
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(insert.prepend("#!/usr/bin/env node\n\n"))
.pipe(gulp.dest(outDir + "/bin"));
return es.concat(src, bin);
});
gulp.task('test', function() {
sources = testDir + '**.coffee';
//sources = testDir + 'engine.coffee';
return gulp.src(sources, {read: false})
.pipe(mocha({reporter: 'nyan', timeout: 30000}));
});
gulp.task('default', ['lint', 'compile'], function() {
});