diff --git a/AppKit/Themes/CommonJS/blendtask.j b/AppKit/Themes/CommonJS/blendtask.j index f943381db..ec852c43b 100644 --- a/AppKit/Themes/CommonJS/blendtask.j +++ b/AppKit/Themes/CommonJS/blendtask.j @@ -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; diff --git a/CommonJS/lib/cappuccino/jake.js b/CommonJS/lib/cappuccino/jake.js index adfcee5fd..0bc3655e4 100644 --- a/CommonJS/lib/cappuccino/jake.js +++ b/CommonJS/lib/cappuccino/jake.js @@ -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"))) { diff --git a/Tools/capp/Resources/Templates/Application/Jakefile b/Tools/capp/Resources/Templates/Application/Jakefile index 44ceb5d54..f86662da2 100644 --- a/Tools/capp/Resources/Templates/Application/Jakefile +++ b/Tools/capp/Resources/Templates/Application/Jakefile @@ -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"); diff --git a/Tools/capp/Resources/Templates/Application/Rakefile b/Tools/capp/Resources/Templates/Application/Rakefile deleted file mode 100644 index 4b319769e..000000000 --- a/Tools/capp/Resources/Templates/Application/Rakefile +++ /dev/null @@ -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__] diff --git a/Tools/capp/Resources/Templates/ThemeDescriptor/Jakefile b/Tools/capp/Resources/Templates/ThemeDescriptor/Jakefile new file mode 100644 index 000000000..1ab841188 --- /dev/null +++ b/Tools/capp/Resources/Templates/ThemeDescriptor/Jakefile @@ -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"]); diff --git a/Tools/capp/Resources/Templates/ThemeDescriptor/Rakefile b/Tools/capp/Resources/Templates/ThemeDescriptor/Rakefile deleted file mode 100644 index 9421af8e1..000000000 --- a/Tools/capp/Resources/Templates/ThemeDescriptor/Rakefile +++ /dev/null @@ -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]