-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jakefile
94 lines (80 loc) · 2.95 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
93
94
/*
* Jakefile
* RoundedBox Cappuccino
*
* Created by Alexander Ljungberg on October 12, 2012.
* Copyright 2012, SlevenBits Ltd. All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("RoundedBox Cappuccino", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "RoundedBox Cappuccino.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("RoundedBox Cappuccino");
task.setIdentifier("com.slevenbits.cappuccino-rounded-box");
task.setVersion("1.0");
task.setAuthor("SlevenBits Ltd.");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("RoundedBox Cappuccino");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["RoundedBox Cappuccino"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "RoundedBox Cappuccino", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "RoundedBox Cappuccino", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "RoundedBox Cappuccino"));
OS.system(["press", "-f", FILE.join("Build", "Release", "RoundedBox Cappuccino"), FILE.join("Build", "Deployment", "RoundedBox Cappuccino")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "RoundedBox Cappuccino"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "RoundedBox Cappuccino"), FILE.join("Build", "Desktop", "RoundedBox Cappuccino", "RoundedBox Cappuccino.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "RoundedBox Cappuccino", "RoundedBox Cappuccino.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "Capp"));
print("----------------------------");
}