Browse files

Jakefile improvements...

- 'jake clean' now cleans instead of clobbers.
- Added task 'clean-sprites', cleans sprited images.
- Added task 'clobber-theme', clobbers all traces of Aristo.
- Added missing semicolons, followed JavaScript lint suggestions for using dot notation instead of [""].
  • Loading branch information...
1 parent 4aec3f7 commit d2e39238f498999db1aaa77d6d4e11baade8b575 @aparajita aparajita committed Sep 20, 2011
Showing with 40 additions and 12 deletions.
  1. +39 −11 Jakefile
  2. +1 −1 common.jake
View
50 Jakefile
@@ -59,7 +59,7 @@ task ("sudo-install", ["CommonJS"], function()
if (OS.system(["sudo", "tusk", "install", "--force", $BUILD_CJS_OBJECTIVE_J, $BUILD_CJS_CAPPUCCINO]))
{
// Attempt a hackish work-around for sudo compiled with the --with-secure-path option
- sudo("tusk install --force " + $BUILD_CJS_OBJECTIVE_J + " " + $BUILD_CJS_CAPPUCCINO)
+ sudo("tusk install --force " + $BUILD_CJS_OBJECTIVE_J + " " + $BUILD_CJS_CAPPUCCINO);
}
});
@@ -71,10 +71,38 @@ task ("install-symlinks", function()
task ("install-debug-symlinks", function()
{
- SYSTEM.env["CONFIG"] = "Debug";
+ SYSTEM.env.CONFIG = "Debug";
spawnJake("install-symlinks");
});
+task ("clean-sprites", function()
+{
+ var f = new FileList(FILE.join(SYSTEM.env.CAPP_BUILD, "**/dataURLs.txt")),
+ paths = f.items();
+
+ f = new FileList(FILE.join(SYSTEM.env.CAPP_BUILD, "**/MHTML*.txt"));
+ paths = paths.concat(f.items());
+
+ paths.forEach(function(path)
+ {
+ FILE.remove(path);
+ });
+});
+
+task ("clobber-theme", function()
+{
+ var f = new FileList(FILE.join(SYSTEM.env.CAPP_BUILD, "**/Aristo.blend")),
+ paths = f.items();
+
+ f = new FileList(FILE.join(SYSTEM.env.CAPP_BUILD, "Aristo.build"));
+ paths = paths.concat(f.items());
+
+ paths.forEach(function(path)
+ {
+ rm_rf(path);
+ });
+});
+
// Documentation
$DOCUMENTATION_BUILD = FILE.join($BUILD_DIR, "Documentation");
@@ -251,30 +279,30 @@ task ("demos", function()
if (key)
return this._plist.valueForKey(key);
return this._plist;
- }
+ };
Demo.prototype.name = function()
{
return this.plist("CPBundleName");
- }
+ };
Demo.prototype.path = function()
{
return this._path;
- }
+ };
Demo.prototype.excluded = function()
{
return !!this.plist("CPDemoExcluded");
- }
+ };
Demo.prototype.toString = function()
{
return this.name();
- }
+ };
FILE.glob(FILE.join(demosDir, "demos", "**/Info.plist")).map(function(demoPath){
- return new Demo(FILE.dirname(demoPath))
+ return new Demo(FILE.dirname(demoPath));
}).filter(function(demo){
return !demo.excluded();
}).forEach(function(demo)
@@ -319,15 +347,15 @@ task("push-cappuccino", function() {
pushPackage(
$BUILD_CJS_CAPPUCCINO,
"git@github.com:280north/cappuccino-package.git",
- SYSTEM.env["PACKAGE_BRANCH"]
+ SYSTEM.env.PACKAGE_BRANCH
);
});
task("push-objective-j", function() {
pushPackage(
$BUILD_CJS_OBJECTIVE_J,
"git@github.com:280north/objective-j-package.git",
- SYSTEM.env["PACKAGE_BRANCH"]
+ SYSTEM.env.PACKAGE_BRANCH
);
});
@@ -365,7 +393,7 @@ function pushPackage(path, remote, branch)
var pkg = JSON.parse(packagePath.join("package.json").read({ charset : "UTF-8" }));
- stream.print(" Version: " + colorize(pkg["version"], "purple"));
+ stream.print(" Version: " + colorize(pkg.version, "purple"));
stream.print(" Revision: " + colorize(pkg["cappuccino-revision"], "purple"));
stream.print(" Timestamp: " + colorize(pkg["cappuccino-timestamp"], "purple"));
View
2 common.jake
@@ -133,7 +133,7 @@ global.$BUILD_CJS_CAPPUCCINO_FRAMEWORKS = FILE.join($BUILD_CJS_CAPPUCCINO, "Fram
global.CLEAN = require("jake/clean").CLEAN;
global.CLOBBER = require("jake/clean").CLOBBER;
-global.CLEAN.include(global.$BUILD_DIR);
+global.CLEAN.include(FILE.join(global.$BUILD_DIR, "*.build"));
global.CLOBBER.include(global.$BUILD_DIR);
global.$HOME_DIR = FILE.absolute(FILE.dirname(module.path));

0 comments on commit d2e3923

Please sign in to comment.