mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-10 04:37:11 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e7c3e952b | ||
|
|
e6411d7d90 | ||
|
|
9e7d0d3183 | ||
|
|
3ae4b1cf19 | ||
|
|
2841223c9d | ||
|
|
ba713b8b06 | ||
|
|
c53bff288a | ||
|
|
d85e8798c2 | ||
|
|
6dbb4eedb7 | ||
|
|
33b4b94426 | ||
|
|
3fc99095e2 | ||
|
|
8410198c37 | ||
|
|
d1b325052d | ||
|
|
4c4b42833a | ||
|
|
519a9300e2 | ||
|
|
7522751fd2 | ||
|
|
f2165af48f | ||
|
|
e3a65a1847 |
+14
-30
@@ -973,10 +973,9 @@ CPRunContinuesResponse = -1002;
|
||||
[self endSheet:sheet returnCode:0];
|
||||
}
|
||||
|
||||
|
||||
- (CPArray)arguments
|
||||
{
|
||||
if(_fullArgsString != window.location.hash)
|
||||
if(_fullArgsString !== window.location.hash)
|
||||
[self _reloadArguments];
|
||||
|
||||
return _args;
|
||||
@@ -1009,12 +1008,18 @@ CPRunContinuesResponse = -1002;
|
||||
- (void)_reloadArguments
|
||||
{
|
||||
_fullArgsString = window.location.hash;
|
||||
var args = _fullArgsString.replace("#", "").split("/").slice(0);
|
||||
|
||||
for(var i=0, count = args.length; i<count; i++)
|
||||
args[i] = decodeURIComponent(args[i]);
|
||||
|
||||
_args = args;
|
||||
if (_fullArgsString.length)
|
||||
{
|
||||
var args = _fullArgsString.substring(1).split("/");
|
||||
|
||||
for (var i = 0, count = args.length; i < count; i++)
|
||||
args[i] = decodeURIComponent(args[i]);
|
||||
|
||||
_args = args;
|
||||
}
|
||||
else
|
||||
_args = [];
|
||||
}
|
||||
|
||||
- (CPDictionary)namedArguments
|
||||
@@ -1143,29 +1148,8 @@ function CPApplicationMain(args, namedArgs)
|
||||
|
||||
[principalClass sharedApplication];
|
||||
|
||||
//FIXME?
|
||||
if (!args)
|
||||
{
|
||||
var args = [CPApp arguments];
|
||||
|
||||
if([args containsObject:"debug"])
|
||||
CPLogRegister(CPLogPopup);
|
||||
}
|
||||
|
||||
if (!namedArgs)
|
||||
{
|
||||
var searchParams = window.location.search.substring(1).split("&");
|
||||
namedArgs = [CPDictionary dictionary];
|
||||
|
||||
for(var i=0; i<searchParams.length; i++)
|
||||
{
|
||||
var index = searchParams[i].indexOf('=');
|
||||
if(index == -1)
|
||||
[namedArgs setObject: "" forKey:searchParams[i]];
|
||||
else
|
||||
[namedArgs setObject: searchParams[i].substring(index+1) forKey: searchParams[i].substring(0, index)];
|
||||
}
|
||||
}
|
||||
if ([args containsObject:"debug"])
|
||||
CPLogRegister(CPLogPopup);
|
||||
|
||||
CPApp._args = args;
|
||||
CPApp._namedArgs = namedArgs;
|
||||
|
||||
+13
-3
@@ -52,9 +52,10 @@ var CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_
|
||||
|
||||
|
||||
var CPOutlineViewDelegate_outlineView_dataViewForTableColumn_item_ = 1 << 1,
|
||||
CPOutlineViewDelegate_outlineView_shouldSelectItem_ = 1 << 2;
|
||||
CPOutlineViewDelegate_outlineView_shouldSelectItem_ = 1 << 2,
|
||||
CPOutlineViewDelegate_outlineView_heightOfRowByItem_ = 1 << 3,
|
||||
CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_ = 1 << 4;
|
||||
CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_ = 1 << 4,
|
||||
CPOutlineViewDelegate_outlineView_isGroupItem_ = 1 << 5;
|
||||
|
||||
CPOutlineViewDropOnItemIndex = -1;
|
||||
|
||||
@@ -468,7 +469,10 @@ CPOutlineViewDropOnItemIndex = -1;
|
||||
|
||||
if ([_outlineViewDelegate respondsToSelector:@selector(outlineView:willDisplayView:forTableColumn:item:)])
|
||||
_implementedOutlineViewDelegateMethods |= CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_;
|
||||
|
||||
|
||||
if ([_outlineViewDelegate respondsToSelector:@selector(outlineView:isGroupItem:)])
|
||||
_implementedOutlineViewDelegateMethods |= CPOutlineViewDelegate_outlineView_isGroupItem_;
|
||||
|
||||
if ([_outlineViewDelegate respondsToSelector:@selector(outlineViewColumnDidMove:)])
|
||||
[defaultCenter
|
||||
addObserver:_outlineViewDelegate
|
||||
@@ -1020,7 +1024,13 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(CPTableView)aTableView isGroupRow:(int)row
|
||||
{
|
||||
if ((_outlineView._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_isGroupItem_))
|
||||
return [_outlineView._outlineViewDelegate outlineView:_outlineView isGroupItem:[_outlineView itemAtRow:theRow]];
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -878,6 +878,11 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
}
|
||||
}
|
||||
|
||||
- (int)selectedColumn
|
||||
{
|
||||
[_selectedColumnIndexes lastIndex];
|
||||
}
|
||||
|
||||
- (CPIndexSet)selectedColumnIndexes
|
||||
{
|
||||
return _selectedColumnIndexes;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ appKitTask = framework ("AppKit", function(appKitTask)
|
||||
appKitTask.setEmail("feedback @nospam@ 280north.com");
|
||||
appKitTask.setSummary("AppKit classes for Cappuccino");
|
||||
appKitTask.setIdentifier("com.280n.AppKit");
|
||||
appKitTask.setVersion("0.8.0");
|
||||
appKitTask.setVersion(getCappuccinoVersion());
|
||||
appKitTask.setLicense(BundleTask.License.LGPL_v2_1);
|
||||
appKitTask.setSources(AppKitFiles);
|
||||
appKitTask.setResources(new FileList("Resources/**/*"));
|
||||
|
||||
@@ -10,7 +10,7 @@ blendKitTask = framework ("BlendKit", function(blendKitTask)
|
||||
blendKitTask.setBuildPath(FILE.join($BUILD_DIR, $CONFIGURATION));
|
||||
|
||||
blendKitTask.setIdentifier("com.280n.BlendKit");
|
||||
blendKitTask.setVersion("0.8.0");
|
||||
blendKitTask.setVersion(getCappuccinoVersion());
|
||||
blendKitTask.setAuthor("280 North, Inc.");
|
||||
blendKitTask.setEmail("feedback @nospam@ 280north.com");
|
||||
blendKitTask.setSummary("BlendKit classes for Cappuccino");
|
||||
|
||||
+5
-1
@@ -8,7 +8,7 @@ new FileList("**/*").exclude("Jakefile").forEach(function(aFilename)
|
||||
if (!FILE.isFile(aFilename))
|
||||
return;
|
||||
|
||||
var buildFilename = FILE.join($BUILD_CONFIGURATION_DIR, "CommonJS", "cappuccino", aFilename);
|
||||
var buildFilename = FILE.join($BUILD_CJS_CAPPUCCINO, aFilename);
|
||||
|
||||
filedir (buildFilename, [aFilename], function ()
|
||||
{
|
||||
@@ -27,3 +27,7 @@ new FileList("**/*").exclude("Jakefile").forEach(function(aFilename)
|
||||
task ("build", buildFilename);
|
||||
CLOBBER.include(buildFilename);
|
||||
});
|
||||
|
||||
task ("build", function() {
|
||||
setPackageMetadata(FILE.join($BUILD_CJS_CAPPUCCINO, "package.json"));
|
||||
});
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
var FILE = require("file");
|
||||
var sprintf = require("printf").sprintf;
|
||||
|
||||
var pkg = null;
|
||||
function getPackage() {
|
||||
if (!pkg)
|
||||
pkg = JSON.parse(FILE.path(module.path).dirname().dirname().join("package.json").read({ charset : "UTF-8" }));
|
||||
return pkg;
|
||||
}
|
||||
|
||||
exports.version = function() { return getPackage()["version"]; }
|
||||
exports.revision = function() { return getPackage()["cappuccino-revision"]; }
|
||||
exports.timestamp = function() { return new Date(getPackage()["cappuccino-timestamp"]); }
|
||||
|
||||
exports.fullVersionString = function() {
|
||||
return sprintf("cappuccino %s (%04d-%02d-%02d %s)",
|
||||
exports.version(),
|
||||
exports.timestamp().getUTCFullYear(),
|
||||
exports.timestamp().getUTCMonth()+1,
|
||||
exports.timestamp().getUTCDate(),
|
||||
exports.revision().slice(0,6)
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,6 @@
|
||||
"description": "Cappuccino module",
|
||||
"keywords": ["objective-j", "objj", "objective j", "capp", "cappuccino"],
|
||||
"author": "280 North, Inc. (http://280north.com/)",
|
||||
"version": "0.8.0",
|
||||
"objj-frameworks": ["Frameworks"],
|
||||
"objj-debug-frameworks": ["Frameworks/Debug"],
|
||||
"contributors": [
|
||||
|
||||
@@ -465,7 +465,7 @@ var _CPKeyedUnarchiverDecodeObjectAtIndex = function(self, anIndex)
|
||||
|
||||
self._plistObject = savedPlistObject;
|
||||
|
||||
if (processedObject != object)
|
||||
if (processedObject !== object)
|
||||
{
|
||||
if (self._delegateSelectors & _CPKeyedUnarchiverWillReplaceObjectWithObjectSelector)
|
||||
[self._delegate unarchiver:self willReplaceObject:object withObject:processedObject];
|
||||
@@ -519,7 +519,7 @@ var _CPKeyedUnarchiverDecodeObjectAtIndex = function(self, anIndex)
|
||||
|
||||
// If this object is a member of _CPKeyedArchiverValue, then we know
|
||||
// that it is a wrapper for a primitive JavaScript object.
|
||||
if (object.isa === _CPKeyedArchiverValueClass)
|
||||
if (object && (object.isa === _CPKeyedArchiverValueClass))
|
||||
object = [object JSObject];
|
||||
|
||||
return object;
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ foundationTask = framework ("Foundation", function(foundationTask)
|
||||
foundationTask.setEmail("feedback @nospam@ 280north.com");
|
||||
foundationTask.setSummary("Foundation classes for Cappuccino");
|
||||
foundationTask.setIdentifier("com.280n.Foundation");
|
||||
foundationTask.setVersion("0.8.0");
|
||||
foundationTask.setVersion(getCappuccinoVersion());
|
||||
foundationTask.setLicense(BundleTask.License.LGPL_v2_1);
|
||||
foundationTask.setSources(new FileList("**/*.j"));
|
||||
foundationTask.setResources(new FileList("Resources/**/*"));
|
||||
|
||||
@@ -280,21 +280,23 @@ task("push-objective-j", function() {
|
||||
function pushPackage(path, remote, branch)
|
||||
{
|
||||
branch = branch || "master";
|
||||
|
||||
|
||||
var pushPackagesPath = FILE.path(".push-package")
|
||||
|
||||
pushPackagesPath.mkdirs();
|
||||
|
||||
var packagePath = pushPackagesPath.join(remote.replace(/[^\w]/g, "_"));
|
||||
|
||||
stream.print("Pushing \0blue(" + path + "\0) to "+branch+" of \0blue(" + remote + "\0)");
|
||||
|
||||
FILE.mkdirs(".push-package");
|
||||
|
||||
var pushPackageDir = FILE.join(".push-package", remote.replace(/[^\w]/g, "_"));
|
||||
|
||||
if (FILE.exists(pushPackageDir))
|
||||
OS.system(buildCmd([["cd", pushPackageDir], ["git", "fetch"]]));
|
||||
if (packagePath.isDirectory())
|
||||
OS.system(buildCmd([["cd", packagePath], ["git", "fetch"]]));
|
||||
else
|
||||
OS.system(["git", "clone", remote, pushPackageDir]);
|
||||
OS.system(["git", "clone", remote, packagePath]);
|
||||
|
||||
if (OS.system(buildCmd([["cd", pushPackageDir], ["git", "checkout", "origin/"+branch]]))) {
|
||||
if (OS.system(buildCmd([["cd", packagePath], ["git", "checkout", "origin/"+branch]]))) {
|
||||
if (OS.system(buildCmd([
|
||||
["cd", pushPackageDir],
|
||||
["cd", packagePath],
|
||||
["git", "symbolic-ref", "HEAD", "refs/heads/"+branch],
|
||||
["rm", ".git/index"],
|
||||
["git", "clean", "-fdx"]
|
||||
@@ -302,20 +304,30 @@ function pushPackage(path, remote, branch)
|
||||
throw "pushPackage failed";
|
||||
}
|
||||
|
||||
if (OS.system("cd "+OS.enquote(pushPackageDir)+" && git rm --ignore-unmatch -r * && rm -rf *"))
|
||||
if (OS.system("cd "+OS.enquote(packagePath)+" && git rm --ignore-unmatch -r * && rm -rf *"))
|
||||
throw "pushPackage failed";
|
||||
if (OS.system("cp -R "+OS.enquote(path)+"/* "+OS.enquote(pushPackageDir)+"/."))
|
||||
if (OS.system("cp -R "+OS.enquote(path)+"/* "+OS.enquote(packagePath)+"/."))
|
||||
throw "pushPackage failed";
|
||||
|
||||
OS.system(buildCmd([
|
||||
["cd", pushPackageDir],
|
||||
var pkg = JSON.parse(packagePath.join("package.json").read({ charset : "UTF-8" }));
|
||||
|
||||
stream.print(" Version: \0purple(" + pkg["version"] + "\0)");
|
||||
stream.print(" Revision: \0purple(" + pkg["cappuccino-revision"] + "\0)");
|
||||
stream.print(" Timestamp: \0purple(" + pkg["cappuccino-timestamp"] + "\0)");
|
||||
|
||||
var cmd = [
|
||||
["cd", packagePath],
|
||||
["git", "add", "."],
|
||||
["git", "commit", "-m", "Pushed on " + new Date()]
|
||||
]));
|
||||
["git", "commit", "-m", "version="+pkg.version+"; revision="+pkg["cappuccino-revision"]+"; timestamp="+pkg["cappuccino-timestamp"]+";"]
|
||||
];
|
||||
if (pkg["cappuccino-revision"])
|
||||
cmd.push(["git", "tag", "rev-"+pkg["cappuccino-revision"].slice(0,6)]);
|
||||
|
||||
OS.system(buildCmd(cmd));
|
||||
|
||||
if (OS.system(buildCmd([
|
||||
["cd", pushPackageDir],
|
||||
["git", "push", "origin", "HEAD:"+branch]
|
||||
["cd", packagePath],
|
||||
["git", "push", "--tags", "origin", "HEAD:"+branch]
|
||||
])))
|
||||
throw "pushPackage failed";
|
||||
}
|
||||
|
||||
@@ -81,7 +81,36 @@ function resolveMainBundleURL()
|
||||
Executable.fileImporterForURL(mainBundleURL)(mainFileURL.lastPathComponent(), YES, function()
|
||||
{
|
||||
disableCFURLCaching();
|
||||
afterDocumentLoad(main);
|
||||
afterDocumentLoad(function()
|
||||
{
|
||||
var hashString = window.location.hash.substring(1),
|
||||
args = [];
|
||||
|
||||
if (hashString.length)
|
||||
{
|
||||
args = hashString.split("/");
|
||||
for (var i = 0, count = args.length; i < count; i++)
|
||||
args[i] = decodeURIComponent(args[i]);
|
||||
}
|
||||
|
||||
var namedArgsArray = window.location.search.substring(1).split("&"),
|
||||
namedArgs = new CFMutableDictionary();
|
||||
|
||||
for (var i = 0, count = namedArgsArray.length; i < count; i++)
|
||||
{
|
||||
var thisArg = namedArgsArray[i].split("=");
|
||||
|
||||
if (!thisArg[0])
|
||||
continue;
|
||||
|
||||
if (thisArg[1] == null)
|
||||
thisArg[1] = true;
|
||||
|
||||
namedArgs.setValueForKey(decodeURIComponent(thisArg[0]), decodeURIComponent(thisArg[1]));
|
||||
}
|
||||
|
||||
main(args, namedArgs);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
+60
-7
@@ -49,6 +49,7 @@ GLOBAL(CFBundle) = function(/*CFURL|String*/ aURL)
|
||||
this._resourcesDirectoryURL = new CFURL("Resources/", aURL);
|
||||
|
||||
this._staticResource = NULL;
|
||||
this._isValid = NO;
|
||||
|
||||
this._loadStatus = CFBundleUnloaded;
|
||||
this._loadRequests = [];
|
||||
@@ -58,34 +59,47 @@ GLOBAL(CFBundle) = function(/*CFURL|String*/ aURL)
|
||||
this._eventDispatcher = new EventDispatcher(this);
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle);
|
||||
|
||||
CFBundle.environments = function()
|
||||
{
|
||||
// Passed in by GCC.
|
||||
return ENVIRONMENTS;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.environments);
|
||||
|
||||
CFBundle.bundleContainingURL = function(/*CFURL|String*/ aURL)
|
||||
{
|
||||
aURL = new CFURL(".", makeAbsoluteURL(aURL));
|
||||
|
||||
while (aURL.path() !== "/")
|
||||
{
|
||||
var bundle = CFBundlesForURLStrings[aURL.absoluteString()];
|
||||
var previousURLString,
|
||||
URLString = aURL.absoluteString();
|
||||
|
||||
if (bundle)
|
||||
while (!previousURLString || previousURLString !== URLString)
|
||||
{
|
||||
var bundle = CFBundlesForURLStrings[URLString];
|
||||
|
||||
if (bundle && bundle._isValid)
|
||||
return bundle;
|
||||
|
||||
aURL = new CFURL("..", aURL);
|
||||
previousURLString = URLString;
|
||||
URLString = aURL.absoluteString();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.bundleContainingURL);
|
||||
|
||||
CFBundle.mainBundle = function()
|
||||
{
|
||||
return new CFBundle(mainBundleURL);
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.mainBundle);
|
||||
|
||||
function addClassToBundle(aClass, aBundle)
|
||||
{
|
||||
if (aBundle)
|
||||
@@ -97,16 +111,22 @@ CFBundle.bundleForClass = function(/*Class*/ aClass)
|
||||
return CFBundlesForClasses[aClass.name] || CFBundle.mainBundle();
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.bundleForClass);
|
||||
|
||||
CFBundle.prototype.bundleURL = function()
|
||||
{
|
||||
return this._bundleURL;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.bundleURL);
|
||||
|
||||
CFBundle.prototype.resourcesDirectoryURL = function()
|
||||
{
|
||||
return this._resourcesDirectoryURL;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.resourcesDirectoryURL);
|
||||
|
||||
CFBundle.prototype.resourceURL = function(/*String*/ aResourceName, /*String*/ aType, /*String*/ aSubDirectory)
|
||||
{
|
||||
if (aType)
|
||||
@@ -120,6 +140,8 @@ CFBundle.prototype.resourceURL = function(/*String*/ aResourceName, /*String*/ a
|
||||
return resourceURL.absoluteURL();
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.resourceURL);
|
||||
|
||||
CFBundle.prototype.mostEligibleEnvironmentURL = function()
|
||||
{
|
||||
if (this._mostEligibleEnvironmentURL === undefined)
|
||||
@@ -128,6 +150,8 @@ CFBundle.prototype.mostEligibleEnvironmentURL = function()
|
||||
return this._mostEligibleEnvironmentURL;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.mostEligibleEnvironmentURL);
|
||||
|
||||
CFBundle.prototype.executableURL = function()
|
||||
{
|
||||
if (this._executableURL === undefined)
|
||||
@@ -143,16 +167,22 @@ CFBundle.prototype.executableURL = function()
|
||||
return this._executableURL;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.executableURL);
|
||||
|
||||
CFBundle.prototype.infoDictionary = function()
|
||||
{
|
||||
return this._infoDictionary;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.infoDictionary);
|
||||
|
||||
CFBundle.prototype.valueForInfoDictionaryKey = function(/*String*/ aKey)
|
||||
{
|
||||
return this._infoDictionary.valueForKey(aKey);
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.valueForInfoDictionaryKey);
|
||||
|
||||
CFBundle.prototype.hasSpritedImages = function()
|
||||
{
|
||||
var environments = this._infoDictionary.valueForKey("CPBundleEnvironmentsWithImageSprites") || [],
|
||||
@@ -166,11 +196,15 @@ CFBundle.prototype.hasSpritedImages = function()
|
||||
return NO;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.hasSpritedImages);
|
||||
|
||||
CFBundle.prototype.environments = function()
|
||||
{
|
||||
return this._infoDictionary.valueForKey("CPBundleEnvironments") || ["ObjJ"];
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.environments);
|
||||
|
||||
CFBundle.prototype.mostEligibleEnvironment = function(/*Array*/ environments)
|
||||
{
|
||||
environments = environments || this.environments();
|
||||
@@ -194,11 +228,15 @@ CFBundle.prototype.mostEligibleEnvironment = function(/*Array*/ environments)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.mostEligibleEnvironment);
|
||||
|
||||
CFBundle.prototype.isLoading = function()
|
||||
{
|
||||
return this._loadStatus & CFBundleLoading;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.isLoading);
|
||||
|
||||
CFBundle.prototype.load = function(/*BOOL*/ shouldExecute)
|
||||
{
|
||||
if (this._loadStatus !== CFBundleUnloaded)
|
||||
@@ -223,7 +261,13 @@ CFBundle.prototype.load = function(/*BOOL*/ shouldExecute)
|
||||
function onsuccess(/*Event*/ anEvent)
|
||||
{
|
||||
self._loadStatus &= ~CFBundleLoadingInfoPlist;
|
||||
self._infoDictionary = anEvent.request.responsePropertyList();
|
||||
|
||||
var infoDictionary = anEvent.request.responsePropertyList();
|
||||
|
||||
self._isValid = !!infoDictionary || CFBundle.mainBundle() === self;
|
||||
|
||||
if (infoDictionary)
|
||||
self._infoDictionary = infoDictionary;
|
||||
|
||||
if (!self._infoDictionary)
|
||||
{
|
||||
@@ -240,6 +284,7 @@ CFBundle.prototype.load = function(/*BOOL*/ shouldExecute)
|
||||
|
||||
function onfailure()
|
||||
{
|
||||
self._isValid = CFBundle.mainBundle() === self;
|
||||
self._loadStatus = CFBundleUnloaded;
|
||||
|
||||
finishBundleLoadingWithError(self, new Error("Could not load bundle at \"" + self.bundleURL() + "\""));
|
||||
@@ -249,6 +294,8 @@ CFBundle.prototype.load = function(/*BOOL*/ shouldExecute)
|
||||
});
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.load);
|
||||
|
||||
function finishBundleLoadingWithError(/*CFBundle*/ aBundle, /*Event*/ anError)
|
||||
{
|
||||
resolveStaticResource(aBundle._staticResource);
|
||||
@@ -514,11 +561,11 @@ function executeBundle(/*Bundle*/ aBundle, /*Function*/ aCallback)
|
||||
|
||||
else
|
||||
{
|
||||
executable.addEventListener("dependenciesload", function()
|
||||
executable.loadFileDependencies(function()
|
||||
{
|
||||
executeStaticResources(index);
|
||||
});
|
||||
executable.loadFileDependencies();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -615,16 +662,22 @@ CFBundle.prototype.addEventListener = function(/*String*/ anEventName, /*Functio
|
||||
this._eventDispatcher.addEventListener(anEventName, anEventListener);
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.addEventListener);
|
||||
|
||||
CFBundle.prototype.removeEventListener = function(/*String*/ anEventName, /*Function*/ anEventListener)
|
||||
{
|
||||
this._eventDispatcher.removeEventListener(anEventName, anEventListener);
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.removeEventListener);
|
||||
|
||||
CFBundle.prototype.onerror = function(/*Event*/ anEvent)
|
||||
{
|
||||
throw anEvent.error;
|
||||
}
|
||||
|
||||
DISPLAY_NAME(CFBundle.prototype.onerror);
|
||||
|
||||
CFBundle.prototype.bundlePath = function()
|
||||
{
|
||||
return this._bundleURL.absoluteURL().path();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
var FILE = require("file");
|
||||
var sprintf = require("printf").sprintf;
|
||||
|
||||
var window = exports.window = require("browser/window");
|
||||
|
||||
if (system.engine === "rhino")
|
||||
@@ -7,7 +9,7 @@ if (system.engine === "rhino")
|
||||
window.__parent__ = null;
|
||||
window.__proto__ = global;
|
||||
}
|
||||
|
||||
|
||||
// setup OBJJ_HOME, OBJJ_INCLUDE_PATHS, etc
|
||||
window.OBJJ_HOME = exports.OBJJ_HOME = FILE.resolve(module.path, "..");
|
||||
|
||||
@@ -77,6 +79,12 @@ exports.run = function(args)
|
||||
// copy the args since we're going to modify them
|
||||
var argv = args.slice(1);
|
||||
|
||||
if (argv[0] === "--version")
|
||||
{
|
||||
print(exports.fullVersionString());
|
||||
return;
|
||||
}
|
||||
|
||||
while (argv.length && argv[0].indexOf('-I') === 0)
|
||||
OBJJ_INCLUDE_PATHS.unshift.apply(OBJJ_INCLUDE_PATHS, argv.shift().substr(2).split(':'));
|
||||
}
|
||||
@@ -178,5 +186,26 @@ exports.make_narwhal_factory = function(path)
|
||||
|
||||
} // end "with"
|
||||
|
||||
var pkg = null;
|
||||
function getPackage() {
|
||||
if (!pkg)
|
||||
pkg = JSON.parse(FILE.path(module.path).dirname().dirname().join("package.json").read({ charset : "UTF-8" }));
|
||||
return pkg;
|
||||
}
|
||||
|
||||
exports.version = function() { return getPackage()["version"]; }
|
||||
exports.revision = function() { return getPackage()["cappuccino-revision"]; }
|
||||
exports.timestamp = function() { return new Date(getPackage()["cappuccino-timestamp"]); }
|
||||
|
||||
exports.fullVersionString = function() {
|
||||
return sprintf("objective-j %s (%04d-%02d-%02d %s)",
|
||||
exports.version(),
|
||||
exports.timestamp().getUTCFullYear(),
|
||||
exports.timestamp().getUTCMonth()+1,
|
||||
exports.timestamp().getUTCDate(),
|
||||
exports.revision().slice(0,6)
|
||||
);
|
||||
}
|
||||
|
||||
if (require.main == module.id)
|
||||
exports.run(system.args);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
"description": "Objective-J and Cappuccino module",
|
||||
"keywords": ["objective-j", "objj", "objective j", "cappuccino"],
|
||||
"author": "280 North, Inc. (http://280north.com/)",
|
||||
"version": "0.8.0",
|
||||
"contributors": [
|
||||
"Francisco Tolmasky (http://tolmasky.com/)",
|
||||
"Ross Boucher (http://rossboucher.com/)",
|
||||
|
||||
@@ -137,6 +137,7 @@ Executable.prototype.execute = function()
|
||||
#endif
|
||||
var oldContextBundle = CONTEXT_BUNDLE;
|
||||
|
||||
// FIXME: Should we have stored this?
|
||||
CONTEXT_BUNDLE = CFBundle.bundleContainingURL(this.URL());
|
||||
|
||||
var result = this._function.apply(global, this.functionArguments());
|
||||
@@ -280,15 +281,18 @@ function fileExecutableSearchFinished(/*FileExecutable*/ aFileExecutable)
|
||||
|
||||
function fileExecutableDependencyLoadFinished()
|
||||
{
|
||||
var index = 0,
|
||||
count = fileDependencyExecutables.length;
|
||||
var executables = fileDependencyExecutables,
|
||||
index = 0,
|
||||
count = executables.length;
|
||||
|
||||
fileDependencyExecutables = [];
|
||||
|
||||
for (; index < count; ++index)
|
||||
fileDependencyExecutables[index]._fileDependencyStatus = ExecutableLoadedFileDependencies;
|
||||
executables[index]._fileDependencyStatus = ExecutableLoadedFileDependencies;
|
||||
|
||||
for (index = 0; index < count; ++index)
|
||||
{
|
||||
var executable = fileDependencyExecutables[index],
|
||||
var executable = executables[index],
|
||||
callbacks = executable._fileDependencyCallbacks,
|
||||
callbackIndex = 0,
|
||||
callbackCount = callbacks.length;
|
||||
|
||||
@@ -87,6 +87,10 @@ new FileList("CommonJS/**/*").forEach(function(aFilename)
|
||||
CLOBBER.include(buildFilename);
|
||||
});
|
||||
|
||||
task ("build", function() {
|
||||
setPackageMetadata(FILE.join($BUILD_CJS_OBJECTIVE_J, "package.json"));
|
||||
});
|
||||
|
||||
$BUILD_CJS_OBJECTIVE_J_FRAMEWORK = FILE.join($BUILD_CJS_OBJECTIVE_J, "Frameworks", "Objective-J");
|
||||
|
||||
filedir($BUILD_CJS_OBJECTIVE_J_FRAMEWORK, function()
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ app ("capp", function(cappTask)
|
||||
cappTask.setSummary("Setup up Cappuccino projects");
|
||||
cappTask.setIdentifier("com.280n.capp");
|
||||
cappTask.setLicense(BundleTask.License.LGPL_v2_1);
|
||||
cappTask.setVersion("0.8.0");
|
||||
cappTask.setVersion(getCappuccinoVersion());
|
||||
cappTask.setSources(new FileList("*.j"));
|
||||
cappTask.setResources(new FileList("Resources/*"));
|
||||
cappTask.setIncludesNibsAndXibs(true);
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ function main(args)
|
||||
switch (argument)
|
||||
{
|
||||
case "version":
|
||||
case "--version": return print("capp version 0.8.0");
|
||||
case "--version": return print(require("cappuccino").fullVersionString());
|
||||
|
||||
case "-h":
|
||||
case "--help": return printUsage();
|
||||
|
||||
@@ -13,7 +13,7 @@ app ("nib2cib", function(nib2cibTask)
|
||||
|
||||
nib2cibTask.setIdentifier("com.280n.nib2cib");
|
||||
nib2cibTask.setLicense(BundleTask.License.LGPL_v2_1);
|
||||
nib2cibTask.setVersion("0.8.0");
|
||||
nib2cibTask.setVersion(getCappuccinoVersion());
|
||||
nib2cibTask.setAuthor("280 North, Inc.");
|
||||
nib2cibTask.setEmail("feedback @nospam@ 280north.com");
|
||||
nib2cibTask.setSummary("nib2cib converts Cocoa nib and xibs to Cappuccino cibs");
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <Foundation/CPData.j>
|
||||
@import <AppKit/CPColor.j>
|
||||
@import <AppKit/CPData.j>
|
||||
|
||||
|
||||
var NSUnknownColorSpaceModel = -1,
|
||||
NSGrayColorSpaceModel = 0,
|
||||
|
||||
+26
@@ -2,6 +2,7 @@ var SYSTEM = require("system");
|
||||
var FILE = require("file");
|
||||
var OS = require("os");
|
||||
var UTIL = require("util");
|
||||
var stream = require("term").stream;
|
||||
|
||||
var requiresSudo = false;
|
||||
|
||||
@@ -288,6 +289,31 @@ global.symlink_executable = function(source)
|
||||
FILE.symlink(relative, destination);
|
||||
}
|
||||
|
||||
global.getCappuccinoVersion = function() {
|
||||
var versionFile = FILE.path(module.path).dirname().join("version.json");
|
||||
return JSON.parse(versionFile.read({ charset : "UTF-8" })).version;
|
||||
}
|
||||
|
||||
global.setPackageMetadata = function(packagePath) {
|
||||
var pkg = JSON.parse(FILE.read(packagePath, { charset : "UTF-8" }));
|
||||
|
||||
var p = OS.popen(["git", "rev-parse", "--verify", "HEAD"]);
|
||||
if (p.wait() === 0) {
|
||||
var sha = p.stdout.read().split("\n")[0];
|
||||
if (sha.length === 40)
|
||||
pkg["cappuccino-revision"] = sha;
|
||||
}
|
||||
|
||||
pkg["cappuccino-timestamp"] = new Date().getTime();
|
||||
pkg["version"] = getCappuccinoVersion();
|
||||
|
||||
stream.print(" Version: \0purple(" + pkg["version"] + "\0)");
|
||||
stream.print(" Revision: \0purple(" + pkg["cappuccino-revision"] + "\0)");
|
||||
stream.print(" Timestamp: \0purple(" + pkg["cappuccino-timestamp"] + "\0)");
|
||||
|
||||
FILE.write(packagePath, JSON.stringify(pkg, null, 4), { charset : "UTF-8" });
|
||||
}
|
||||
|
||||
global.subtasks = function(subprojects, taskNames)
|
||||
{
|
||||
taskNames.forEach(function(aTaskName)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"version": "0.8.0"
|
||||
}
|
||||
Reference in New Issue
Block a user