Repository navigation
Expand file tree
/
Copy pathgulpfile.js
More file actions
81 lines (69 loc) · 2.02 KB
/
Copy pathgulpfile.js
File metadata and controls
81 lines (69 loc) · 2.02 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
var gulp = require('gulp-help')(require('gulp'), {hideEmpty : true, hideDepsMessage : true});
var babel = require('gulp-babel');
var shell = require('gulp-shell');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var runSequence = require('run-sequence');
gulp.task('default', ['help'], function() {
});
gulp.task('run', 'Stop the Erlang project, build it and start it again', function(cb) {
runSequence('erlang:stop', 'js:build', 'erlang:build', 'erlang:start', cb);
});
gulp.task('build', 'Stop the Erlang project and build it again', function(cb) {
runSequence('erlang:stop', 'js:build', 'erlang:build', cb);
});
gulp.task('js:copy_html', function() {
return gulp.src('html_samples/*.html')
.pipe(gulp.dest('rebar/priv/multiscreen/'));
});
gulp.task('js:build', 'Deploy Javascript into Erlang folder', ['js:copy_html', 'js:doc'], function() {
return gulp.src('js_lib/*.js')
.pipe(babel())
.pipe(concat('multiscreen.all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('rebar/priv/multiscreen/'));
});
gulp.task('js:doc', 'Generate Javascript Documentation', function() {
return gulp.src('')
.pipe(shell([
'./node_modules/.bin/jsdoc ./js_lib/*.js README.md --recurse --destination ./rebar/priv/multiscreen/doc'
], {
'ignoreErrors' : true
}));
});
gulp.task('erlang:deps', 'Get Erlang dependencies', function() {
return gulp.src('')
.pipe(shell([
'rebar3 get-deps'
], {
'cwd' : 'rebar',
'ignoreErrors' : true
}));
});
gulp.task('erlang:build', 'Build Erlang project', function() {
return gulp.src('')
.pipe(shell([
'./compile.sh'
], {
'cwd' : 'rebar',
'ignoreErrors' : true
}));
});
gulp.task('erlang:start', 'Start Erlang project (Start Web Server)', function() {
return gulp.src('')
.pipe(shell([
'./start.sh'
], {
'cwd' : 'rebar',
'ignoreErrors' : true
}));
});
gulp.task('erlang:stop', 'Stop Erlang project (Stop Web Server)', function() {
return gulp.src('')
.pipe(shell([
'./stop.sh'
], {
'cwd' : 'rebar',
'ignoreErrors' : true
}));
});