mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-09 12:17:13 +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.
95 lines
3.2 KiB
JavaScript
95 lines
3.2 KiB
JavaScript
/*
|
|
* Jakefile
|
|
* CPURLConnectionAsyncTest
|
|
*
|
|
* Created by You on February 1, 2012.
|
|
* Copyright 2012, Your Company 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 ("CPURLConnectionAsyncTest", function(task)
|
|
{
|
|
task.setBuildIntermediatesPath(path.join("Build", "CPURLConnectionAsyncTest.build", configuration));
|
|
task.setBuildPath(path.join("Build", configuration));
|
|
|
|
task.setProductName("CPURLConnectionAsyncTest");
|
|
task.setIdentifier("com.yourcompany.CPURLConnectionAsyncTest");
|
|
task.setVersion("1.0");
|
|
task.setAuthor("Your Company");
|
|
task.setEmail("feedback @nospam@ yourcompany.com");
|
|
task.setSummary("CPURLConnectionAsyncTest");
|
|
task.setSources((new FileList("**/*.j")).exclude(path.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", ["CPURLConnectionAsyncTest"], 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", "CPURLConnectionAsyncTest", "index.html")].join(" "), { stdio: "inherit" });
|
|
});
|
|
|
|
task ("run-release", ["release"], function()
|
|
{
|
|
cp.execSync(["open", path.join("Build", "Release", "CPURLConnectionAsyncTest", "index.html")].join(" "), { stdio: "inherit" });
|
|
});
|
|
|
|
task ("deploy", ["release"], function()
|
|
{
|
|
fs.mkdirSync(path.join("Build", "Deployment", "CPURLConnectionAsyncTest"), { recursive: true });
|
|
cp.execSync(["press", "-f", path.join("Build", "Release", "CPURLConnectionAsyncTest"), path.join("Build", "Deployment", "CPURLConnectionAsyncTest")].join(" "), { stdio: "inherit" });
|
|
printResults("Deployment")
|
|
});
|
|
|
|
task ("desktop", ["release"], function()
|
|
{
|
|
fs.mkdirSync(path.join("Build", "Desktop", "CPURLConnectionAsyncTest"), { recursive: true });
|
|
require("@objj/nativehost").buildNativeHost(path.join("Build", "Release", "CPURLConnectionAsyncTest"), path.join("Build", "Desktop", "CPURLConnectionAsyncTest", "CPURLConnectionAsyncTest.app"));
|
|
printResults("Desktop")
|
|
});
|
|
|
|
task ("run-desktop", ["desktop"], function()
|
|
{
|
|
cp.execSync([path.join("Build", "Desktop", "CPURLConnectionAsyncTest", "CPURLConnectionAsyncTest.app", "Contents", "MacOS", "NativeHost"), "-i"].join(" "), { stdio: "inherit" });
|
|
});
|
|
|
|
function printResults(configuration)
|
|
{
|
|
console.log("----------------------------");
|
|
console.log(configuration+" app built at path: "+path.join("Build", configuration, "CPURLConnectionAsyncTest"));
|
|
console.log("----------------------------");
|
|
}
|