More jakefiles and fixing incorrect commonjs package structure.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-09-23 16:27:52 -07:00
1 parent 9dc0c3ab6d
commit a8ab16002e
9 files changed
+50 -35

No files matched your search

+5 -13
View File
@@ -1,17 +1,15 @@
#!/usr/bin/env narwhal
print("ok");
var FILE = require("file"),
bundle = require(FILE.absolute("/Users/tolmasky/Development/Cappuccino/Objective-J/commonJS/objective-j/lib/jake/bundletask")).bundle,
BundleTask = require(FILE.absolute("/Users/tolmasky/Development/Cappuccino/Objective-J/commonJS/objective-j/lib/jake/bundletask")).BundleTask;
var FILE = require("file");
require(FILE.absolute("../common.jake"));
$ENVIRONMENT_PRODUCT = FILE.join($ENVIRONMENT_FRAMEWORKS_DIR, "Foundation");
$BUILD_PATH = FILE.join($BUILD_DIR, $CONFIGURATION, "Foundation");
task ("build", ["Foundation", $ENVIRONMENT_PRODUCT]);
task ("build", ["Foundation"]);
bundle ("Foundation", function(foundationTask)
framework ("Foundation", function(foundationTask)
{
foundationTask.setBuildIntermediatesPath(FILE.join($BUILD_DIR, "Foundation.build", $CONFIGURATION))
foundationTask.setBuildPath(FILE.join($BUILD_DIR, $CONFIGURATION));
@@ -22,10 +20,4 @@ bundle ("Foundation", function(foundationTask)
foundationTask.setResources(FILE.glob("Resources/*"));
});
// Framework in environment directory
filedir ($ENVIRONMENT_PRODUCT, ["Foundation"], function()
{
cp_r(FILE.join($BUILD_PATH, '.'), $ENVIRONMENT_PRODUCT);
});
//CLOBBER.include($ENVIRONMENT_PRODUCT)
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env narwhal
var FILE = require("file");
require("../../common.jake");
$COMMON_JS_PRODUCT = FILE.join($BUILD_DIR, "objective-j");
task ("build", [$COMMON_JS_PRODUCT]);
filedir ($COMMON_JS_PRODUCT, FILE.glob("objective-j/**/*"), function()
{
rm_rf($COMMON_JS_PRODUCT);
cp_r('objective-j', $COMMON_JS_PRODUCT);
});
//CLOBBER.include($ENVIRONMENT_OBJJ_PRODUCT)
@@ -1,5 +0,0 @@
throw "uh oh";
print("wha?...");
exports.BundleTask = require("objective-j/jake/bundletask").BundleTask;
//exports.FrameworkTask = require("objective-j/jake/frameworktask");
//exports.ApplicationTask = require("objective-j/jake/applicationtask");
@@ -0,0 +1,10 @@
var BUNDLE_TASK = require("objective-j/jake/bundletask");
exports.BundleTask = BUNDLE_TASK.BundleTask;
exports.bundle = BUNDLE_TASK.bundle;
var FRAMEWORK_TASK = require("objective-j/jake/frameworktask");
exports.FrameworkTask = FRAMEWORK_TASK.FrameworkTask;
exports.framework = FRAMEWORK_TASK.framework;
@@ -105,19 +105,19 @@ BundleTask.defineTask = function(/*String*/ aName, /*Function*/ aFunction)
BundleTask.Platform = {
"ObjJ" : "ObjJ",
"Rhino" : "Rhino",
"CommonJS" : "CommonJS",
"Browser" : "Browser"
};
BundleTask.PLATFORM_DIRECTORIES = {
"ObjJ" : "objj.platform",
"Rhino" : "rhino.platform",
"CommonJS" : "commonjs.platform",
"Browser" : "browser.platform"
};
BundleTask.PLATFORM_DEFAULT_FLAGS = {
"ObjJ" : [],
"Rhino" : ['-DPLATFORM_RHINO'],
"CommonJS" : ['-DPLATFORM_RHINO -DPLATFORM_COMMONJS'],
"Browser" : ['-DPLATFORM_BROWSER', '-DPLATFORM_DOM']
};
@@ -321,7 +321,7 @@ var LICENSES_PATH = FILE.join(FILE.absolute(FILE.dirname(module.path)), "LICEN
"LGPL_v2_1" : FILE.join(LICENSES_PATH, "LGPL-v2.1"),
"MIT" : FILE.join(LICENSES_PATH, "MIT")
};
print(LICENSE_PATHS.LGPL_v2_1);
BundleTask.prototype.defineLicenseTask = function()
{
var license = this.license();
@@ -405,7 +405,7 @@ BundleTask.prototype.resourcesPath = function()
BundleTask.prototype.defineResourceTask = function(aResourcePath, aDestinationPath)
{
var extname = FILE.extname(aResourcePath);
var extname = FILE.extension(aResourcePath);
// NOT:
// (extname === ".cib" && (FILE.exists(extensionless + '.xib') || FILE.exists(extensionless + '.nib')) ||
@@ -447,9 +447,9 @@ BundleTask.prototype.defineResourceTasks = function()
if (FILE.isDirectory(aResourcePath))
{
FILE.glob(aPath + "/**/*").forEach(function(aSubresourcePath)
FILE.glob(aResourcePath + "/**").forEach(function(aSubresourcePath)
{
this.defineResourceTask(resourcePath, FILE.join(resourcesPath, aSubresourcePath.substring(aSubresourcePath.length - baselength)));
this.defineResourceTask(aSubresourcePath, FILE.join(resourcesPath, aSubresourcePath.substring(aResourcePath.length - baselength)));
}, this);
}
else
@@ -495,7 +495,8 @@ BundleTask.prototype.defineSourceTasks = function()
{
var platformSources = sources,
platformBuildIntermediatesPath = FILE.join(this.buildIntermediatesProductPath(), BundleTask.PLATFORM_DIRECTORIES[aPlatform]),
staticPath = this.buildProductStaticPathForPlatform(aPlatform);
staticPath = this.buildProductStaticPathForPlatform(aPlatform),
flags = BundleTask.PLATFORM_DEFAULT_FLAGS[aPlatform];
if (!Array.isArray(platformSources))
platformSources = platformSources[aPlatform];
@@ -503,14 +504,14 @@ BundleTask.prototype.defineSourceTasks = function()
platformSources.forEach(function(/*String*/ aFilename)
{
// if this file doesn't exist or isn't a .j file, don't preprocess it.
if (!FILE.exists(aFilename) || FILE.extname(aFilename) !== '.j')
if (!FILE.exists(aFilename) || FILE.extension(aFilename) !== '.j')
return;
var compiledPlatformSource = FILE.join(platformBuildIntermediatesPath, FILE.basename(aFilename));
filedir (compiledPlatformSource, [aFilename], function()
{
objjc.preprocess(aFilename, compiledPlatformSource);
{//#{flags.join(' ')} #{PLATFORM_FLAGS[platform].join(' ')}
objjc.preprocess(aFilename, compiledPlatformSource, flags);
});
filedir (staticPath, [compiledPlatformSource]);
@@ -1,13 +1,13 @@
BundleTask = require("objective-j/bundletask").BundleTask;
BundleTask = require("objective-j/jake/bundletask").BundleTask;
function FrameworkTask()
{
function FrameworkTask(aName)
{print(aName + " so far so good");
BundleTask.apply(this, arguments);
}
FrameworkTask.__proto__ = BundleTask;
FrameworkTask.prototype.__proto__ = BundleTask;
FrameworkTask.prototype.__proto__ = BundleTask.prototype;
FrameworkTask.prototype.packageTask = function()
{
@@ -19,5 +19,5 @@ exports.FrameworkTask = FrameworkTask;
exports.framework = function(aName, aFunction)
{
// No .apply necessary because the parameters aren't variable.
return Framework.defineTask(aName, aFunction);
return FrameworkTask.defineTask(aName, aFunction);
}
+1 -1
View File
@@ -89,7 +89,7 @@ task ("clean", ["clean_suprojects"]);
task ("clobber", ["clobber_subprojects"]);
subprojects = ["Tools"];
subprojects = ["CommonJS"];
task ("build_subprojects", function()
{