Further cleanup.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-11-02 15:59:42 -08:00
parent ea8245a6b3
commit baa1318298
5 changed files with 39 additions and 18 deletions
-4
View File
@@ -4,10 +4,6 @@
<dict>
<key>CPBundleIdentifier</key>
<string>com.280n.AppKit</string>
<key>Default Themes Path</key>
<string>Default.cptheme</string>
<key>Default Theme Name</key>
<string>Default</string>
<key>CPBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CPBundleName</key>
+1
View File
@@ -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");
+1
View File
@@ -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");
@@ -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()
@@ -1,5 +1,5 @@
var objj = null;
print("objj loader~");
function ObjectiveJLoader() {
var loader = {};
var factories = {};