-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathJakefile
54 lines (45 loc) · 1.49 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env narwhal
JAKE = require("jake");
SYSTEM = require("system");
FILE = require("file");
OS = require("os");
FileList = JAKE.FileList;
JAKE.task ("docs", ["documentation"]);
JAKE.task ("documentation", function()
{
if (executableExists("doxygen"))
{
if (OS.system(["ruby", FILE.join("documentation", "make_headers")]))
OS.exit(1); //rake abort if ($? != 0)
if (OS.system(["doxygen", FILE.join("documentation", "OJTest.doxygen")]))
OS.exit(1); //rake abort if ($? != 0)
}
else
print("doxygen not installed. skipping documentation generation.");
});
JAKE.task("test", function(){
var tests = new FileList('Test/*Test.j');
var cmd = ["bin/ojtest"].concat(tests.items());
var cmdString = cmd.map(OS.enquote).join(" ");
var cmdString = "env OBJJ_INCLUDE_PATHS='./Frameworks' " + cmdString;
var code = OS.system(cmdString);
if (code !== 0)
OS.exit(code);
});
executableExists = function(/*String*/ aFileName)
{
return SYSTEM.env["PATH"].split(':').some(function(/*String*/ aPath)
{
return FILE.exists(FILE.join(aPath, aFileName));
});
}
JAKE.task ("clean", function()
{
OS.system(["rm", "-rf", SYSTEM.prefix + "/packages/OJTest/"])
});
JAKE.task ("install", ["clean"], function()
{
OS.system(["mkdir", "-p", SYSTEM.prefix + "/packages/OJTest/"])
OS.system(["cp", "-r", ".", SYSTEM.prefix + "/packages/OJTest"])
print("OJTest installation done! Have fun in testing now :)")
});