PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/Tests/Manual/CPBrowserTest/Jakefile

http://github.com/cacaodev/cappuccino
#! | 81 lines | 69 code | 12 blank | 0 comment | 0 complexity | 8dd11dddd04e73ee126cc5aa0ec19dcb MD5 | raw file
 1/*
 2 * Jakefile
 3 * CPBrowserTest
 4 *
 5 * Created by Ross Boucher on March 23, 2010.
 6 * Copyright 2010, Your Company All rights reserved.
 7 */
 8
 9var ENV = require("system").env,
10    FILE = require("file"),
11    JAKE = require("jake"),
12    task = JAKE.task,
13    FileList = JAKE.FileList,
14    app = require("cappuccino/jake").app,
15    configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
16    OS = require("os");
17
18app ("CPBrowserTest", function(task)
19{
20    task.setBuildIntermediatesPath(FILE.join("Build", "CPBrowserTest.build", configuration));
21    task.setBuildPath(FILE.join("Build", configuration));
22
23    task.setProductName("CPBrowserTest");
24    task.setIdentifier("com.yourcompany.CPBrowserTest");
25    task.setVersion("1.0");
26    task.setAuthor("Your Company");
27    task.setEmail("feedback @nospam@ yourcompany.com");
28    task.setSummary("CPBrowserTest");
29    task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
30    task.setResources(new FileList("Resources/*"));
31    task.setIndexFilePath("index.html");
32    task.setInfoPlistPath("Info.plist");
33
34    if (configuration === "Debug")
35        task.setCompilerFlags("-DDEBUG -g");
36    else
37        task.setCompilerFlags("-O");
38});
39
40function printResults(configuration)
41{
42    print("----------------------------");
43    print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPBrowserTest"));
44    print("----------------------------");
45}
46
47task ("default", ["CPBrowserTest"], function()
48{
49    printResults(configuration);
50});
51
52task ("build", ["default"]);
53
54task ("debug", function()
55{
56    ENV["CONFIGURATION"] = "Debug";
57    JAKE.subjake(["."], "build", ENV);
58});
59
60task ("release", function()
61{
62    ENV["CONFIGURATION"] = "Release";
63    JAKE.subjake(["."], "build", ENV);
64});
65
66task ("run", ["debug"], function()
67{
68    OS.system(["open", FILE.join("Build", "Debug", "CPBrowserTest", "index.html")]);
69});
70
71task ("run-release", ["release"], function()
72{
73    OS.system(["open", FILE.join("Build", "Release", "CPBrowserTest", "index.html")]);
74});
75
76task ("deploy", ["release"], function()
77{
78    FILE.mkdirs(FILE.join("Build", "Deployment", "CPBrowserTest"));
79    OS.system(["press", "-f", FILE.join("Build", "Release", "CPBrowserTest"), FILE.join("Build", "Deployment", "CPBrowserTest")]);
80    printResults("Deployment")
81});