Skip to content

Commit

Permalink
Split up objective-j and cappuccino CommonJS packages, and added abil…
Browse files Browse the repository at this point in the history
…ity to include Objective-J frameworks in CommonJS packages.

Reviewed by me.
  • Loading branch information
Francisco Ryan Tolmasky I committed Nov 2, 2009
1 parent fddf3d7 commit 0c13138
Show file tree
Hide file tree
Showing 34 changed files with 328 additions and 171 deletions.
18 changes: 9 additions & 9 deletions AppKit/Jakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env narwhal

require("../common.jake");

Expand All @@ -10,12 +9,13 @@ AppKitFiles = new FileList("**/*.j").exclude('CoreGraphics/CGContextCanvas.j', '
appKitTask = framework ("AppKit", function(appKitTask)
{
appKitTask.setBuildIntermediatesPath(FILE.join($BUILD_DIR, "AppKit.build", $CONFIGURATION))
appKitTask.setBuildPath(FILE.join($BUILD_DIR, $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("0.7.9");
appKitTask.setLicense(BundleTask.License.LGPL_v2_1);
appKitTask.setSources(AppKitFiles);
appKitTask.setResources(new FileList("Resources/**/*"));
Expand All @@ -28,23 +28,23 @@ appKitTask = framework ("AppKit", function(appKitTask)
appKitTask.setCompilerFlags("-DDEBUG -g");
});

$COMMONJS_PRODUCT_APPKIT = FILE.join($COMMONJS_PRODUCT_FRAMEWORKS, "AppKit");
$BUILD_CJS_CAPPUCCINO_APPKIT = FILE.join($BUILD_CJS_CAPPUCCINO_FRAMEWORKS, "AppKit");

filedir ($COMMONJS_PRODUCT_APPKIT, ["AppKit"], function()
filedir ($BUILD_CJS_CAPPUCCINO_APPKIT, ["AppKit"], function()
{
cp_r(appKitTask.buildProductPath(), $COMMONJS_PRODUCT_APPKIT);
cp_r(appKitTask.buildProductPath(), $BUILD_CJS_CAPPUCCINO_APPKIT);
});

subtasks (["Themes"], ["clean", "clobber"]);

task ("Theme", [$COMMONJS_PRODUCT_APPKIT], function()
task ("Theme", [$BUILD_CJS_CAPPUCCINO_APPKIT], function()
{
subjake(["Themes"], "build");

cp_r(FILE.join($BUILD_DIR, $CONFIGURATION, 'Aristo.blend'), FILE.join($BUILD_PATH, 'Resources', 'Aristo.blend'));
cp_r(FILE.join($BUILD_DIR, $CONFIGURATION, 'Aristo.blend'), FILE.join($COMMONJS_PRODUCT_APPKIT, "Resources", "Aristo.blend"));
cp_r(FILE.join($BUILD_DIR, $CONFIGURATION, 'Aristo.blend'), FILE.join($BUILD_CJS_CAPPUCCINO_APPKIT, "Resources", "Aristo.blend"));
});

task ("build", ["AppKit", $COMMONJS_PRODUCT_APPKIT, "Theme"]);
task ("build", ["AppKit", $BUILD_CJS_CAPPUCCINO_APPKIT, "Theme"]);

CLOBBER.include($COMMONJS_PRODUCT_APPKIT);
CLOBBER.include($BUILD_CJS_CAPPUCCINO_APPKIT);
3 changes: 1 addition & 2 deletions AppKit/Themes/Aristo/Jakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env narwhal

require("../../../common.jake");


blend("Aristo.blend", function(aristoTask)
blend ("Aristo.blend", function(aristoTask)
{
aristoTask.setBuildIntermediatesPath(FILE.join($BUILD_DIR, "Aristo.build", $CONFIGURATION))
aristoTask.setBuildPath(FILE.join($BUILD_DIR, $CONFIGURATION));
Expand Down
25 changes: 12 additions & 13 deletions AppKit/Themes/BlendKit/Jakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env narwhal

require("../../../common.jake");

Expand All @@ -9,11 +8,11 @@ blendKitTask = framework ("BlendKit", function(blendKitTask)
blendKitTask.setBuildPath(FILE.join($BUILD_DIR, $CONFIGURATION));

blendKitTask.setIdentifier("com.280n.BlendKit");
blendKitTask.setVersion("0.7.1");
// t.author = '280 North, Inc.'
// t.email = 'feedback @nospam@ 280north.com'
// t.summary = 'BlendKit classes for Cappuccino'
blendKitTask.setSources(FILE.glob("*.j")); //t.sources = FileList['*.j']
blendKitTask.setVersion("0.7.9");
blendKitTask.setAuthor("280 North, Inc.");
blendKitTask.setEmail("feedback @nospam@ 280north.com");
blendKitTask.setSummary("BlendKit classes for Cappuccino");
blendKitTask.setSources(FILE.glob("*.j"));
blendKitTask.setResources(FILE.glob("Resources/*"));
blendKitTask.setLicense(BundleTask.License.LGPL_v2_1);
blendKitTask.setFlattensSources(true); // FIXME: how do we non flatten?
Expand All @@ -24,13 +23,13 @@ blendKitTask = framework ("BlendKit", function(blendKitTask)
blendKitTask.setCompilerFlags("-DDEBUG -g");
});

$COMMONJS_PRODUCT_BLENDKIT = FILE.join($COMMONJS_PRODUCT_FRAMEWORKS, "BlendKit");
$BUILD_CJS_PRODUCT_BLENDKIT = FILE.join($BUILD_CJS_CAPPUCCINO_FRAMEWORKS, "BlendKit");

filedir ($COMMONJS_PRODUCT_BLENDKIT, ["BlendKit"], function()
{print("copying...");
cp_r(blendKitTask.buildProductPath(), $COMMONJS_PRODUCT_BLENDKIT);
filedir ($BUILD_CJS_PRODUCT_BLENDKIT, ["BlendKit"], function()
{
cp_r(blendKitTask.buildProductPath(), $BUILD_CJS_PRODUCT_BLENDKIT);
});
print("here?...");
task ("build", ["BlendKit", $COMMONJS_PRODUCT_BLENDKIT]);

CLOBBER.include( $COMMONJS_PRODUCT_BLENDKIT);
task ("build", ["BlendKit", $BUILD_CJS_PRODUCT_BLENDKIT]);

CLOBBER.include( $BUILD_CJS_PRODUCT_BLENDKIT);
15 changes: 7 additions & 8 deletions AppKit/Themes/CommonJS/Jakefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/usr/bin/env narwhal

require("../../../common.jake");

var FILE = require("file");

print("???");
$BLENDTASK = "blendtask.j";
$COMMONJS_BLENDTASK_PRODUCT = FILE.join($COMMONJS_PRODUCT, "lib-js", "objective-j", "jake", "blendtask.j");

filedir($COMMONJS_BLENDTASK_PRODUCT, [$BLENDTASK], function()
$BLENDTASK = "blendtask.j";
$BUILD_CJS_BLENDTASK = FILE.join($BUILD_CJS_CAPPUCCINO, "lib", "cappuccino", "jake", "blendtask.j");

filedir($BUILD_CJS_BLENDTASK, [$BLENDTASK], function()
{
cp_r($BLENDTASK, $COMMONJS_BLENDTASK_PRODUCT);
cp_r($BLENDTASK, $BUILD_CJS_BLENDTASK);
});

task("build", [$COMMONJS_BLENDTASK_PRODUCT]);
task("build", [$BUILD_CJS_BLENDTASK]);

CLOBBER.include($COMMONJS_BLENDTASK_PRODUCT);
CLOBBER.include($BUILD_CJS_BLENDTASK);
3 changes: 2 additions & 1 deletion AppKit/Themes/CommonJS/blendtask.j
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
@import <BlendKit/BlendKit.j>


var Jake = require("jake"),
var FILE = require("file"),
Jake = require("jake"),
BundleTask = require("objective-j/jake/bundletask").BundleTask;


Expand Down
21 changes: 21 additions & 0 deletions CommonJS/Jakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

require("../common.jake");


var FILE = require("file");

new FileList("**/*").exclude("Jakefile").forEach(function(aFilename)
{
if (!FILE.isFile(aFilename))
return;

var buildFilename = FILE.join($BUILD_CONFIGURATION_DIR, "CommonJS", "cappuccino", aFilename);

filedir (buildFilename, [aFilename], function ()
{
cp(aFilename, buildFilename);
});

task ("build", buildFilename);
CLOBBER.include(buildFilename);
});
8 changes: 8 additions & 0 deletions CommonJS/lib/cappuccino/jake.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// 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.BlendTask = BLEND_TASK.BlendTask;
exports.blend = BLEND_TASK.blend;
}
16 changes: 16 additions & 0 deletions CommonJS/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "cappuccino",
"dependencies": ["narwhal", "jack", "browserjs"],
"description": "Cappuccino module",
"keywords": ["objective-j", "objj", "objective j", "capp", "cappuccino"],
"author": "280 North, Inc. (http://280north.com/)",
"version": "0.7.9",
"objj-frameworks": ["Frameworks"],
"objj-debug-frameworks": ["Frameworks/Debug"],
"contributors": [
"Francisco Tolmasky (http://tolmasky.com/)",
"Ross Boucher (http://rossboucher.com/)",
"Tom Robinson (http://tlrobinson.net/)",
"Numerous others (http://contributors.cappuccino.org/)"
]
}
37 changes: 29 additions & 8 deletions Foundation/Jakefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
#!/usr/bin/env narwhal
/*
* Jakefile
* Foundation
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

require("../common.jake");


foundationTask = framework ("Foundation", function(foundationTask)
{
foundationTask.setBuildIntermediatesPath(FILE.join($BUILD_DIR, "Foundation.build", $CONFIGURATION))
foundationTask.setBuildPath(FILE.join($BUILD_DIR, $CONFIGURATION));
foundationTask.setBuildPath($BUILD_CONFIGURATION_DIR);

foundationTask.setAuthor("280 North, Inc.");
foundationTask.setEmail("feedback @nospam@ 280north.com");
foundationTask.setSummary("Foundation classes for Cappuccino");
foundationTask.setIdentifier("com.280n.Foundation");
foundationTask.setVersion("0.7.9");
foundationTask.setLicense(BundleTask.License.LGPL_v2_1);
foundationTask.setSources(new FileList("**/*.j"));//terrible!
foundationTask.setSources(new FileList("**/*.j"));
foundationTask.setResources(new FileList("Resources/**/*"));
foundationTask.setFlattensSources(true);

Expand All @@ -23,13 +44,13 @@ foundationTask = framework ("Foundation", function(foundationTask)
foundationTask.setCompilerFlags("-DDEBUG -g");
});

$COMMONJS_PRODUCT_FOUNDATION = FILE.join($COMMONJS_PRODUCT_FRAMEWORKS, "Foundation");
$BUILD_CJS_FOUNDATION = FILE.join($BUILD_CJS_CAPPUCCINO_FRAMEWORKS, "Foundation");

filedir ($COMMONJS_PRODUCT_FOUNDATION, ["Foundation"], function()
filedir ($BUILD_CJS_FOUNDATION, ["Foundation"], function()
{
cp_r(foundationTask.buildProductPath(), $COMMONJS_PRODUCT_FOUNDATION);
cp_r(foundationTask.buildProductPath(), $BUILD_CJS_FOUNDATION);
});

task ("build", ["Foundation", $COMMONJS_PRODUCT_FOUNDATION]);
task ("build", ["Foundation", $BUILD_CJS_FOUNDATION]);

CLOBBER.include($COMMONJS_PRODUCT_FOUNDATION);
CLOBBER.include($BUILD_CJS_FOUNDATION);
21 changes: 10 additions & 11 deletions Jakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var FILE = require("file"),

require(FILE.absolute("common.jake"));

var subprojects = ["Objective-J", "Foundation", "AppKit", "Tools", "External/ojunit"];
var subprojects = ["Objective-J", "CommonJS", "Foundation", "AppKit", "Tools", "External/ojunit"];

["build", "clean", "clobber"].forEach(function(aTaskName)
{
Expand All @@ -17,20 +17,19 @@ var subprojects = ["Objective-J", "Foundation", "AppKit", "Tools", "External/oju
});
});

global.$COMMONJS = FILE.join($BUILD_DIR, "Release", "CommonJS", "objective-j");
global.$COMMONJS_DEBUG_FRAMEWORKS = FILE.join($COMMONJS, "lib", "Frameworks", "Debug");
$BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS = FILE.join($BUILD_CJS_CAPPUCCINO, "Frameworks", "Debug");

filedir ($COMMONJS_DEBUG_FRAMEWORKS, ["debug", "release"], function()
filedir ($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, ["debug", "release"], function()
{
FILE.mkdirs($COMMONJS_DEBUG_FRAMEWORKS);
FILE.mkdirs($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS);

cp_r(FILE.join($BUILD_DIR, "Debug", "Objective-J"), FILE.join($COMMONJS_DEBUG_FRAMEWORKS, "Objective-J"));
cp_r(FILE.join($BUILD_DIR, "Debug", "Foundation"), FILE.join($COMMONJS_DEBUG_FRAMEWORKS, "Foundation"));
cp_r(FILE.join($BUILD_DIR, "Debug", "AppKit"), FILE.join($COMMONJS_DEBUG_FRAMEWORKS, "AppKit"));
cp_r(FILE.join($BUILD_DIR, "Debug", "BlendKit"), FILE.join($COMMONJS_DEBUG_FRAMEWORKS, "BlendKit"));
cp_r(FILE.join($BUILD_DIR, "Debug", "Objective-J"), FILE.join($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "Objective-J"));
cp_r(FILE.join($BUILD_DIR, "Debug", "Foundation"), FILE.join($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "Foundation"));
cp_r(FILE.join($BUILD_DIR, "Debug", "AppKit"), FILE.join($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "AppKit"));
cp_r(FILE.join($BUILD_DIR, "Debug", "BlendKit"), FILE.join($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "BlendKit"));
});

task ("CommonJS", [$COMMONJS_DEBUG_FRAMEWORKS, "debug", "release"], function()
task ("CommonJS", [$BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "debug", "release"], function()
{
// We have a complete CommonJS, so redo this.
setupEnvironment();
Expand All @@ -40,7 +39,7 @@ task ("install", ["CommonJS"], function()
{
// FIXME: require("narwhal/tusk/install").install({}, $COMMONJS);
// Doesn't work due to some weird this.print business.
OS.system("tusk install --force " + $COMMONJS);
OS.system("tusk install --force " + $BUILD_CJS_OBJECTIVE_J + " " + $BUILD_CJS_CAPPUCCINO);
});

// Documentation
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0c13138

Please sign in to comment.