Created
August 3, 2010 07:56
-
-
Save saikat/506023 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Jakefile | |
* Mockingbird | |
* | |
* Created by Saikat Chakrabarti on March 16, 2010. | |
* Copyright 2010, gomockingbird.com All rights reserved. | |
*/ | |
var ENV = require("system").env, | |
FILE = require("file"), | |
JAKE = require("jake"), | |
task = JAKE.task, | |
FileList = JAKE.FileList, | |
app = require("cappuccino/jake").app, | |
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug", | |
OS = require("os"); | |
app ("Mockingbird", function(task) | |
{ | |
task.setBuildIntermediatesPath(FILE.join("Build", "Mockingbird.build", configuration)); | |
task.setBuildPath(FILE.join("Build", configuration)); | |
task.setProductName("Mockingbird"); | |
task.setIdentifier("com.gomockingbird.Mockingbird"); | |
task.setVersion("1.0"); | |
task.setAuthor("Saikat Chakrabarti and Sheena Pakanati"); | |
task.setEmail("contact @nospam@ gomockingbird.com"); | |
task.setSummary("Mockingbird"); | |
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**"))); | |
task.setResources(new FileList("Resources/*")); | |
task.setIndexFilePath("index.html"); | |
task.setInfoPlistPath("Info.plist"); | |
if (configuration === "Debug") | |
task.setCompilerFlags("-DDEBUG -g"); | |
else | |
task.setCompilerFlags("-O"); | |
}); | |
function printResults(configuration) | |
{ | |
print("----------------------------") | |
print(configuration+" app built at path: "+FILE.join("Build", configuration, "Mockingbird")); | |
print("----------------------------") | |
} | |
task ("default", ["Mockingbird"], function() | |
{ | |
printResults(configuration); | |
}); | |
task ("build", ["default"]); | |
task ("debug", function() | |
{ | |
ENV["CONFIGURATION"] = "Debug"; | |
JAKE.subjake(["."], "build", ENV); | |
}); | |
task ("release", function() | |
{ | |
ENV["CONFIGURATION"] = "Release"; | |
JAKE.subjake(["."], "build", ENV); | |
}); | |
task ("run", ["debug"], function() | |
{ | |
OS.system(["open", FILE.join("Build", "Debug", "Mockingbird", "index.html")]); | |
}); | |
task ("run-release", ["release"], function() | |
{ | |
OS.system(["open", FILE.join("Build", "Release", "Mockingbird", "index.html")]); | |
}); | |
task ("deploy", ["release"], function() | |
{ | |
FILE.mkdirs(FILE.join("Build", "Deployment", "Mockingbird")); | |
OS.system(["press", "-f", FILE.join("Build", "Release", "Mockingbird"), FILE.join("Build", "Deployment", "Mockingbird")]); | |
printResults("Deployment") | |
}); | |
task ("press", ["release"], function() | |
{ | |
FILE.mkdirs(FILE.join("Build", "Press", "Mockingbird")); | |
OS.system(["press", "-f", FILE.join("Build", "Release", "Mockingbird"), FILE.join("Build", "Press", "Mockingbird")]); | |
}); | |
task ("flatten", ["press"], function() | |
{ | |
FILE.mkdirs(FILE.join("Build", "Flatten", "Mockingbird")); | |
OS.system(["flatten", "-f", "--verbose", "--split", "3", "-c", "closure-compiler", FILE.join("Build", "Press", "Mockingbird"), FILE.join("Build", "Flatten", "Mockingbird")]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment