-
Notifications
You must be signed in to change notification settings - Fork 13
/
Jakefile
92 lines (77 loc) · 2.69 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
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
82
83
84
85
86
87
88
89
90
91
92
/*
* Jakefile
*
* Copyright (C) 2010 Antoine Mercadal <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
var ENV = require("system").env,
FILE = require("file"),
OS = require("os"),
JAKE = require("jake"),
task = JAKE.task,
CLEAN = require("jake/clean").CLEAN,
FileList = JAKE.FileList,
framework = require("cappuccino/jake").framework,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Release";
framework ("TNKit", function(task)
{
task.setBuildIntermediatesPath(FILE.join(ENV["CAPP_BUILD"], "TNKit.build", configuration));
task.setBuildPath(FILE.join(ENV["CAPP_BUILD"], configuration));
task.setProductName("TNKit");
task.setIdentifier("org.archipelproject.TNKit");
task.setVersion("1.0");
task.setAuthor("Antoine Mercadal");
task.setEmail("antoine.mercadal @nospam@ inframonde.eu");
task.setSummary("TNKit");
task.setSources(new FileList("*.j", "TNKit/*.j"));
task.setResources(new FileList("Resources/**/**"));
task.setInfoPlistPath("Info.plist");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O2");
});
task("build", ["TNKit"]);
task("debug", function()
{
ENV["CONFIG"] = "Debug"
JAKE.subjake(["."], "build", ENV);
});
task("release", function()
{
ENV["CONFIG"] = "Release"
JAKE.subjake(["."], "build", ENV);
});
task ("documentation", function()
{
OS.system("doxygen TNKit.doxygen")
});
task("test", ["test-only"]);
task("test-only", function()
{
ENV["OBJJ_INCLUDE_PATHS"] = "Frameworks";
OS.system("capp gen -fl . --force");
var tests = new FileList('Test/*Test.j'),
cmd = ["ojtest"].concat(tests.items()),
cmdString = cmd.map(OS.enquote).join(" "),
code = OS.system(cmdString);
OS.system("rm -rf Frameworks");
if (code !== 0)
OS.exit(code);
});
task ("default", ["release"]);
task ("docs", ["documentation"]);
task ("all", ["release", "debug", "documentation"]);