forked from xtemplate/xtemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (50 loc) · 1.61 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
var gulp = require('gulp');
var path = require('path');
var child_process = require('child_process');
gulp.task('do-precompile-test', ['compile'], function () {
var gulpXTemplate = require('gulp-xtemplate');
return gulp.src('tests/browser/fixture/*.xtpl').pipe(gulpXTemplate({
runtime: '../../../src/runtime',
truncatePrefixLen: process.cwd().length,
wrap: false,
XTemplate: require('./lib/')
})).pipe(gulp.dest('tests/browser/fixture/'));
});
gulp.task('precompile-test', ['do-precompile-test'], function (done) {
child_process.exec('node node_modules/.bin/rc-tools run clean', function () {
done();
});
});
gulp.task('compile', function (done) {
child_process.exec('node node_modules/.bin/rc-tools run compile', function () {
done();
});
});
gulp.task('parser', function (callback) {
child_process.exec('node node_modules/kison/bin/kison -g src/compiler/parser-grammar.kison',
function (error, stdout, stderr) {
if (stdout) {
console.log('stdout: ' + stdout);
}
if (stderr) {
console.log('stderr: ' + stderr);
}
if (error) {
console.log('exec error: ' + error);
}
}).on('exit', callback);
});
gulp.task('parser-dev', function (callback) {
child_process.exec('node node_modules/kison/bin/kison -g src/compiler/parser-grammar.kison --no-compressSymbol',
function (error, stdout, stderr) {
if (stdout) {
console.log('stdout: ' + stdout);
}
if (stderr) {
console.log('stderr: ' + stderr);
}
if (error) {
console.log('exec error: ' + error);
}
}).on('exit', callback);
});