mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
AppKit and Themes are now buildable
This commit is contained in:
@@ -1,60 +1,38 @@
|
||||
|
||||
require("../../../common.jake");
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const ObjectiveJ = require("objj-runtime");
|
||||
|
||||
$BUILD_CJS_BLENDTASK = path.join($BUILD_CJS_CAPPUCCINO, "lib", "cappuccino", "jake", "blendtask.j");
|
||||
|
||||
var callback;
|
||||
|
||||
function callbackFunction(blendtask) {
|
||||
callback(blendtask);
|
||||
}
|
||||
|
||||
require("../../../CommonJS/lib/cappuccino/jake.js").initilize(callbackFunction);
|
||||
|
||||
$BUILD_CJS_BLENDTASK = path.join($BUILD_CJS_CAPPUCCINO, "lib", "cappuccino", "jake", "blendtask.j");
|
||||
|
||||
var promise = new Promise((resolve, reject) => {
|
||||
callback = function(BLEND_TASK) {
|
||||
exports.BlendTask = BLEND_TASK.BlendTask;
|
||||
exports.blend = BLEND_TASK.blend;
|
||||
defineBlendTask();
|
||||
resolve();
|
||||
delete exports.jakePromise;
|
||||
defineBlendTask().then(() => {
|
||||
resolve();
|
||||
delete exports.jakePromise;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var blendTask = buildBlendTask({});
|
||||
|
||||
function buildBlendTask(localExports) {
|
||||
|
||||
function exposeExports(path) {
|
||||
var object = require(path);
|
||||
|
||||
for (var name in object) {
|
||||
if (object.hasOwnProperty(name)) {
|
||||
localExports[name] = object[name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exposeExports("jake");
|
||||
|
||||
// This check is only necessary because during the build process blendtask gets created much later.
|
||||
|
||||
if (fs.existsSync($BUILD_CJS_BLENDTASK)) {
|
||||
objj_importFile($BUILD_CJS_BLENDTASK, true, callback);
|
||||
//var BLEND_TASK = require("cappuccino/jake/blendtask");
|
||||
}
|
||||
return localExports;
|
||||
}
|
||||
|
||||
function defineBlendTask() {
|
||||
blendTask.blend ("Aristo.blend", function(aristoTask)
|
||||
async function defineBlendTask() {
|
||||
await exports.blend ("Aristo.blend", function(aristoTask)
|
||||
{
|
||||
aristoTask.setBuildIntermediatesPath(path.join($BUILD_DIR, "Aristo.build", $CONFIGURATION))
|
||||
aristoTask.setBuildPath(path.join($BUILD_DIR, $CONFIGURATION));
|
||||
|
||||
|
||||
aristoTask.setThemeDescriptors(new FileList("ThemeDescriptors.j"));
|
||||
aristoTask.setIdentifier("com.280n.blend.Aristo");
|
||||
aristoTask.setResources(new FileList("Resources/*"));
|
||||
});
|
||||
|
||||
task ("build", ["Aristo.blend"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,39 @@
|
||||
|
||||
require("../../../common.jake");
|
||||
|
||||
var blend = require("cappuccino/jake").blend;
|
||||
const path = require("path");
|
||||
|
||||
blend ("Aristo2.blend", function(aristo2Task)
|
||||
{
|
||||
aristo2Task.setBuildIntermediatesPath(FILE.join($BUILD_DIR, "Aristo2.build", $CONFIGURATION))
|
||||
aristo2Task.setBuildPath(FILE.join($BUILD_DIR, $CONFIGURATION));
|
||||
var callback;
|
||||
|
||||
aristo2Task.setThemeDescriptors(new FileList("ThemeDescriptors.j"));
|
||||
aristo2Task.setIdentifier("com.280n.blend.Aristo2");
|
||||
aristo2Task.setResources(new FileList("Resources/*"));
|
||||
function callbackFunction(blendtask) {
|
||||
callback(blendtask);
|
||||
}
|
||||
|
||||
require("../../../CommonJS/lib/cappuccino/jake.js").initilize(callbackFunction);
|
||||
|
||||
$BUILD_CJS_BLENDTASK = path.join($BUILD_CJS_CAPPUCCINO, "lib", "cappuccino", "jake", "blendtask.j");
|
||||
|
||||
var promise = new Promise((resolve, reject) => {
|
||||
callback = function(BLEND_TASK) {
|
||||
exports.BlendTask = BLEND_TASK.BlendTask;
|
||||
exports.blend = BLEND_TASK.blend;
|
||||
defineBlendTask().then(() => {
|
||||
resolve();
|
||||
delete exports.jakePromise;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
task ("build", ["Aristo2.blend"]);
|
||||
async function defineBlendTask() {
|
||||
await exports.blend ("Aristo2.blend", function(aristoTask)
|
||||
{
|
||||
aristoTask.setBuildIntermediatesPath(path.join($BUILD_DIR, "Aristo2.build", $CONFIGURATION))
|
||||
aristoTask.setBuildPath(path.join($BUILD_DIR, $CONFIGURATION));
|
||||
|
||||
aristoTask.setThemeDescriptors(new FileList("ThemeDescriptors.j"));
|
||||
aristoTask.setIdentifier("com.280n.blend.Aristo2");
|
||||
aristoTask.setResources(new FileList("Resources/*"));
|
||||
});
|
||||
task ("build", ["Aristo2.blend"]);
|
||||
}
|
||||
|
||||
exports.jakePromise = promise;
|
||||
@@ -27,7 +27,8 @@
|
||||
@import <AppKit/_CPCibObjectData.j>
|
||||
@import <BlendKit/BlendKit.j>
|
||||
|
||||
|
||||
debugger;
|
||||
console.log("require: " + require);
|
||||
var /* FILE = require("file"), */
|
||||
TERM = require("objj-runtime").term,
|
||||
task = require("jake").task,
|
||||
@@ -82,9 +83,10 @@ BlendTask.prototype.setThemeDescriptors = function(/*Array | FileList*/ themeDes
|
||||
|
||||
BlendTask.prototype.defineTasks = function()
|
||||
{
|
||||
this.defineThemeDescriptorTasks();
|
||||
|
||||
BundleTask.prototype.defineTasks.apply(this, arguments);
|
||||
var self = this;
|
||||
return self.defineThemeDescriptorTasks().then(function() {
|
||||
BundleTask.prototype.defineTasks.apply(self, arguments);
|
||||
});
|
||||
};
|
||||
|
||||
BlendTask.prototype.defineSourceTasks = function()
|
||||
@@ -93,54 +95,70 @@ BlendTask.prototype.defineSourceTasks = function()
|
||||
|
||||
BlendTask.prototype.defineThemeDescriptorTasks = function()
|
||||
{
|
||||
this.environments().forEach(function(anEnvironment)
|
||||
{
|
||||
var folder = anEnvironment.name() + ".environment",
|
||||
themeDescriptors = this.themeDescriptors(),
|
||||
resourcesPath = this.resourcesPath(),
|
||||
intermediatesPath = path.join(this.buildIntermediatesProductPath(), folder, "Resources"),
|
||||
staticPath = this.buildProductStaticPathForEnvironment(anEnvironment),
|
||||
keyedThemes = this._keyedThemes,
|
||||
themesTaskName = this.name() + ":themes";
|
||||
|
||||
this.enhance(themesTaskName);
|
||||
|
||||
themeDescriptors.forEach(function(/*CPString*/ themeDescriptorPath)
|
||||
var self = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
var envsLeft = self.environments().length;
|
||||
self.environments().forEach(function(anEnvironment)
|
||||
{
|
||||
objj_importFile(path.resolve(themeDescriptorPath), YES);
|
||||
});
|
||||
var folder = anEnvironment.name() + ".environment",
|
||||
themeDescriptors = this.themeDescriptors(),
|
||||
resourcesPath = this.resourcesPath(),
|
||||
intermediatesPath = path.join(this.buildIntermediatesProductPath(), folder, "Resources"),
|
||||
staticPath = this.buildProductStaticPathForEnvironment(anEnvironment),
|
||||
keyedThemes = this._keyedThemes,
|
||||
themesTaskName = this.name() + ":themes";
|
||||
var tdLeft = themeDescriptors.length;
|
||||
|
||||
[BKThemeDescriptor allThemeDescriptorClasses].forEach(function(aClass)
|
||||
{
|
||||
var keyedThemePath = path.join(intermediatesPath, [aClass themeName] + ".keyedtheme");
|
||||
this.enhance(themesTaskName);
|
||||
|
||||
filedir (keyedThemePath, themesTaskName);
|
||||
filedir (staticPath, [keyedThemePath]);
|
||||
|
||||
keyedThemes.push([aClass themeName] + ".keyedtheme");
|
||||
});
|
||||
|
||||
task (themesTaskName, function()
|
||||
{
|
||||
[BKThemeDescriptor allThemeDescriptorClasses].forEach(function(aClass)
|
||||
themeDescriptors.forEach(function(/*CPString*/ themeDescriptorPath)
|
||||
{
|
||||
var themeTemplate = [[BKThemeTemplate alloc] init];
|
||||
var localIntermediatesPath = intermediatesPath;
|
||||
var localStaticPath = staticPath;
|
||||
var localKeyedThemes = keyedThemes;
|
||||
var localThemesTaskName = themesTaskName;
|
||||
|
||||
console.log("starting themedescriptors: " + themeDescriptorPath);
|
||||
objj_importFile(path.resolve(themeDescriptorPath), YES, function() {
|
||||
if (--tdLeft === 0) {
|
||||
[BKThemeDescriptor allThemeDescriptorClasses].forEach(function(aClass)
|
||||
{
|
||||
var keyedThemePath = path.join(localIntermediatesPath, [aClass themeName] + ".keyedtheme");
|
||||
|
||||
[themeTemplate setValue:[aClass themeName] forKey:@"name"];
|
||||
filedir (keyedThemePath, themesTaskName);
|
||||
filedir (localStaticPath, [keyedThemePath]);
|
||||
|
||||
var objectTemplates = [aClass themedObjectTemplates],
|
||||
data = cibDataFromTopLevelObjects(objectTemplates.concat([themeTemplate])),
|
||||
fileContents = themeFromCibData(data);
|
||||
localKeyedThemes.push([aClass themeName] + ".keyedtheme");
|
||||
});
|
||||
console.log("themesTaskName: " + localThemesTaskName);
|
||||
task (localThemesTaskName, function()
|
||||
{
|
||||
[BKThemeDescriptor allThemeDescriptorClasses].forEach(function(aClass)
|
||||
{
|
||||
var themeTemplate = [[BKThemeTemplate alloc] init];
|
||||
|
||||
// No filedir in this case, so we have to make it ourselves.
|
||||
fs.mkdirSync(intermediatesPath, { recursive: true });
|
||||
//FILE.mkdirs(intermediatesPath);
|
||||
// FIXME: MARKER_TEXT isn't global, so we use "t;".
|
||||
fs.writeFileSync(path.join(intermediatesPath, [aClass themeName] + ".keyedtheme"), "t;" + fileContents.length + ";" + fileContents, { encoding: "utf8" });
|
||||
//FILE.write(FILE.join(intermediatesPath, [aClass themeName] + ".keyedtheme"), "t;" + fileContents.length + ";" + fileContents, { charset:"UTF-8" });
|
||||
[themeTemplate setValue:[aClass themeName] forKey:@"name"];
|
||||
|
||||
var objectTemplates = [aClass themedObjectTemplates],
|
||||
data = cibDataFromTopLevelObjects(objectTemplates.concat([themeTemplate])),
|
||||
fileContents = themeFromCibData(data);
|
||||
|
||||
// No filedir in this case, so we have to make it ourselves.
|
||||
fs.mkdirSync(localIntermediatesPath, { recursive: true });
|
||||
//FILE.mkdirs(intermediatesPath);
|
||||
// FIXME: MARKER_TEXT isn't global, so we use "t;".
|
||||
fs.writeFileSync(path.join(localIntermediatesPath, [aClass themeName] + ".keyedtheme"), "t;" + fileContents.length + ";" + fileContents, { encoding: "utf8" });
|
||||
//FILE.write(FILE.join(intermediatesPath, [aClass themeName] + ".keyedtheme"), "t;" + fileContents.length + ";" + fileContents, { charset:"UTF-8" });
|
||||
});
|
||||
});
|
||||
if (--envsLeft === 0) {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}, this);
|
||||
}, self);
|
||||
});
|
||||
};
|
||||
|
||||
function cibDataFromTopLevelObjects(objects)
|
||||
@@ -266,5 +284,7 @@ exports.BlendTask = BlendTask;
|
||||
exports.blend = function(aName, aFunction)
|
||||
{
|
||||
// No .apply necessary because the parameters aren't variable.
|
||||
return BlendTask.defineTask(aName, aFunction);
|
||||
};
|
||||
return BlendTask.defineTask(aName, aFunction).then(function(task) {
|
||||
return task;
|
||||
});
|
||||
};
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
|
||||
var FILE = require("file");
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
|
||||
function exposeExports(path)
|
||||
{
|
||||
@@ -11,13 +10,27 @@ function exposeExports(path)
|
||||
exports[name] = object[name];
|
||||
}
|
||||
|
||||
exposeExports("objective-j/jake");
|
||||
exposeExports("jake");
|
||||
|
||||
// This check is only necessary because during the build process blendtask gets created much later.
|
||||
if (FILE.exists(FILE.join(FILE.dirname(module.path), "jake", "blendtask.j")))
|
||||
{
|
||||
var BLEND_TASK = require("cappuccino/jake/blendtask");
|
||||
exports.initilize = function(callback) {
|
||||
console.log("initilize");
|
||||
|
||||
exports.BlendTask = BLEND_TASK.BlendTask;
|
||||
exports.blend = BLEND_TASK.blend;
|
||||
}
|
||||
// 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);
|
||||
if (fs.existsSync(blendTaskPath))
|
||||
{
|
||||
var anExports = {};
|
||||
function localCallback() {
|
||||
callback(anExports);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
+18
-10
@@ -98,10 +98,17 @@ BundleTask.prototype.__proto__ = Task.prototype;
|
||||
BundleTask.defineTask = function(aName, aFunction)
|
||||
{
|
||||
var bundleTask = Task.defineTask.apply(this, [aName]);
|
||||
if (aFunction)
|
||||
if (aFunction) {
|
||||
aFunction(bundleTask);
|
||||
bundleTask.defineTasks();
|
||||
return bundleTask;
|
||||
}
|
||||
var p = bundleTask.defineTasks();
|
||||
if (p != null) {
|
||||
return p.then(() => {
|
||||
return bundleTask;
|
||||
});
|
||||
} else {
|
||||
return bundleTask;
|
||||
}
|
||||
};
|
||||
BundleTask.prototype.setEnvironments = function(environments)
|
||||
{
|
||||
@@ -624,9 +631,11 @@ BundleTask.prototype.defineStaticTask = function()
|
||||
else if (aFilename.indexOf(resourcesPath) === 0 && !isImage(aFilename))
|
||||
{
|
||||
var resourcePath = "Resources/" + path.relative(resourcesPath, aFilename);
|
||||
fileStream.write("p;");
|
||||
fs.writeFileSync(fileStream, "p;");
|
||||
//fileStream.write("p;");
|
||||
contents = fs.readFileSync(aFilename).toString("utf8");
|
||||
fileStream.write(resourcePath.length + ";" + resourcePath + contents);
|
||||
fs.writeFileSync(fileStream, resourcePath.length + ";" + resourcePath + contents);
|
||||
//fileStream.write(resourcePath.length + ";" + resourcePath + contents);
|
||||
}
|
||||
}, this);
|
||||
fs.writeFileSync(fileStream, "e;");
|
||||
@@ -695,7 +704,8 @@ BundleTask.prototype.defineSourceTasks = function()
|
||||
{
|
||||
(term.stream.write("Including [\0blue(" + anEnvironment + "\0)] \0purple(" + aFilename + "\0)")).flush();
|
||||
var compiled = fs.readFileSync(aFilename, { encoding: "utf8"}).toString();
|
||||
console.log((Array(Math.round(compiled.length / 1024) + 3)).join("."));
|
||||
var dots = (Array(Math.round(compiled.length / 1024 / 4) + 3)).join(".");
|
||||
term.stream.print(dots);
|
||||
return await fs.promises.writeFile(compiledEnvironmentSource, compiled, { encoding: "utf8"});
|
||||
}
|
||||
else
|
||||
@@ -717,15 +727,13 @@ BundleTask.prototype.defineSourceTasks = function()
|
||||
executer = new ObjectiveJ.FileExecutable(otherwayTranslatedFilename);
|
||||
var compiled = executer.toMarkedString();
|
||||
//var msg = "Compiling [\0blue(" + anEnvironment + "\0)] \0purple(" + aFilename + "\0)";
|
||||
var dots = (Array(Math.round(compiled.length / 1024) + 3)).join(".");
|
||||
var dots = (Array(Math.round(compiled.length / 1024 / 4) + 3)).join(".");
|
||||
term.stream.print(dots);
|
||||
fs.writeFileSync(compiledEnvironmentSource, compiled, { encoding: "utf8"});
|
||||
resolve();
|
||||
}
|
||||
console.log("mnf");
|
||||
debugger;
|
||||
var msg = "Compiling [\0blue(" + anEnvironment + "\0)] \0purple(" + aFilename + "\0)";
|
||||
term.stream.print(msg);
|
||||
term.stream.write(msg);
|
||||
ObjectiveJ.make_narwhal_factory(absolutePath, basePath, translateFilenameToPath, callback)(require, e, module, {}, console.log);
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ require("../common.jake");
|
||||
|
||||
//subtasks(["fontinfo", "imagesize"], ["clean", "clobber"]);
|
||||
|
||||
subtasks(["fontinfo", "imagesize", "nib2cib"], ["build", /*"clean", "clobber"*/]);
|
||||
//subtasks(["fontinfo", "imagesize", "nib2cib"], ["build", /*"clean", "clobber"*/]);
|
||||
|
||||
+18
-69
@@ -19,19 +19,10 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// var SYSTEM = require("system");
|
||||
// var FILE = require("file");
|
||||
// var OS = require("os");
|
||||
// var UTIL = require("narwhal/util");
|
||||
// var stream = require("narwhal/term").stream;
|
||||
|
||||
console.log("at the top of common.jake");
|
||||
var fs = require('fs');
|
||||
var child_process = require('child_process');
|
||||
var path = require('path');
|
||||
|
||||
// for testing
|
||||
var JAKE = require("jake");
|
||||
const fs = require('fs');
|
||||
const child_process = require('child_process');
|
||||
const path = require('path');
|
||||
const jake = require("jake");
|
||||
|
||||
requiresSudo = false;
|
||||
|
||||
@@ -60,51 +51,12 @@ if (!process.env["CONFIG"])
|
||||
process.env["CONFIG"] = "Release";
|
||||
|
||||
global.ENV = process.env;
|
||||
|
||||
// changed approach, now we try to port jake from narwhal to node instead
|
||||
|
||||
/* newJakeTaskWrapper = function() {
|
||||
console.log("nu har vi kört taskwrappern");
|
||||
var nArgs = arguments.length;
|
||||
desc(arguments[0])
|
||||
if (nArgs == 3) {
|
||||
jake.task(arguments[0], arguments[1], arguments[2]);
|
||||
} else if (nArgs == 2) {
|
||||
jake.task(arguments[0], arguments[1]);
|
||||
} else {
|
||||
jake.task(arguments[0]);
|
||||
}
|
||||
}
|
||||
|
||||
newJakeFiledirWrapper = function() {
|
||||
console.log("nu har vi kört file or dir wrappern");
|
||||
var nArgs = arguments.length;
|
||||
desc(arguments[0]);
|
||||
if (!path.extname(arguments[0])) {
|
||||
jake.directory(arguments[0]);
|
||||
if (nArgs == 3) {
|
||||
jake.file(arguments[0], arguments[1], arguments[2]);
|
||||
} else if (nArgs == 2) {
|
||||
jake.file(arguments[0], arguments[1]);
|
||||
} else {
|
||||
jake.file(arguments[0]);
|
||||
}
|
||||
} else {
|
||||
if (nArgs == 3) {
|
||||
jake.file(arguments[0], arguments[1], arguments[2]);
|
||||
} else if (nArgs == 2) {
|
||||
jake.file(arguments[0], arguments[1]);
|
||||
} else {
|
||||
jake.file(arguments[0]);
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
global.task = JAKE.task;
|
||||
global.directory = JAKE.directory;
|
||||
global.file = JAKE.file;
|
||||
global.filedir = JAKE.filedir;
|
||||
global.FileList = JAKE.FileList;
|
||||
|
||||
global.task = jake.task;
|
||||
global.directory = jake.directory;
|
||||
global.file = jake.file;
|
||||
global.filedir = jake.filedir;
|
||||
global.FileList = jake.FileList;
|
||||
|
||||
global.$CONFIGURATION = process.env['CONFIG'];
|
||||
global.$INLINE_MSG_SEND = process.env['INLINE_MSG_SEND'];
|
||||
@@ -174,7 +126,7 @@ function packageInCatalog(path)
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXA: vi tar denna från narwhal
|
||||
// from narwhal
|
||||
function enquote(word) {
|
||||
return "'" + String(word).replace(/'/g, "'\"'\"'") + "'";
|
||||
}
|
||||
@@ -228,7 +180,6 @@ function reforkWithPackages()
|
||||
{
|
||||
var cmd = serializedENV() + " " + process.argv.map(enquote).join(" ");
|
||||
console.log("cmd: " + cmd);
|
||||
// FIXA: oklart om detta är rätt
|
||||
child_process.execSync(cmd, {stdio: 'inherit'});
|
||||
process.exit();
|
||||
}
|
||||
@@ -249,6 +200,7 @@ function setupEnvironment()
|
||||
{
|
||||
try
|
||||
{
|
||||
debugger;
|
||||
require("objj-runtime").OBJJ_INCLUDE_PATHS.push(path.join($BUILD_CONFIGURATION_DIR, "CommonJS", "cappuccino", "Frameworks"));
|
||||
}
|
||||
catch (e)
|
||||
@@ -265,22 +217,21 @@ global.rm_rf = function(/*String*/ aFilename)
|
||||
catch (anException) { }
|
||||
};
|
||||
|
||||
// FIXA: stackoverflow, men denna göra ju typ det som cp_r nedan gör
|
||||
// from stackoverflow
|
||||
function copyRecursiveSync (src, dest) {
|
||||
var exists = fs.existsSync(src);
|
||||
var stats = exists && fs.statSync(src);
|
||||
var isDirectory = exists && stats.isDirectory();
|
||||
if (isDirectory) {
|
||||
fs.mkdirSync(dest);
|
||||
fs.mkdirSync(dest, { recursive: true });
|
||||
fs.readdirSync(src).forEach(function(childItemName) {
|
||||
copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
|
||||
});
|
||||
} else {
|
||||
fs.copyFileSync(src, dest);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
global.cp_r = function(/*String*/ from, /*String*/ to)
|
||||
{
|
||||
if (fs.existsSync(to))
|
||||
@@ -290,7 +241,6 @@ global.cp_r = function(/*String*/ from, /*String*/ to)
|
||||
copyRecursiveSync(from, to);
|
||||
else
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
fs.copyFileSync(from, to);
|
||||
@@ -313,7 +263,6 @@ global.mv = function(/*String*/ from, /*String*/ to)
|
||||
fs.renameSync(from, to);
|
||||
};
|
||||
|
||||
// FIXA: kör command och returnera exitkoden
|
||||
function systemSync(command)
|
||||
{
|
||||
console.log("i systemSync");
|
||||
@@ -424,7 +373,6 @@ global.subtasks = function(subprojects, taskNames)
|
||||
});
|
||||
};
|
||||
|
||||
// FIXA: Oklar metod
|
||||
global.installSymlink = function(sourcePath)
|
||||
{
|
||||
if (!fs.lstatSync(sourcePath).isDirectory())
|
||||
@@ -497,11 +445,12 @@ 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() + " " /* + "node --inspect-brk" */ + " /Users/alfred/Developer/jake/bin/jake" + " " + aTaskName))
|
||||
console.log("exited in spawnJake with code 1");
|
||||
process.exit(1); //rake abort if ($? != 0)
|
||||
};
|
||||
@@ -611,7 +560,7 @@ task ("release", function()
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
console.log("Hello!");
|
||||
console.log("in debug mode");
|
||||
process.env["CONFIG"] = "Debug";
|
||||
spawnJake("build");
|
||||
});
|
||||
|
||||
Generated
+1983
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "cappuccino",
|
||||
"version": "1.0.0",
|
||||
"description": "[](https://travis-ci.org/cappuccino/cappuccino) [](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-runtime": "file:../objj-runtime"
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user