Compare commits

...
16 Commits
Author SHA1 Message Date
Tom Robinson 3e7c3e952b Merge branch '0.8.0' of github.com:280north/cappuccino into 0.8.0 2010-03-08 19:03:14 -08:00
Francisco Ryan Tolmasky I e6411d7d90 Fix for classes declared in subfolders reporting wrong bundle (fictional).
Reviewed by me.
2010-03-08 18:27:43 -08:00
Francisco Ryan Tolmasky I 9e7d0d3183 Merge branch 'master' of git@github.com:280north/cappuccino 2010-03-08 18:23:36 -08:00
Francisco Ryan Tolmasky I 3ae4b1cf19 Fix for classes declared in subfolders reporting wrong bundle (fictional).
Reviewed by me.
2010-03-08 18:22:53 -08:00
Ross Boucher 2841223c9d Create the args and namedArgs objects in Bootstrap.js, pass them along up to CPApplication. 2010-03-08 15:14:09 -08:00
Tom Robinson ba713b8b06 Use getCappuccinoVersion() in various Jakefiles instead of hardcoded versions. 2010-03-08 15:10:08 -08:00
Tom Robinson c53bff288a Add a central version.json file. Change package building to insert version, revision, and timestamp. Auto-push tags. 2010-03-08 15:10:08 -08:00
Ross Boucher d85e8798c2 Create the args and namedArgs objects in Bootstrap.js, pass them along up to CPApplication. 2010-03-08 15:00:52 -08:00
Randall Luecke 6dbb4eedb7 Merge branch 'master' of git://github.com/280north/cappuccino 2010-03-08 10:56:56 -05:00
Francisco Ryan Tolmasky I 33b4b94426 Fix for loading bundles generating multiple did load callbacks.
Reviewed by me.
2010-03-08 01:03:52 -08:00
Randall Luecke 8410198c37 Merge branch 'master' of git://github.com/280north/cappuccino 2010-03-08 00:58:28 -05:00
Randall Luecke 4c4b42833a Added -selectedColumn to the tableview. 2010-03-08 00:00:28 -05:00
Randall Luecke 519a9300e2 Merge branch 'master' of git://github.com/280north/cappuccino 2010-03-07 23:39:41 -05:00
Randall Luecke 7522751fd2 Merge branch 'master' of git://github.com/280north/cappuccino 2010-03-07 20:50:29 -05:00
Randall Luecke f2165af48f Merge branch 'master' of git://github.com/280north/cappuccino 2010-03-07 10:30:17 -05:00
Randall Luecke e3a65a1847 Added preparatory support for group items in CPOutlineView. 2010-03-06 18:46:49 -05:00
21 changed files with 255 additions and 71 deletions
+14 -30
View File
@@ -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
View File
@@ -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
+5
View File
@@ -878,6 +878,11 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
}
}
- (int)selectedColumn
{
[_selectedColumnIndexes lastIndex];
}
- (CPIndexSet)selectedColumnIndexes
{
return _selectedColumnIndexes;
+1 -1
View File
@@ -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/**/*"));
+1 -1
View File
@@ -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
View File
@@ -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"));
});
+23
View File
@@ -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)
);
}
-1
View File
@@ -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": [
+1 -1
View File
@@ -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/**/*"));
+30 -18
View File
@@ -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";
}
+30 -1
View File
@@ -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);
});
});
});
}
+58 -5
View File
@@ -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);
@@ -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();
+30 -1
View File
@@ -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);
-1
View File
@@ -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/)",
+8 -4
View File
@@ -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;
+4
View File
@@ -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
View File
@@ -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
View File
@@ -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();
+1 -1
View File
@@ -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");
+26
View File
@@ -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)
+3
View File
@@ -0,0 +1,3 @@
{
"version": "0.8.0"
}