-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jakefile
31 lines (23 loc) · 924 Bytes
/
Jakefile
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
#!/usr/bin/env narwhal
var FILE = require("file"),
ENV = require("system").env,
OS = require("os"),
jake = require("jake"),
bundler = require("cjs-bundler");
var cwd = FILE.path(FILE.cwd());
jake.task("build", ["build:commonjs"]);
jake.task("build:commonjs", function () {
OS.system(['jison', 'src/lambdacalc.jison', 'src/lambdacalc.jisonlex']);
OS.system(['mv', 'lambdacalc.js', 'lib/lambdacalc/parser.js']);
});
jake.task("test", function () {
OS.system(['narwhal', 'tests/all-tests.js']);
});
var path = FILE.path(FILE.cwd());
jake.task("build:web", function() {
var script = bundler.bundle([
{ id : "lambdacalc", path : path.join("lib", "lambdacalc.js") },
{ id : "lambdacalc/parser", path : path.join("lib", "lambdacalc", "parser.js") }
]);
FILE.write("web/lambdacalc.js", "var require = (function() {\n" + script + ";\nreturn require;\n})();");
});