Files
cappuccino/AppKit/Jakefile
T
David Richardson e5c34e3dd7 Remove NativeHost platform target; require CommonJS/Node for tooling
Cappuccino previously supported three platform contexts behind the
PLATFORM() preprocessor macro: Browser, CommonJS/Node, and a NativeHost
target. NativeHost is no longer supported; this removes it and
consolidates on Browser (for the app) and CommonJS/Node (still needed
by the toolchain itself, for theme compilation and testing).

PLATFORM(DOM) conditionals throughout AppKit governed both distinctions
at once - Browser vs NativeHost, and separately, DOM-dependent code vs
the CommonJS/Node build. Each conditional was reviewed individually:
NativeHost-only branches were removed, while branches needed for
CommonJS/Node were kept intact rather than collapsed to Browser-only.

Also included, found in the course of this work:
- Fixed two pre-existing duplicate instance-variable declarations
  (_ephemeralSubviews in CPView, _scrollingTimer in CPTextView)
- Added a missing @import for CPTextContainer.j in CPTextView.j so
  it resolves when compiled outside the full framework bundle
- Merged two Platform/DOM/*.j files into their parents to resolve a
  build-tool basename collision, preserving the CommonJS fallback path
2026-08-12 13:25:52 -06:00

66 lines
2.6 KiB
JavaScript

require("../common.jake");
var framework = require("../Jake/frameworktask.js").framework,
BundleTask = require("../Jake/bundletask.js").BundleTask;
const path = require("path");
const utilsFile = ObjectiveJ.utils.file;
$BUILD_PATH = path.join($BUILD_DIR, $CONFIGURATION, 'AppKit');
AppKitFiles = new FileList("**/*.j").exclude('CoreGraphics/CGContextCanvas.j', 'CoreGraphics/CGContextVML.j', 'Themes/**/*', 'Tools/**/*');
appKitTask = framework ("AppKit", function(appKitTask)
{
appKitTask.setBuildIntermediatesPath(path.join($BUILD_DIR, "AppKit.build", $CONFIGURATION))
appKitTask.setBuildPath($BUILD_CONFIGURATION_DIR);
appKitTask.setAuthor("280 North, Inc.");
appKitTask.setEmail("feedback @nospam@ 280north.com");
appKitTask.setSummary("AppKit classes for Cappuccino");
appKitTask.setIdentifier("com.280n.AppKit");
appKitTask.setVersion(getCappuccinoVersion());
appKitTask.setLicense(BundleTask.License.LGPL_v2_1);
appKitTask.setSources(AppKitFiles);
appKitTask.setResources(new FileList("Resources/**/*"));
appKitTask.setFlattensSources(true);
appKitTask.setInfoPlistPath("Info.plist");
// Grab all the .h's and just include them in each file.
var INCLUDES = new FileList("**/*.h").map(function(aFilename)
{
return "--include \"" + aFilename + "\"";
}).join(" ");
if ($CONFIGURATION === "Release") {
appKitTask.setCompilerFlags("-O2 -Wno-unused-but-set-variable " + INCLUDES);
}
else
appKitTask.setCompilerFlags("-DDEBUG -g -S --inline-msg-send -Wno-unused-but-set-variable " + INCLUDES);
});
$BUILD_CJS_CAPPUCCINO_APPKIT = path.join($BUILD_CJS_CAPPUCCINO_FRAMEWORKS, "AppKit");
filedir ($BUILD_CJS_CAPPUCCINO_APPKIT, ["AppKit"], function()
{
utilsFile.cp_r(appKitTask.buildProductPath(), $BUILD_CJS_CAPPUCCINO_APPKIT);
});
subtasks (["Themes"], ["clean", "clobber"]);
task ("Theme", [$BUILD_CJS_CAPPUCCINO_APPKIT], function()
{
subjake(["Themes"], "build");
utilsFile.cp_r(path.join($BUILD_DIR, $CONFIGURATION, 'Aristo.blend'), path.join($BUILD_PATH, 'Resources', 'Aristo.blend'));
utilsFile.cp_r(path.join($BUILD_DIR, $CONFIGURATION, 'Aristo.blend'), path.join($BUILD_CJS_CAPPUCCINO_APPKIT, "Resources", "Aristo.blend"));
utilsFile.cp_r(path.join($BUILD_DIR, $CONFIGURATION, 'Aristo2.blend'), path.join($BUILD_PATH, 'Resources', 'Aristo2.blend'));
utilsFile.cp_r(path.join($BUILD_DIR, $CONFIGURATION, 'Aristo2.blend'), path.join($BUILD_CJS_CAPPUCCINO_APPKIT, "Resources", "Aristo2.blend"));
});
task ("build", ["AppKit", $BUILD_CJS_CAPPUCCINO_APPKIT, "Theme"]);
CLOBBER.include($BUILD_CJS_CAPPUCCINO_APPKIT);