-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
71 lines (61 loc) · 2.19 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var gulp = require("gulp"),
concat = require("gulp-concat"),
rename = require("gulp-rename"),
uglify = require("gulp-uglify"),
babel = require("gulp-babel"),
lint = require("gulp-jshint");
var js_files = [// Jarlang Runtime
"src/js/runtime.js",
// Jarlang Class Definitions
"src/js/classes/datatype_erlangDatatype.js",
"src/js/classes/datatype_atom.js",
"src/js/classes/datatype_bitstring.js",
"src/js/classes/datatype_float.js",
"src/js/classes/datatype_fun.js",
"src/js/classes/datatype_int.js",
"src/js/classes/datatype_list.js",
"src/js/classes/datatype_map.js",
"src/js/classes/datatype_pid.js",
"src/js/classes/datatype_port.js",
"src/js/classes/datatype_process.js",
"src/js/classes/datatype_reference.js",
"src/js/classes/datatype_tuple.js",
"src/js/classes/datatype_unbound.js",
// Jarlang Prefab Modules
"src/js/modules/module_erlang.js",
"src/js/modules/module_io.js",
];
var js_dependencies = [
"node_modules/bignumber.js/bignumber.js"
];
function build_rts(files, name) {
return gulp.src(files !== undefined ? files : js_files.concat(js_dependencies))
.pipe(concat(name || "jarlang.js"));
}
gulp.task("es6", function() {
return build_rts()
.pipe(gulp.dest("gulpbuild/"));
});
gulp.task("es5", function() {
return build_rts()
.pipe(babel())
.pipe(gulp.dest("gulpbuild/"));
});
gulp.task("min", function() {
return build_rts()
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest("gulpbuild/"));
});
gulp.task("lint", function() {
return gulp.src(js_files)
.pipe(lint())
.pipe(lint.reporter('default'));
});
// Same as min
gulp.task("default", function() {
return build_rts()
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest("gulpbuild/"));
});