Compare commits

...
9 Commits
5 changed files with 76 additions and 74 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ Getting Started
---------------
To get started, download and install the current release version of Cappuccino:
$ curl https://raw.github.com/cappuccino/cappuccino/0.9.2a/bootstrap.sh >/tmp/cappuccino_bootstrap.sh && sh /tmp/cappuccino_bootstrap.sh
$ curl https://raw.github.com/cappuccino/cappuccino/v0.9.5/bootstrap.sh >/tmp/cappuccino_bootstrap.sh && sh /tmp/cappuccino_bootstrap.sh
If you'd just like to get started using Cappuccino for your web apps, you are done.
+1 -1
View File
@@ -43,7 +43,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
NSString *path = [[(NSArray *)eventPaths objectAtIndex:i] stringByStandardizingPath];
if (useFileBasedListening)
{
{
if (flags & kFSEventStreamEventFlagItemIsFile &&
flags & kFSEventStreamEventFlagItemRemoved)
{
+72 -70
View File
@@ -68,7 +68,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
[self setSupportFileLevelAPI:versionMajor >= 10 && versionMinor >= 7];
// Uncomment to simulate 10.6 mode
[self setSupportFileLevelAPI:NO];
// [self setSupportFileLevelAPI:NO];
[self configure];
@@ -277,11 +277,14 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
*/
- (void)handleFileModification:(NSString*)fullPath notify:(BOOL)shouldNotify
{
if (![self isXIBFile:fullPath] && ![self isObjJFile:fullPath] && ![self isXCCIgnoreFile:fullPath])
return;
if ([self isPathMatchingIgnoredPaths:fullPath] || ![fm fileExistsAtPath:fullPath])
return;
DLog(@"Parsing modified file: %@", fullPath);
NSArray *arguments = nil;
NSString *successTitle = nil;
NSString *successMsg = nil;
@@ -292,58 +295,54 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
DLog(@"Shadow path: %@", shadowPath);
if ([self isXIBFile:fullPath] || [self isObjJFile:fullPath] || [self isXCCIgnoreFile:fullPath])
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStartNotification object:self];
if ([self isXIBFile:fullPath])
{
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStartNotification object:self];
if ([self isXIBFile:fullPath])
{
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; nib2cib '%@';) 2>&1", profilePath, fullPath],@"",nil];
successTitle = @"XIB converted";
successMsg = splitPath;
}
else if ([self isObjJFile:fullPath])
{
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; objj '%@' '%@' '%@';) 2>&1", profilePath, parserPath, fullPath, shadowPath],@"",nil];
successTitle = @"Objective-J source processed";
successMsg = splitPath;
}
else if ([self isXCCIgnoreFile:fullPath])
{
[self computeIgnoredPaths];
successTitle = @".xcodecapp-ignore processed";
successMsg = @"Ignored files list updated";
arguments = nil;
}
// Run the task and get the response if needed
if (arguments)
{
DLog(@"Running task...");
NSArray *statusInfo = [self runTask:arguments];
status = [statusInfo objectAtIndex:0];
response = [statusInfo objectAtIndex:1];
DLog(@"Task result/response: %@/%@", status, response);
}
if ([status intValue] == 0 && shouldNotify)
{
[delegate performSelector:@selector(growlWithTitle:message:) withObject:successTitle withObject:successMsg];
}
else if (![status intValue] == 0)
{
if (response)
[errorList addObject:response];
[delegate performSelector:@selector(growlWithTitle:message:) withObject:@"Error processing file" withObject:splitPath];
}
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStopNotification object:self];
DLog(@"Processed: %@", fullPath);
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; nib2cib '%@';) 2>&1", profilePath, fullPath],@"",nil];
successTitle = @"XIB converted";
successMsg = splitPath;
}
else if ([self isObjJFile:fullPath])
{
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; objj '%@' '%@' '%@';) 2>&1", profilePath, parserPath, fullPath, shadowPath],@"",nil];
successTitle = @"Objective-J source processed";
successMsg = splitPath;
}
else if ([self isXCCIgnoreFile:fullPath])
{
[self computeIgnoredPaths];
successTitle = @".xcodecapp-ignore processed";
successMsg = @"Ignored files list updated";
arguments = nil;
}
// Run the task and get the response if needed
if (arguments)
{
DLog(@"Running task...");
NSArray *statusInfo = [self runTask:arguments];
status = [statusInfo objectAtIndex:0];
response = [statusInfo objectAtIndex:1];
DLog(@"Task result/response: %@/%@", status, response);
}
if ([status intValue] == 0 && shouldNotify)
{
[delegate performSelector:@selector(growlWithTitle:message:) withObject:successTitle withObject:successMsg];
}
else if (![status intValue] == 0)
{
if (response)
[errorList addObject:response];
[delegate performSelector:@selector(growlWithTitle:message:) withObject:@"Error processing file" withObject:splitPath];
}
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStopNotification object:self];
DLog(@"Processed: %@", fullPath);
}
/*!
@@ -443,7 +442,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
[PBXContent writeToFile:XCodeSupportPBXPath atomically:YES encoding:NSUTF8StringEncoding error:nil];
DLog(@"PBX file adapted to the project");
DLog(@"Creating source folder");
DLog(@"Creating source folder %@", [XCodeSupportProjectSources path]);
[fm createDirectoryAtPath:[XCodeSupportProjectSources path] withIntermediateDirectories:YES attributes:nil error:nil];
return NO;
}
@@ -471,11 +470,10 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
BOOL isDir = NO;
[fm fileExistsAtPath:filePath isDirectory:&isDir];
if (isDir
|| (![self isXIBFile:filePath] && ![self isObjJFile:filePath]))
if (isDir || (![self isXIBFile:filePath] && ![self isObjJFile:filePath]))
continue;
NSURL *eventualShadow = [self shadowURLForSourceURL:[NSURL URLWithString:filePath]];
NSURL *eventualShadow = [self shadowURLForSourceURL:[NSURL fileURLWithPath:filePath]];
if (![fm fileExistsAtPath:[eventualShadow path]])
{
@@ -539,7 +537,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
options:0
range:NSMakeRange(0, [unshadowedPath length])];
return [NSURL URLWithString:[NSString stringWithString:unshadowedPath]];
return [NSURL fileURLWithPath:[NSString stringWithString:unshadowedPath]];
}
@@ -585,31 +583,35 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
{
if ([ignoredPath length] == 0)
continue;
NSMutableString *regexp = [NSMutableString stringWithFormat:@"%@/%@", [currentProjectURL path], ignoredPath];
NSMutableString *regexp = [ignoredPath mutableCopy];
[regexp replaceOccurrencesOfString:@"/"
withString:@"\\/"
options:0
range:NSMakeRange(0, [regexp length])];
[regexp replaceOccurrencesOfString:@"."
withString:@"\\."
options:0
range:NSMakeRange(0, [regexp length])];
[regexp replaceOccurrencesOfString:@"*"
withString:@".*"
options:0
range:NSMakeRange(0, [regexp length])];
[regexp replaceOccurrencesOfString:@" "
withString:@"\\ "
options:0
range:NSMakeRange(0, [regexp length])];
NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexp];
if ([regextest evaluateWithObject:aPath])
{
return YES;
}
}
return NO;
}
@@ -621,8 +623,8 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
{
NSMutableString *tempName = [NSMutableString stringWithString:[path lastPathComponent]];
currentProjectURL = [NSURL URLWithString:path];
currentProjectURL = [NSURL fileURLWithPath:path];
[tempName replaceOccurrencesOfString:@" "
withString:@"_"
options:NSCaseInsensitiveSearch
@@ -654,7 +656,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
{
NSString *unshadowed = [[self sourceURLForShadowName:subpath] path];
NSString *shadowFullPath = [NSString stringWithFormat:@"%@/%@", [XCodeSupportProjectSources path], subpath];
if (![fm fileExistsAtPath:unshadowed])
{
DLog(@"cleaning shadow file: %@", subpath);
+1 -1
View File
@@ -139,7 +139,7 @@ install_directory=""
tmp_zip="/tmp/cappuccino.zip"
github_user="cappuccino"
github_ref="0.9.2"
github_ref="0.9.5"
noprompt=""
install_capp=""
+1 -1
View File
@@ -1,3 +1,3 @@
{
"version": "0.9.2"
"version": "0.9.5"
}