mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Updated Application and ThemeDescriptor templates to use jake instead of rake. Also made all objective-j jake definitions accessible through cappuccino/jake as well.
Reviewed by me.
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
|
||||
|
||||
var FILE = require("file"),
|
||||
Jake = require("jake"),
|
||||
task = require("jake").task,
|
||||
filedir = require("jake").filedir,
|
||||
BundleTask = require("objective-j/jake/bundletask").BundleTask;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
|
||||
|
||||
var FILE = require("file");
|
||||
|
||||
function exposeExports(path)
|
||||
{
|
||||
var object = require(path);
|
||||
|
||||
for (var name in object)
|
||||
if (object.hasOwnProperty(name))
|
||||
exports[name] = object[name];
|
||||
}
|
||||
|
||||
exposeExports("objective-j/jake");
|
||||
|
||||
// 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")))
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
task = require("jake").task,
|
||||
FileList = require("jake").FileList,
|
||||
app = require("objective-j/jake").app,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug";
|
||||
|
||||
app ("__project.nameasidentifier__", function(task)
|
||||
@@ -21,12 +21,13 @@ app ("__project.nameasidentifier__", function(task)
|
||||
task.setProductName("__project.name__");
|
||||
task.setIdentifier("__project.identifier__");
|
||||
task.setVersion("1.0");
|
||||
// t.author = '__organization.name__'
|
||||
// t.email = '__organization.email__'
|
||||
// t.summary = '__project.name__'
|
||||
task.setSources(new FileList("*.j"));
|
||||
task.setAuthor("__organization.name__");
|
||||
task.setEmail("__organization.email__");
|
||||
task.setSummary("__project.name__");
|
||||
task.setSources(new FileList("**/*.j"));
|
||||
task.setResources(new FileList("Resources/*"));
|
||||
// t.info_plist = 'Info.plist'
|
||||
task.setIndexFilePath("index.html");
|
||||
task.setInfoPlistPath("Info.plist");
|
||||
|
||||
if (configuration === "Debug")
|
||||
task.setCompilerFlags("-DDEBUG -g");
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
require 'objective-j'
|
||||
require 'objective-j/bundletask'
|
||||
|
||||
if !ENV['CONFIG']
|
||||
ENV['CONFIG'] = 'Debug'
|
||||
end
|
||||
|
||||
ObjectiveJ::BundleTask.new(:__project.nameasidentifier__) do |t|
|
||||
t.name = '__project.name__'
|
||||
t.identifier = '__project.identifier__'
|
||||
t.version = '1.0'
|
||||
t.author = '__organization.name__'
|
||||
t.email = '__organization.email__'
|
||||
t.summary = '__project.name__'
|
||||
t.sources = FileList['*.j']
|
||||
t.resources = FileList['Resources/*']
|
||||
t.index_file = 'index.html'
|
||||
t.info_plist = 'Info.plist'
|
||||
t.build_path = File.join('Build', ENV['CONFIG'], '__project.nameasidentifier__')
|
||||
t.flag = '-DDEBUG' if ENV['CONFIG'] == 'Debug'
|
||||
t.flag = '-O' if ENV['CONFIG'] == 'Release'
|
||||
end
|
||||
|
||||
task :default => [:__project.nameasidentifier__]
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* __project.name__
|
||||
*
|
||||
* Created by __user.name__ on __project.date__.
|
||||
* Copyright __project.year__, __organization.name__ All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
task = require("jake").task,
|
||||
FileList = require("jake").FileList,
|
||||
blend = require("cappuccino/jake").blend,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug";
|
||||
|
||||
|
||||
blend ("__project.nameasidentifier__.blend", function(__project.nameasidentifier__Task)
|
||||
{
|
||||
__project.nameasidentifier__Task.setBuildIntermediatesPath(FILE.join("Build", "__project.nameasidentifier__.build", configuration))
|
||||
__project.nameasidentifier__Task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
__project.nameasidentifier__Task.setThemeDescriptors(new FileList("ThemeDescriptors.j"));
|
||||
__project.nameasidentifier__Task.setPlatforms([BundleTask.Platform.Browser, BundleTask.Platform.CommonJS]);
|
||||
__project.nameasidentifier__Task.setIdentifier("com.280n.__project.identifier__");
|
||||
__project.nameasidentifier__Task.setResources(new FileList("Resources/*"));
|
||||
});
|
||||
|
||||
task ("build", ["__project.nameasidentifier__.blend"]);
|
||||
task ("default", ["build"]);
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
require 'objective-j'
|
||||
require 'objective-j/bundletask'
|
||||
|
||||
if !ENV['CONFIG']
|
||||
ENV['CONFIG'] = 'Debug'
|
||||
end
|
||||
|
||||
$BLEND_PRODUCT = File.join('Build', ENV['CONFIG'], '__project.nameasidentifier__.blend');
|
||||
|
||||
file_d $BLEND_PRODUCT => ['ThemeDescriptors.j'] do
|
||||
File.popen("blend -d ThemeDescriptors.j -o #{$BLEND_PRODUCT} -R Resources") do |blend|
|
||||
blend.sync = true
|
||||
|
||||
while str = blend.gets
|
||||
puts str
|
||||
end
|
||||
end
|
||||
rake abort if ($? != 0)
|
||||
end
|
||||
|
||||
task :default => [$BLEND_PRODUCT]
|
||||
Reference in New Issue
Block a user