From d2e39238f498999db1aaa77d6d4e11baade8b575 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Mon, 19 Sep 2011 21:42:59 -0700 Subject: [PATCH] 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 [""]. --- Jakefile | 50 +++++++++++++++++++++++++++++++++++++++----------- common.jake | 2 +- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/Jakefile b/Jakefile index 3d2b5d0aa..ebf8f9e34 100644 --- a/Jakefile +++ b/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,7 +347,7 @@ task("push-cappuccino", function() { pushPackage( $BUILD_CJS_CAPPUCCINO, "git@github.com:280north/cappuccino-package.git", - SYSTEM.env["PACKAGE_BRANCH"] + SYSTEM.env.PACKAGE_BRANCH ); }); @@ -327,7 +355,7 @@ 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")); diff --git a/common.jake b/common.jake index 12fc19caa..28c1d6e64 100644 --- a/common.jake +++ b/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));