mirror of
https://github.com/samsonjs/cpwebsocket.git
synced 2026-03-25 09:15:48 +00:00
81 lines
2.2 KiB
JavaScript
81 lines
2.2 KiB
JavaScript
/*
|
|
* Jakefile
|
|
* TestHarness
|
|
*
|
|
* Created by You on April 1, 2010.
|
|
* Copyright 2010, Your Company 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 ("TestHarness", function(task)
|
|
{
|
|
task.setBuildIntermediatesPath(FILE.join("Build", "TestHarness.build", configuration));
|
|
task.setBuildPath(FILE.join("Build", configuration));
|
|
|
|
task.setProductName("TestHarness");
|
|
task.setIdentifier("com.yourcompany.TestHarness");
|
|
task.setVersion("1.0");
|
|
task.setAuthor("Your Company");
|
|
task.setEmail("feedback @nospam@ yourcompany.com");
|
|
task.setSummary("TestHarness");
|
|
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
|
|
task.setResources(new FileList("Resources/*"));
|
|
task.setIndexFilePath("index.html");
|
|
task.setInfoPlistPath("Info.plist");
|
|
|
|
if (configuration === "Debug")
|
|
task.setCompilerFlags("-DDEBUG -g");
|
|
else
|
|
task.setCompilerFlags("-O");
|
|
});
|
|
|
|
function printResults(configuration)
|
|
{
|
|
print("----------------------------")
|
|
print(configuration+" app built at path: "+FILE.join("Build", configuration, "TestHarness"));
|
|
print("----------------------------")
|
|
}
|
|
|
|
task ("default", ["TestHarness"], 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", "TestHarness", "index.html")]);
|
|
});
|
|
|
|
task ("run-release", ["release"], function()
|
|
{
|
|
OS.system(["open", FILE.join("Build", "Release", "TestHarness", "index.html")]);
|
|
});
|
|
|
|
task ("deploy", ["release"], function()
|
|
{
|
|
FILE.mkdirs(FILE.join("Build", "Deployment", "TestHarness"));
|
|
OS.system(["press", "-f", FILE.join("Build", "Release", "TestHarness"), FILE.join("Build", "Deployment", "TestHarness")]);
|
|
printResults("Deployment")
|
|
});
|