minor bugfixes and clean up

This commit is contained in:
Alfred Wärnsäter
2021-07-28 10:12:24 +02:00
parent 5e9d479cef
commit 3605e99914
7 changed files with 4676 additions and 2016 deletions
+2 -2
View File
@@ -31,8 +31,8 @@ debugger;
console.log("require: " + require);
var /* FILE = require("file"), */
TERM = require("objj-runtime").term,
task = require("jake").task,
filedir = require("jake").filedir,
task = require("objj-jake").task,
filedir = require("objj-jake").filedir,
BundleTask = require("../../../Jake/bundletask.js").BundleTask;
var fs = require("fs");
+6 -10
View File
@@ -10,15 +10,15 @@ function exposeExports(path)
exports[name] = object[name];
}
exposeExports("jake");
exposeExports("objj-jake");
exports.initilize = function(callback) {
console.log("initilize");
// This check is only necessary because during the build process blendtask gets created much later.
var blendTaskPath = "/Users/alfred/Developer/cappuccino/AppKit/Themes/CommonJS/blendtask.j";
//var blendTaskPath = path.join(path.dirname(module.path), "jake", "blendtask.j");
console.log("blendTaskPath: " + blendTaskPath);
var blendTaskPath = path.join(process.cwd(), "..", "CommonJS", "blendtask.j");
// var blendTaskPath = path.join(path.dirname(module.path), "jake", "blendtask.j");
// Should be "{something}/AppKit/Themes/CommonJS/blendtask.j"
if (fs.existsSync(blendTaskPath))
{
var anExports = {};
@@ -27,10 +27,6 @@ exports.initilize = function(callback) {
}
process.env["CONFIG"] = "Debug";
require("objj-runtime").OBJJ_INCLUDE_PATHS.push(path.join(path.join($BUILD_DIR, "Debug"), "CommonJS", "cappuccino", "Frameworks"));
require("objj-runtime").make_narwhal_factory(blendTaskPath, null, null, localCallback)(require, anExports, module, typeof system !== "undefined" && system, console.log);
//exports.BlendTask = BLEND_TASK.BlendTask;
//exports.blend = BLEND_TASK.blend;
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ const term = require("objj-runtime").term;
// Internal modules
const environment = require("./environment");
const Jake = require("jake"); // TODO
const Jake = require("objj-jake"); // TODO
/* Old imports
FILE = require("file")
-11
View File
@@ -1,20 +1,9 @@
console.log("Inside top level Jakefile")
require("./common.jake");
/* var FILE = require("file"),
SYSTEM = require("system"),
OS = require("os"),
UTIL = require("narwhal/util"),
jake = require("jake"),
stream = require("narwhal/term").stream; */
var fs = require('fs');
var path = require('path');
const term = require("objj-runtime").term;
var subprojects = ["Objective-J", "CommonJS", "Foundation", "AppKit", "Tools"];
["build", "clean", "clobber"].forEach(function(aTaskName)
+8 -13
View File
@@ -22,7 +22,7 @@
const fs = require('fs');
const child_process = require('child_process');
const path = require('path');
const jake = require("jake");
const jake = require("objj-jake");
requiresSudo = false;
@@ -32,11 +32,10 @@ process.argv.slice(1).forEach(function(arg)
requiresSudo = true;
});
// Set up development environment variables.
// record the initial process.env so we know which need to be serialized later
// Record the initial process.env so we know which need to be serialized later.
var envInitial = Object.freeze(JSON.parse(JSON.stringify(process.env)));
// Set up development environment variables.
process.env["BUILD_PATH"] = path.resolve(
process.env["BUILD_PATH"] ||
process.env["CAPP_BUILD"] || // Global Cappuccino build directory.
@@ -70,9 +69,8 @@ global.$BUILD_CJS_CAPPUCCINO_BIN = path.join($BUILD_CJS_CAPPUCCINO, "bin"
global.$BUILD_CJS_CAPPUCCINO_LIB = path.join($BUILD_CJS_CAPPUCCINO, "lib");
global.$BUILD_CJS_CAPPUCCINO_FRAMEWORKS = path.join($BUILD_CJS_CAPPUCCINO, "Frameworks");
// for testing
global.CLEAN = require("../jake/lib/jake/clean.js").CLEAN;
global.CLOBBER = require("../jake/lib/jake/clean.js").CLOBBER;
global.CLEAN = require("objj-jake/lib/jake/clean.js").CLEAN;
global.CLOBBER = require("objj-jake/lib/jake/clean.js").CLOBBER;
global.CLEAN.include(path.join(global.$BUILD_DIR, "*.build"));
global.CLOBBER.include(global.$BUILD_DIR);
@@ -287,8 +285,7 @@ global.subjake = function(/*Array<String>*/ directories, /*String*/ aTaskName)
{
if (fs.lstatSync(aDirectory).isDirectory() && fs.lstatSync(path.join(aDirectory, "Jakefile")).isFile())
{
// just for testing
var cmd = "cd " + enquote(aDirectory) + " && " + serializedENV() + " " + "/Users/alfred/Developer/jake/bin/jake" + " " + enquote(aTaskName);
var cmd = "cd " + enquote(aDirectory) + " && " + serializedENV() + " " + "npx objj-jake" + " " + enquote(aTaskName);
var returnCode = systemSync(cmd);
if (returnCode)
@@ -328,8 +325,7 @@ global.symlink_executable = function(source)
global.getCappuccinoVersion = function()
{
console.log("sahfgdkjdkjfhgskjdhfgd");
var versionFile = path.join(module.path, "version.json");
var versionFile = path.join(module.path, "package.json");
return JSON.parse(fs.readFileSync(versionFile, { encoding: "utf8" })).version;
};
@@ -449,8 +445,7 @@ global.installCopy = function(sourcePath, useSudo)
global.spawnJake = function(/*String*/ aTaskName)
{
console.log("i spawnJake");
// for testing
if (systemSync(serializedENV() + " " /* + "node --inspect-brk" */ + " /Users/alfred/Developer/jake/bin/jake" + " " + aTaskName))
if (systemSync(serializedENV() + " " + "npx objj-jake" + " " + aTaskName))
console.log("exited in spawnJake with code 1");
process.exit(1); //rake abort if ($? != 0)
};
+4658 -1963
View File
File diff suppressed because it is too large Load Diff
+1 -16
View File
@@ -1,31 +1,16 @@
{
"name": "cappuccino",
"version": "1.0.0",
"description": "[![Build Status](https://travis-ci.org/cappuccino/cappuccino.svg?branch=master)](https://travis-ci.org/cappuccino/cappuccino) [![Join the chat at https://gitter.im/cappuccino/cappuccino](https://badges.gitter.im/cappuccino/cappuccino.svg)](https://gitter.im/cappuccino/cappuccino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)",
"main": "index.js",
"devDependencies": {
"@types/node": "^15.12.4",
"grunt": "^1.4.1",
"grunt-contrib-concat": "^1.0.1",
"terser": "^5.7.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git://github.com/cappuccino/cappuccino.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/cappuccino/cappuccino/issues"
},
"homepage": "https://github.com/cappuccino/cappuccino#readme",
"dependencies": {
"fs-extra": "^10.0.0",
"glob": "^7.1.7",
"jake": "file:../jake",
"objj-jake": "1.0.1",
"objj-runtime": "file:../objj-runtime"
}
}