Skip to content

Instantly share code, notes, and snippets.

@gorenje
Created February 3, 2011 10:35
Show Gist options
  • Save gorenje/809327 to your computer and use it in GitHub Desktop.
Save gorenje/809327 to your computer and use it in GitHub Desktop.
Jake extensions
var XibsToConvert = ["FlickrWindow", "FacebookWindow", "TwitterWindow",
"YouTubeWindow", "LinkTEProperties", "HighlightTEProperties",
"ImageTEProperties", "TwitterFeedTEProperties","TextTEProperties"];
task( "nibs", function()
{
// Tried using JAKE.file but that didn't not want to work with subdirectories,
// i.e. Resources/
for ( var idx = 0; idx < XibsToConvert.length; idx++ ) {
var filenameXib = "Resources/../Xibs/" + XibsToConvert[idx] + ".xib";
var filenameCib = "Resources/" + XibsToConvert[idx] + ".cib";
if ( !FILE.exists(filenameCib) || FILE.mtime(filenameXib) > FILE.mtime(filenameCib) ) {
print("Converting to cib: " + filenameXib);
OS.system(["nib2cib", filenameXib, filenameCib]);
} else {
print("Ignoring " + filenameXib + " -> has been converted");
}
}
});
task("test", function()
{
print("============> WARNING");
print("Ensure that test filenames are the same as the class that is defined");
print("E.g. TweetTest.j for TweetTest and not tweet_test.j (i.e. rails style)");
print("Otherwise you'll get a strange error: >>objj [warn]: unable to get tests<<");
print("============> END WARNING");
var tests = new FileList('Test/**/*Test.j');
var moretests = new FileList('Test/**/*_test.j');
var cmd = ["ojtest"].concat(tests.items()).concat(moretests.items());
//print( cmd.map(OS.enquote).join(" ") );
var cmdString = cmd.map(OS.enquote).join(" ");
var code = OS.system(cmdString);
if (code !== 0)
OS.exit(code);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment