2014-11-03 00:02:29 +01:00
|
|
|
var gulp = require('gulp');
|
|
|
|
var jison = require('gulp-jison');
|
2014-11-13 19:51:05 +01:00
|
|
|
var shell = require('gulp-shell');
|
|
|
|
var concat = require('gulp-concat');
|
|
|
|
var uglify = require('gulp-uglify');
|
|
|
|
var extReplace = require('gulp-ext-replace');
|
2014-11-03 00:02:29 +01:00
|
|
|
|
2014-11-11 08:12:03 +01:00
|
|
|
gulp.task('jison2', function() {
|
2014-11-03 00:02:29 +01:00
|
|
|
return gulp.src('./src/*.jison')
|
|
|
|
.pipe(jison({ moduleType: 'amd' }))
|
|
|
|
.pipe(gulp.dest('./src/'));
|
|
|
|
});
|
|
|
|
|
2014-11-11 08:12:03 +01:00
|
|
|
gulp.task('jison', shell.task([
|
2014-11-13 19:51:05 +01:00
|
|
|
'jison src/parser/flow.jison -o src/parser/flow.js',
|
2014-11-11 08:12:03 +01:00
|
|
|
'source scripts/compileJison.sh'
|
2014-11-12 07:35:44 +01:00
|
|
|
]))
|
|
|
|
|
|
|
|
gulp.task('jison2', shell.task([
|
|
|
|
'jison src/parser/flow.jison -o src/parser/flow.js',
|
|
|
|
'source scripts/compileFlow.sh'
|
2014-11-13 19:51:05 +01:00
|
|
|
]))
|
|
|
|
|
|
|
|
gulp.task('distSlim', function() {
|
|
|
|
gulp.src(['./src/parser/flow.js','./src/graph.js','./src/main.js'])
|
|
|
|
.pipe(concat('mermaid.slim.js'))
|
|
|
|
.pipe(gulp.dest('./dist/'))
|
|
|
|
.pipe(uglify())
|
|
|
|
.pipe(extReplace('.min.js'))
|
|
|
|
.pipe(gulp.dest('./dist/'));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('distFull', function() {
|
|
|
|
gulp.src(['./lib/d3.v3.min.js', './lib/dagre-d3.min.js', './src/parser/flow.js','./src/graph.js','./src/main.js'])
|
|
|
|
.pipe(concat('mermaid.full.js'))
|
|
|
|
.pipe(gulp.dest('./dist/'))
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('dist', ['distSlim', 'distFull'], function() {
|
|
|
|
gulp.src(['./lib/d3.v3.min.js', './lib/dagre-d3.min.js', './dist/mermaid.slim.min.js'])
|
|
|
|
.pipe(concat('mermaid.full.min.js'))
|
|
|
|
.pipe(gulp.dest('./dist/'))
|
|
|
|
});
|