mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-15 21:14:29 +00:00
Applies the transformation script across all applications in the Tests/Manual directory to eliminate Narwhal-era dependencies and establish compatibility with the modern Node-based runner.
* Removes explicit `require("jake")` calls in favor of the injected JAKE global.
* Replaces legacy `cappuccino/jake` application instantiation with the `CAPPUCCINO.Jake.applicationtask.app` hook.
* Substitutes archaic `system`, `file`, and `os` API calls with native Node `child_process`, `fs`, and `path` modules.
* Corrects package paths for nativehost deployment targets.
94 lines
3.2 KiB
JavaScript
94 lines
3.2 KiB
JavaScript
/*
|
|
* Jakefile
|
|
* AttachedSheet2Test
|
|
*
|
|
* Created by Saikat Chakrabarti on March 16, 2010.
|
|
* Copyright 2010, gomockingbird.com All rights reserved.
|
|
*/
|
|
|
|
var ENV = process.env,
|
|
cp = require("child_process"),
|
|
fs = require("fs"),
|
|
path = require("path"),
|
|
task = JAKE.task,
|
|
FileList = JAKE.FileList,
|
|
app = CAPPUCCINO.Jake.applicationtask.app,
|
|
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug";
|
|
|
|
app ("AttachedSheet2Test", function(task)
|
|
{
|
|
task.setBuildIntermediatesPath(path.join("Build", "AttachedSheet2Test.build", configuration));
|
|
task.setBuildPath(path.join("Build", configuration));
|
|
|
|
task.setProductName("AttachedSheet2Test");
|
|
task.setIdentifier("com.gomockingbird.AttachedSheet2Test");
|
|
task.setVersion("1.0");
|
|
task.setAuthor("Saikat Chakrabarti and Sheena Pakanati");
|
|
task.setEmail("contact @nospam@ gomockingbird.com");
|
|
task.setSummary("AttachedSheet2Test");
|
|
task.setSources((new FileList("**/*.j")).exclude(path.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)
|
|
{
|
|
console.log("----------------------------")
|
|
console.log(configuration+" app built at path: "+path.join("Build", configuration, "AttachedSheet2Test"));
|
|
console.log("----------------------------")
|
|
}
|
|
|
|
task ("default", ["AttachedSheet2Test"], 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()
|
|
{
|
|
cp.execSync(["open", path.join("Build", "Debug", "AttachedSheet2Test", "index.html")].join(" "), { stdio: "inherit" });
|
|
});
|
|
|
|
task ("run-release", ["release"], function()
|
|
{
|
|
cp.execSync(["open", path.join("Build", "Release", "AttachedSheet2Test", "index.html")].join(" "), { stdio: "inherit" });
|
|
});
|
|
|
|
task ("deploy", ["release"], function()
|
|
{
|
|
fs.mkdirSync(path.join("Build", "Deployment", "AttachedSheet2Test"), { recursive: true });
|
|
cp.execSync(["press", "-f", path.join("Build", "Release", "AttachedSheet2Test"), path.join("Build", "Deployment", "AttachedSheet2Test")].join(" "), { stdio: "inherit" });
|
|
printResults("Deployment")
|
|
});
|
|
|
|
task ("press", ["release"], function()
|
|
{
|
|
fs.mkdirSync(path.join("Build", "Press", "AttachedSheet2Test"), { recursive: true });
|
|
cp.execSync(["press", "-f", path.join("Build", "Release", "AttachedSheet2Test"), path.join("Build", "Press", "AttachedSheet2Test")].join(" "), { stdio: "inherit" });
|
|
});
|
|
|
|
task ("flatten", ["press"], function()
|
|
{
|
|
fs.mkdirSync(path.join("Build", "Flatten", "AttachedSheet2Test"), { recursive: true });
|
|
cp.execSync(["flatten", "-f", "--verbose", "--split", "3", "-c", "closure-compiler", path.join("Build", "Press", "AttachedSheet2Test"), path.join("Build", "Flatten", "AttachedSheet2Test")].join(" "), { stdio: "inherit" });
|
|
});
|