diff --git a/AppKit/Info.plist b/AppKit/Info.plist index c06c96b61..ed261efba 100644 --- a/AppKit/Info.plist +++ b/AppKit/Info.plist @@ -4,10 +4,6 @@ CPBundleIdentifier com.280n.AppKit - Default Themes Path - Default.cptheme - Default Theme Name - Default CPBundleInfoDictionaryVersion 6.0 CPBundleName diff --git a/AppKit/Jakefile b/AppKit/Jakefile index b9ba16bd1..52a6c43be 100644 --- a/AppKit/Jakefile +++ b/AppKit/Jakefile @@ -21,6 +21,7 @@ appKitTask = framework ("AppKit", function(appKitTask) appKitTask.setResources(new FileList("Resources/**/*")); appKitTask.setPlatforms([BundleTask.Platform.Browser, BundleTask.Platform.CommonJS]); appKitTask.setFlattensSources(true); + appKitTask.setInfoPlistPath("Info.plist"); if ($CONFIGURATION === "Release") appKitTask.setCompilerFlags("-O"); diff --git a/Foundation/Jakefile b/Foundation/Jakefile index 37f3c8b70..479b7b34c 100644 --- a/Foundation/Jakefile +++ b/Foundation/Jakefile @@ -37,6 +37,7 @@ foundationTask = framework ("Foundation", function(foundationTask) foundationTask.setSources(new FileList("**/*.j")); foundationTask.setResources(new FileList("Resources/**/*")); foundationTask.setFlattensSources(true); + foundationTask.setInfoPlistPath("Info.plist"); if ($CONFIGURATION === "Release") foundationTask.setCompilerFlags("-O"); diff --git a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js index c9811a2c1..e5bcc56df 100644 --- a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js +++ b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js @@ -37,6 +37,9 @@ function BundleTask(aName, anApplication) this._replacedFiles = { }; this._nib2cibFlags = null; + + this._infoPlistPath = null; + this._principalClass = null; } BundleTask.__proto__ = Task; @@ -176,6 +179,26 @@ BundleTask.prototype.productName = function() return this._productName; } +BundleTask.prototype.setInfoPlistPath = function(anInfoPlistPath) +{ + this._infoPlistPath = anInfoPlistPath; +} + +BundleTask.prototype.infoPlistPath = function() +{ + return this._infoPlistPath; +} + +BundleTask.prototype.setPrincipalClass = function(aPrincipalClass) +{ + this._principalClass = aPrincipalClass; +} + +BundleTask.prototype.principalClass = function() +{ + return this._principalClass; +} + BundleTask.prototype.setCompilerFlags = function(flags) { this._compilerFlags = flags; @@ -272,9 +295,15 @@ BundleTask.prototype.packageType = function() BundleTask.prototype.infoPlist = function() { - var objj_dictionary = require("objective-j").objj_dictionary, - infoPlist = new objj_dictionary(); + var infoPlistPath = this.infoPlistPath(), + objj_dictionary = require("objective-j").objj_dictionary; + if (infoPlistPath) + var infoPlist = require("objective-j/plist").readPlist(infoPlistPath); + else + var infoPlist = new objj_dictionary(); + + // FIXME: Should all of these unconditionally overwrite? infoPlist.setValue("CPBundleInfoDictionaryVersion", 6.0); infoPlist.setValue("CPBundleName", this.productName()); infoPlist.setValue("CPBundleIdentifier", this.identifier()); @@ -283,6 +312,11 @@ BundleTask.prototype.infoPlist = function() infoPlist.setValue("CPBundlePlatforms", this.platforms()); infoPlist.setValue("CPBundleExecutable", this.productName() + ".sj"); + var principalClass = this.principalClass(); + + if (principalClass) + infoPlist.setValue("CPPrincipalClass", principalClass); + var replacedFiles = this._replacedFiles, replacedFilesDictionary = new objj_dictionary(); @@ -293,17 +327,6 @@ BundleTask.prototype.infoPlist = function() infoPlist.setValue("CPBundleReplacedFiles", replacedFilesDictionary); return infoPlist; -/* - - if info_plist - existing_info_plist = Plist::parse_xml(info_plist) - new_info_plist = new_info_plist.merge existing_info_plist - file_d info_plist_path => [info_plist] - end - - if principal_class - new_info_plist['CPPrincipalClass'] = principal_class - end*/ } BundleTask.prototype.defineInfoPlistTask = function() diff --git a/Objective-J/CommonJS/lib/objective-j/loader.js b/Objective-J/CommonJS/lib/objective-j/loader.js index 07f9ea745..75855370c 100644 --- a/Objective-J/CommonJS/lib/objective-j/loader.js +++ b/Objective-J/CommonJS/lib/objective-j/loader.js @@ -1,5 +1,5 @@ var objj = null; -print("objj loader~"); + function ObjectiveJLoader() { var loader = {}; var factories = {};