diff --git a/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj b/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj index 0154116d1..dce859d69 100644 --- a/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj +++ b/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 68A43034191BF044008A68A7 /* help.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 68A43033191BF044008A68A7 /* help.pdf */; }; E10E4CD717298E5F004AB09E /* project.pbxproj in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2A172188F300263CE3 /* project.pbxproj */; }; E14015421740248C006C2792 /* XcodeProjectCloser.m in Sources */ = {isa = PBXBuildFile; fileRef = E14015411740248C006C2792 /* XcodeProjectCloser.m */; }; E1401543174025B8006C2792 /* XcodeProjectCloser.m in Sources */ = {isa = PBXBuildFile; fileRef = E14015411740248C006C2792 /* XcodeProjectCloser.m */; }; @@ -36,7 +37,6 @@ E171D26C173C1C8300210893 /* xcc in CopyFiles */ = {isa = PBXBuildFile; fileRef = E171D25D173C168C00210893 /* xcc */; }; E17A822D172700B90095CD83 /* XcodeCapp.iconset in Resources */ = {isa = PBXBuildFile; fileRef = E17A822C172700B90095CD83 /* XcodeCapp.iconset */; }; E17B55411732F57700809FFB /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E17B55401732F57700809FFB /* Quartz.framework */; }; - E17B55431732F72700809FFB /* help.pdf in Resources */ = {isa = PBXBuildFile; fileRef = E17B55421732F72700809FFB /* help.pdf */; }; E1A5594A172C5EE20088FB61 /* FindSourceFilesOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = E1A55949172C5EE20088FB61 /* FindSourceFilesOperation.m */; }; E1A5594D172CA8D40088FB61 /* ProcessSourceOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = E1A5594C172CA8D40088FB61 /* ProcessSourceOperation.m */; }; E1E90C411735D846005C6D5B /* DDLogLevel.m in Sources */ = {isa = PBXBuildFile; fileRef = E1E90C391735D846005C6D5B /* DDLogLevel.m */; }; @@ -106,6 +106,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 68A43033191BF044008A68A7 /* help.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = help.pdf; path = Resources/help.pdf; sourceTree = ""; }; E14015401740248C006C2792 /* XcodeProjectCloser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XcodeProjectCloser.h; sourceTree = ""; }; E14015411740248C006C2792 /* XcodeProjectCloser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XcodeProjectCloser.m; sourceTree = ""; }; E164FDCF1720E77100263CE3 /* XcodeCapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XcodeCapp.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -140,7 +141,6 @@ E171D264173C168C00210893 /* xcc-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "xcc-Prefix.pch"; sourceTree = ""; }; E17A822C172700B90095CD83 /* XcodeCapp.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = XcodeCapp.iconset; path = Resources/XcodeCapp.iconset; sourceTree = ""; }; E17B55401732F57700809FFB /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; - E17B55421732F72700809FFB /* help.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = help.pdf; path = Resources/help.pdf; sourceTree = ""; }; E1A55949172C5EE20088FB61 /* FindSourceFilesOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = FindSourceFilesOperation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; E1A5594C172CA8D40088FB61 /* ProcessSourceOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ProcessSourceOperation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; E1E90C371735D82B005C6D5B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; @@ -273,6 +273,7 @@ E164FE071720F25400263CE3 /* Resources */ = { isa = PBXGroup; children = ( + 68A43033191BF044008A68A7 /* help.pdf */, E1ED6B6F173414E100641628 /* icon_128x128.png */, E1ED6B70173414E100641628 /* icon_128x128@2x.png */, E164FE2D1721A34900263CE3 /* icon-inactive.png */, @@ -284,7 +285,6 @@ E170C3FF17298833003DC489 /* icon-error.png */, E170C40017298833003DC489 /* icon-error@2x.png */, E17A822C172700B90095CD83 /* XcodeCapp.iconset */, - E17B55421732F72700809FFB /* help.pdf */, E164FE2A172188F300263CE3 /* project.pbxproj */, E164FE191720F49A00263CE3 /* Growl Registration Ticket.growlRegDict */, ); @@ -418,6 +418,7 @@ E10E4CD717298E5F004AB09E /* project.pbxproj in Resources */, E164FE181720F44B00263CE3 /* parser.j in Resources */, E164FE1A1720F49A00263CE3 /* Growl Registration Ticket.growlRegDict in Resources */, + 68A43034191BF044008A68A7 /* help.pdf in Resources */, E164FE2F1721A34900263CE3 /* icon-active.png in Resources */, E164FE301721A34900263CE3 /* icon-inactive.png in Resources */, E164FE311721A34900263CE3 /* icon-working.png in Resources */, @@ -427,7 +428,6 @@ E170C40517298833003DC489 /* icon-error@2x.png in Resources */, E170C40617298833003DC489 /* icon-inactive@2x.png in Resources */, E170C40717298833003DC489 /* icon-working@2x.png in Resources */, - E17B55431732F72700809FFB /* help.pdf in Resources */, E1ED6B71173414E100641628 /* icon_128x128.png in Resources */, E1ED6B72173414E100641628 /* icon_128x128@2x.png in Resources */, E1E90C62173B42D0005C6D5B /* MainMenu.xib in Resources */, diff --git a/Tools/XcodeCapp/XcodeCapp/AppController.m b/Tools/XcodeCapp/XcodeCapp/AppController.m index 079c89b55..86aa8c3d7 100644 --- a/Tools/XcodeCapp/XcodeCapp/AppController.m +++ b/Tools/XcodeCapp/XcodeCapp/AppController.m @@ -147,7 +147,7 @@ AppController *SharedAppControllerInstance = nil; kDefaultXCCAutoOpenErrorsPanelOnErrors: @YES, kDefaultXCCAutoOpenErrorsPanelOnCappLint: @YES, kDefaultXCCAutoShowNotificationOnErrors: @YES, - kDefaultXCCAutoShowNotificationOnCappLint: @NO, + kDefaultXCCAutoShowNotificationOnCappLint: @YES, kDefaultXCCProjectHistory: [NSArray new], kDefaultMaxRecentProjects: @20, kDefaultLogLevel: [NSNumber numberWithInt:LOG_LEVEL_WARN], @@ -527,4 +527,11 @@ AppController *SharedAppControllerInstance = nil; self.menuItemHistory.enabled = [projectHistory count] > 0; } +#pragma mark - Cappuccino methods + +- (IBAction)updateCappuccino:(id)sender +{ + [self.xcc performSelectorInBackground:@selector(updateCappuccino) withObject:nil]; +} + @end diff --git a/Tools/XcodeCapp/XcodeCapp/Info.plist b/Tools/XcodeCapp/XcodeCapp/Info.plist index 2ac7f472c..7f59ef93d 100644 --- a/Tools/XcodeCapp/XcodeCapp/Info.plist +++ b/Tools/XcodeCapp/XcodeCapp/Info.plist @@ -2,6 +2,10 @@ + XCCLastCappuccinoReleaseURL + https://github.com/cappuccino/cappuccino/archive/0.9.7.zip + XCCLastCappuccinoMasterBranchURL + https://github.com/cappuccino/cappuccino/archive/master.zip CFBundleDevelopmentRegion English CFBundleExecutable @@ -17,11 +21,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 3.0.6 + 3.1 CFBundleSignature ???? CFBundleVersion - 3.0.6 + 3.1 LSApplicationCategoryType public.app-category.developer-tools LSUIElement diff --git a/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.pages b/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.pages deleted file mode 100644 index 73b168d3f..000000000 Binary files a/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.pages and /dev/null differ diff --git a/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.zip b/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.zip new file mode 100644 index 000000000..6d110cd89 Binary files /dev/null and b/Tools/XcodeCapp/XcodeCapp/Resources/XcodeCapp help.zip differ diff --git a/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf b/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf index 550ba1d08..d0361b49d 100644 Binary files a/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf and b/Tools/XcodeCapp/XcodeCapp/Resources/help.pdf differ diff --git a/Tools/XcodeCapp/XcodeCapp/UserDefaults.h b/Tools/XcodeCapp/XcodeCapp/UserDefaults.h index 11f71d303..a89476cd0 100644 --- a/Tools/XcodeCapp/XcodeCapp/UserDefaults.h +++ b/Tools/XcodeCapp/XcodeCapp/UserDefaults.h @@ -28,5 +28,6 @@ extern NSString * const kDefaultMaxRecentProjects; extern NSString * const kDefaultLogLevel; extern NSString * const kDefaultAutoOpenXcodeProject; extern NSString * const kDefaultUseSymlinkWhenCreatingProject; +extern NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch; #endif diff --git a/Tools/XcodeCapp/XcodeCapp/UserDefaults.m b/Tools/XcodeCapp/XcodeCapp/UserDefaults.m index 6a388b8ae..aee5793ae 100644 --- a/Tools/XcodeCapp/XcodeCapp/UserDefaults.m +++ b/Tools/XcodeCapp/XcodeCapp/UserDefaults.m @@ -26,3 +26,4 @@ NSString * const kDefaultMaxRecentProjects = @"maxRecentProjects"; NSString * const kDefaultLogLevel = @"logLevel"; NSString * const kDefaultAutoOpenXcodeProject = @"autoOpenXcodeProject"; NSString * const kDefaultUseSymlinkWhenCreatingProject = @"useSymlinkWhenCreatingProject"; +NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch = @"updateCappuccinoWithLastVersionOfMasterBranch"; diff --git a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h index 88fbac78a..09f9ae64f 100644 --- a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h +++ b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.h @@ -101,6 +101,9 @@ extern NSString * const XCCCappLintDidEndNotification; // Whether we are currently processing source files @property BOOL isProcessing; +// Whether we are currently processing source files +@property BOOL isCappuccinoUpdating; + // Whether $CAPP_BUILD is defined or not @property BOOL isCappBuildDefined; @@ -118,6 +121,10 @@ extern NSString * const XCCCappLintDidEndNotification; @property (unsafe_unretained) IBOutlet NSTableView *errorTable; @property (strong) IBOutlet NSArrayController *errorListController; +@property (strong) IBOutlet NSProgressIndicator *progressIndicator; +@property (strong) IBOutlet NSTextField *fieldCurrentTask; +@property (strong) IBOutlet NSPanel *updatingCappuccinoPanel; + - (IBAction)openErrorsPanel:(id)sender; - (IBAction)clearErrors:(id)sender; - (IBAction)openErrorInEditor:(id)sender; @@ -153,6 +160,8 @@ extern NSString * const XCCCappLintDidEndNotification; - (BOOL)checkCappLintForPath:(NSArray*)paths; - (void)showCappLintErrors; +- (void)updateCappuccino; + @end @interface XcodeCapp (SnowLeopard) diff --git a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m index 3fe93840e..36ebc6c63 100644 --- a/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m +++ b/Tools/XcodeCapp/XcodeCapp/XcodeCapp.m @@ -230,7 +230,8 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, @"/usr/local/bin", @"/usr/local/narwhal/bin", @"~/narwhal/bin", - @"~/bin" + @"~/bin", + @"/usr/bin" ]; NSMutableArray *paths = [self.environmentPaths mutableCopy]; @@ -242,8 +243,11 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, // Make sure we are using jsc as the narwhal engine! self.environment[@"NARWHAL_ENGINE"] = @"jsc"; + + // Make sure to not do something in sudo + self.environment[@"CAPP_NOSUDO"] = @"1"; - self.executables = @[@"python", @"narwhal-jsc", @"objj", @"nib2cib", @"capp", @"capp_lint"]; + self.executables = @[@"python", @"narwhal-jsc", @"objj", @"nib2cib", @"capp", @"capp_lint", @"jake", @"curl", @"unzip", @"rm"]; // This is used to get the env var of $CAPP_BUILD NSDictionary *processEnvironment = [[NSProcessInfo processInfo] environment]; @@ -1265,15 +1269,29 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, #pragma mark - Shell Helpers +/*! + Run an NSTask with the given arguments + + @param launchPath The executable to launch + @param arguments NSArray containing the NSTask arguments + @param returnType Determines whether to return stdout, stderr, either, or nothing in the response + @return NSDictionary containing the return status (NSNumber) and the response (NSString) + */ +- (NSDictionary *)runTaskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments returnType:(XCCTaskReturnType)returnType +{ + return [self runTaskWithLaunchPath:launchPath arguments:arguments returnType:returnType currentDirectoryPath:nil]; +} + /*! Run an NSTask with the given arguments @param launchPath The executable to launch @param arguments NSArray containing the NSTask arguments @param returnType Determines whether to return stdout, stderr, either, or nothing in the response + @param the currentDirectoryPath for the task @return NSDictionary containing the return status (NSNumber) and the response (NSString) */ -- (NSDictionary *)runTaskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments returnType:(XCCTaskReturnType)returnType +- (NSDictionary *)runTaskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments returnType:(XCCTaskReturnType)returnType currentDirectoryPath:(NSString*)aCurrentDirectoryPath { NSTask *task = [NSTask new]; @@ -1282,7 +1300,10 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, task.environment = self.environment; task.standardOutput = [NSPipe pipe]; task.standardError = [NSPipe pipe]; - + + if (aCurrentDirectoryPath) + task.currentDirectoryPath = aCurrentDirectoryPath; + [task launch]; DDLogVerbose(@"Task launched: %@\n%@", launchPath, arguments); @@ -1336,6 +1357,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, return YES; } + #pragma mark - Source Files Management - (BOOL)isObjjFile:(NSString *)path @@ -1843,6 +1865,231 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, [self.errorListController addObjects:errors]; } +#pragma mark - Cappuccino update + +- (void)updateCappuccino +{ + [[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidStartNotification object:self]; + + [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; + [self.updatingCappuccinoPanel makeKeyAndOrderFront:self]; + + self.isCappuccinoUpdating = YES; + + [self.progressIndicator startAnimation:self]; + [self.progressIndicator setMaxValue:4]; + [self.progressIndicator setDoubleValue:0]; + + NSString *temporaryFolder = NSTemporaryDirectory(); + + if(![self _hasInitializedUpdateCappuccinoFromFolder:temporaryFolder] || + ![self _hasCleanedInstallOfCappuccinoFromFolder:temporaryFolder] || + ![self _hasInstalledCappuccinoFromFolder:temporaryFolder]) + return; + + [self notifyUserWithTitle:@"Update Cappuccino" message:@"Updating of Cappuccino completed"]; + [self _incrementeProgressBarAndUpdateInformationFieldWithMessage:@"Updating completed"]; + [self.progressIndicator stopAnimation:self]; + self.isCappuccinoUpdating = NO; + + [[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidEndNotification object:self]; +} + +- (BOOL)_hasInitializedUpdateCappuccinoFromFolder:(NSString*)aFolder +{ + //Be sure to remove an old install + NSMutableArray *rmArguments = [NSMutableArray arrayWithObjects:@"-r", @"cappuccino", nil]; + [self runTaskWithLaunchPath:self.executablePaths[@"rm"] + arguments:rmArguments + returnType:kTaskReturnTypeAny + currentDirectoryPath:aFolder]; + + + [self _incrementeProgressBarAndUpdateInformationFieldWithMessage:@"Downloading Cappuccino"]; + + // Download the file + NSString *cappuccinoURL; + + if ([[NSUserDefaults standardUserDefaults] boolForKey:kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch]) + cappuccinoURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"XCCLastCappuccinoMasterBranchURL"]; + else + cappuccinoURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"XCCLastCappuccinoReleaseURL"]; + + NSString *destination = [NSString stringWithFormat:@"%@cappuccino.zip", aFolder]; + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"-Lk", cappuccinoURL, @"-o", destination, nil]; + NSDictionary *taskResult = [self runTaskWithLaunchPath:self.executablePaths[@"curl"] + arguments:arguments + returnType:kTaskReturnTypeStdOut]; + + NSInteger status = [taskResult[@"status"] intValue]; + + if (status > 1) + { + [self _updatingCappuccinoFailedWithMessage:@"Unable to download Cappuccino"]; + return NO; + } + + //Unzip the file + NSMutableArray *unzipArguments = [NSMutableArray arrayWithObjects:@"-u", @"-o", @"-q", @"-d", @"cappuccino", @"cappuccino.zip", nil]; + NSDictionary *unzipTaskResult = [self runTaskWithLaunchPath:self.executablePaths[@"unzip"] + arguments:unzipArguments + returnType:kTaskReturnTypeAny + currentDirectoryPath:aFolder]; + + NSInteger unzipStatus = [unzipTaskResult[@"status"] intValue]; + + if (unzipStatus >= 1) + { + DDLogVerbose(@"Unable to unzip Cappuccino"); + [self _updatingCappuccinoFailedWithMessage:@"Unable to unzip Cappuccino"]; + return NO; + } + + return YES; +} + +- (BOOL)_hasCleanedInstallOfCappuccinoFromFolder:(NSString*)aFolder +{ + NSString* path = [self _cappuccinoPathForFolder:aFolder]; + + [self _incrementeProgressBarAndUpdateInformationFieldWithMessage:@"Jake clobber"]; + + //Jake clobber + NSMutableArray *jakeClobberArguments = [NSMutableArray arrayWithObjects:@"clobber", nil]; + NSDictionary *jakeClobberTaskResult = [self runJakeTaskWithArguments:jakeClobberArguments currentDirectoryPath:path]; + + NSInteger jakeInstallStatus = [jakeClobberTaskResult[@"status"] intValue]; + + if (jakeInstallStatus == 1) + { + DDLogVerbose(@"Jake clobber failed: %@", jakeClobberTaskResult[@"response"]); + [self _updatingCappuccinoFailedWithMessage:@"Jake clobber failed"]; + return NO; + } + + return YES; +} + +- (BOOL)_hasInstalledCappuccinoFromFolder:(NSString*)aFolder +{ + NSString* path = [self _cappuccinoPathForFolder:aFolder]; + + [self _incrementeProgressBarAndUpdateInformationFieldWithMessage:@"Jake install"]; + + //Jake install + NSMutableArray *jakeInstallArguments = [NSMutableArray arrayWithObjects:@"install", nil]; + NSDictionary *jakeInstallTaskResult = [self runJakeTaskWithArguments:jakeInstallArguments currentDirectoryPath:path]; + + NSInteger jakeInstallStatus = [jakeInstallTaskResult[@"status"] intValue]; + + if (jakeInstallStatus == 1) + { + DDLogVerbose(@"Jake install failed: %@", jakeInstallTaskResult[@"response"]); + [self _updatingCappuccinoFailedWithMessage:@"Jake install failed"]; + return NO; + } + + return YES; +} + +- (NSDictionary*)runJakeTaskWithArguments:(NSMutableArray*)arguments currentDirectoryPath:(NSString*)aCurrentDirectoryPath +{ + NSString *launchPath = self.executablePaths[@"jake"]; + + NSTask *task = [NSTask new]; + + task.launchPath = launchPath; + task.arguments = arguments; + task.environment = self.environment; + task.standardOutput = [NSPipe new]; + task.standardError = [NSPipe new]; + + if (aCurrentDirectoryPath) + task.currentDirectoryPath = aCurrentDirectoryPath; + + // This is needed to log the jake + NSFileHandle* fhOut = [task.standardOutput fileHandleForReading]; + [fhOut readInBackgroundAndNotify]; + NSFileHandle* fhErr = [task.standardError fileHandleForReading]; + [fhErr readInBackgroundAndNotify]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jakeReceivedData:) name:NSFileHandleReadCompletionNotification object:fhOut]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jakeReceivedError:) name:NSFileHandleReadCompletionNotification object:fhErr]; + + [task launch]; + + DDLogVerbose(@"Task launched: %@\n%@", launchPath, arguments); + + [task waitUntilExit]; + + DDLogVerbose(@"Task exited: %@:%d", launchPath, task.terminationStatus); + + NSNumber *status = [NSNumber numberWithInt:task.terminationStatus]; + NSData *data = nil; + + if ([status intValue] == 0) + data = [[task.standardOutput fileHandleForReading] availableData]; + else + data = [[task.standardError fileHandleForReading] availableData]; + + NSString *response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadCompletionNotification object:fhOut]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadCompletionNotification object:fhErr]; + + return @{@"status" : status, @"response" : response}; +} + +-(void)jakeReceivedData:(NSNotification*)notification +{ + NSData *data = [[notification userInfo] objectForKey:NSFileHandleNotificationDataItem]; + NSString *string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; + + DDLogVerbose(@"%@", string); + + [[notification object] readInBackgroundAndNotify]; +} + +-(void)jakeReceivedError:(NSNotification*)notification +{ + NSData *data = [[notification userInfo] objectForKey:NSFileHandleNotificationDataItem]; + NSString *string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; + + DDLogVerbose(@"%@", string); +} + +/*! + This return the current path where the tmp cappuccino was downloaded + */ +- (NSString*)_cappuccinoPathForFolder:(NSString*)aFolder +{ + NSFileManager *fileManger = [NSFileManager defaultManager]; + NSString *contentOfCappuccinoFolder = [[fileManger contentsOfDirectoryAtPath:[NSString stringWithFormat:@"%@cappuccino", aFolder] error:nil] firstObject]; + + return [NSString stringWithFormat:@"%@cappuccino/%@", aFolder, contentOfCappuccinoFolder]; +} + +- (void)_incrementeProgressBarAndUpdateInformationFieldWithMessage:(NSString*)aString +{ + double currentValue = [self.progressIndicator doubleValue]; + [self.progressIndicator setDoubleValue:++currentValue]; + + [self.fieldCurrentTask setStringValue:[NSString stringWithFormat:@"Step %.0f/%.0f : %@", [self.progressIndicator doubleValue], [self.progressIndicator maxValue], aString]]; +} + +- (void)_updatingCappuccinoFailedWithMessage:(NSString*)aMessage +{ + [self.progressIndicator stopAnimation:self]; + [self.progressIndicator setDoubleValue:0]; + [self.fieldCurrentTask setStringValue:[NSString stringWithFormat:@"Issue : %@", aMessage]]; + + [self notifyUserWithTitle:@"Error updating Cappuccino" message:aMessage]; + + self.isCappuccinoUpdating = NO; + [[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidEndNotification object:self]; +} + + #pragma mark - User notifications - (NSString *)applicationNameForGrowl diff --git a/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib b/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib index 6a0ad009d..3efdd46af 100644 --- a/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib +++ b/Tools/XcodeCapp/XcodeCapp/en.lproj/MainMenu.xib @@ -2,10 +2,10 @@ 1060 - 13D43 + 13C1021 5056 - 1265.20 - 698.00 + 1265.19 + 697.40 5056 5056 @@ -22,6 +22,7 @@ NSMenuItem NSPopUpButton NSPopUpButtonCell + NSProgressIndicator NSScrollView NSScroller NSTableColumn @@ -108,7 +109,7 @@ - Verify Project Code Style + Check Project Code Style 2147483647 @@ -158,6 +159,24 @@ + + + Update Cappuccino + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + About XcodeCapp... @@ -209,28 +228,31 @@ 3 2 - {{196, 240}, {402, 202}} + {{196, 240}, {402, 247}} 1618478080 About NSPanel - + 256 268 - {{164, 20}, {203, 98}} + {{164, 20}, {203, 143}} + + YES 68157504 4326400 WGNvZGVDYXBwIDMgZGV2ZWxvcGVkIGJ5OgogICAgQXBhcmFqaXRhIEZpc2htYW4KICAgIGFwYXJhaml0 -YUBhcGFyYWppdGEuY29tCgpPcmlnaW5hbCBDb2NvYSB2ZXJzaW9uIGRldmVsb3BlZCBieToKICAgIEFu -dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA +YUBhcGFyYWppdGEuY29tCiAgICAKICAgIEFsZXhhbmRyZSBXaWxoZWxtCiAgICBhbGV4YW5kcmUud2ls +aGVsbWZyQGdtYWlsLmNvbQoKT3JpZ2luYWwgQ29jb2EgdmVyc2lvbiBkZXZlbG9wZWQgYnk6CiAgICBB +bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ .LucidaGrandeUI 11 @@ -257,8 +279,9 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 266 - {{164, 126}, {221, 74}} + {{164, 171}, {221, 74}} + YES @@ -304,8 +327,9 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{17, 63}, {128, 128}} + {{17, 108}, {128, 128}} + YES @@ -324,7 +348,9 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA YES - {402, 202} + {402, 247} + + {{0, 0}, {1440, 878}} @@ -342,7 +368,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {315, 77} - + 256 @@ -358,6 +384,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 256 {550, 201} + YES NO @@ -434,6 +461,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {{1, 1}, {550, 201}} + @@ -444,6 +472,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA -2147483392 {{1, 273}, {512, 16}} + NO 1 @@ -455,6 +484,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA -2147483392 {{535, 1}, {16, 45}} + NO @@ -463,6 +493,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {{-1, 35}, {552, 203}} + 133682 @@ -478,6 +509,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 289 {{352, 8}, {85, 19}} + {250, 750} YES @@ -506,6 +538,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 292 {{20, 8}, {85, 19}} + {250, 750} YES @@ -530,6 +563,8 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 289 {{445, 8}, {85, 19}} + + {250, 750} YES @@ -550,9 +585,11 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {550, 237} + + - {{0, 0}, {1440, 878}} + {{1440, -180}, {1920, 1058}} {315, 99} {10000000000000, 10000000000000} errorPanel @@ -561,14 +598,14 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 3 2 - {{1964, 505}, {393, 357}} + {{1964, 505}, {369, 415}} 1618478080 Preferences NSWindow - + 256 @@ -584,6 +621,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 81}, {271, 18}} + YES @@ -617,6 +655,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 51}, {241, 18}} + YES @@ -641,6 +680,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 109}, {298, 18}} + YES @@ -665,6 +705,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{15, 20}, {106, 17}} + YES @@ -684,6 +725,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{124, 14}, {56, 26}} + YES @@ -756,13 +798,15 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA NO - {{1, 1}, {357, 139}} + {{1, 1}, {330, 139}} + - {{17, 187}, {359, 155}} + {{17, 245}, {332, 155}} + {0, 0} @@ -799,6 +843,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{146, 12}, {171, 18}} + YES @@ -823,6 +868,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 39}, {126, 17}} + YES @@ -842,6 +888,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{146, 38}, {171, 18}} + YES @@ -862,13 +909,15 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA NO - {{1, 1}, {357, 66}} + {{1, 1}, {330, 66}} + - {{17, 101}, {359, 82}} + {{17, 159}, {332, 82}} + {0, 0} @@ -901,6 +950,8 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{146, 12}, {171, 18}} + + YES -2080374784 @@ -924,6 +975,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{146, 37}, {171, 18}} + YES @@ -948,6 +1000,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 268 {{16, 38}, {126, 17}} + YES @@ -963,14 +1016,16 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 1 - {{1, 1}, {357, 65}} + {{1, 1}, {333, 65}} + _NS:11 - {{17, 16}, {359, 81}} + {{17, 74}, {335, 81}} + _NS:9 {0, 0} @@ -991,11 +1046,75 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 2 NO + + + 12 + + + + 274 + + + + 268 + {{16, 12}, {226, 18}} + + + + YES + + -2080374784 + 0 + Use latest master branch version + + + 1211912448 + 2 + + + + + 400 + 75 + + NO + + + {{1, 1}, {333, 38}} + + + + + + {{17, 16}, {335, 54}} + + + + {0, 0} + + 67108864 + 134217728 + Update + + + + 3 + MCAwLjgAA + + + + 1 + 0 + 2 + NO + - {393, 357} + {369, 415} + + - {{0, 0}, {1440, 878}} + {{1440, -180}, {1920, 1058}} {10000000000000, 10000000000000} xcc-prefs YES @@ -1010,7 +1129,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA - + 256 @@ -1022,6 +1141,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {{0, 8}, {716, 654}} + YES 1 @@ -1031,6 +1151,8 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA {716, 662} + + {{0, 0}, {1440, 878}} @@ -1054,6 +1176,85 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA YES YES + + 7 + 2 + {{139, 81}, {357, 84}} + 1685586944 + Updating Cappuccino + NSPanel + + + + + 256 + + + + 268 + {{18, 22}, {251, 17}} + + + _NS:397 + {251, 750} + YES + + 68157504 + 272630784 + Step 1/5 : Downloading Cappuccino + + _NS:397 + + + + + NO + 1 + + + + 268 + {{269, 13}, {74, 32}} + + _NS:9 + YES + + 67108864 + 134217728 + Close + + _NS:9 + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + + 268 + {{20, 45}, {317, 20}} + + + _NS:9 + {250, 250} + 16397 + 5 + + + {357, 84} + + _NS:21 + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + updatingCappuccinoPanel + YES + NO @@ -1218,6 +1419,14 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 617 + + + updateCappuccino: + + + + M7T-qw-MgB + performClose: @@ -1290,6 +1499,14 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 6Xe-Bt-eXK + + + save: + + + + 30N-ga-LBo + openXcodeProject: @@ -1378,6 +1595,30 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA 748 + + + fieldCurrentTask + + + + P4O-YG-v1J + + + + progressIndicator + + + + Z7k-63-Ujv + + + + updatingCappuccinoPanel + + + + HJ3-bt-3EP + values.XCCReopenLastProject @@ -1716,21 +1957,33 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA du5-hg-MfC + + + orderOut: + + + + dP2-Fc-one + - enabled: values.usesCappLintForEveryNotifications - + value: values.updateCappuccinoWithLastVersionOfMasterBranch + - + - enabled: values.usesCappLintForEveryNotifications - enabled - values.usesCappLintForEveryNotifications + value: values.updateCappuccinoWithLastVersionOfMasterBranch + value + values.updateCappuccinoWithLastVersionOfMasterBranch + + NSValidatesImmediately + + 2 - J8w-G4-Pzy + 1fo-ym-Q0u @@ -1768,22 +2021,6 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA uwx-aq-p86 - - - enabled: values.usesCappLintForEveryNotifications - - - - - - enabled: values.usesCappLintForEveryNotifications - enabled - values.usesCappLintForEveryNotifications - 2 - - - 5nL-79-ZXW - value: values.XCCAutoOpenShowNotificationErrors @@ -1804,6 +2041,26 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA j0c-o6-KBW + + + enabled: isCappuccinoUpdating + + + + + + enabled: isCappuccinoUpdating + enabled + isCappuccinoUpdating + + NSValueTransformerName + NSNegateBoolean + + 2 + + + aof-Pn-nzf + @@ -1856,6 +2113,8 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA + + @@ -2094,6 +2353,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA + @@ -2359,6 +2619,86 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA + + M7S-MC-N7d + + + + + + + + GR3-Dn-qSe + + + + + + + + LOW-1X-7ih + + + + + om5-3M-ZoK + + + + + ubl-jf-ybu + + + + + 8BD-V9-Gcp + + + + + + + + E18-tY-KOl + + + + + + + + + + 9wn-zh-iT9 + + + + + + + + 5vI-kk-gfO + + + + + D0i-5i-RLQ + + + + + + + + KxJ-gX-jZV + + + + + o12-G8-NOm + + + @@ -2481,6 +2821,7 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2578,8 +2919,31 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + If this is checked, xCodeCapp will take the last version of Cappuccino on the master branch to install Cappuccino + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin @@ -2614,18 +2978,201 @@ dG9pbmUgTWVyY2FkYWwKICAgIGFudG9pbmUubWVyY2FkYWxAZ21haWwuY29tA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - + + + + AppController + NSObject + + id + id + id + id + id + id + id + + + + createProject: + id + + + loadProject: + id + + + openAbout: + id + + + openHelp: + id + + + openPreferences: + id + + + showInFinder: + id + + + updateCappuccino: + id + + + + NSPanel + PDFView + NSWindow + NSMenuItem + NSMenuItem + NSMenuItem + NSUserDefaultsController + NSWindow + NSMenu + XcodeCapp + + + + aboutWindow + NSPanel + + + helpView + PDFView + + + helpWindow + NSWindow + + + menuItemHistory + NSMenuItem + + + menuItemOpenProject + NSMenuItem + + + menuItemShowInFinder + NSMenuItem + + + preferencesController + NSUserDefaultsController + + + preferencesWindow + NSWindow + + + statusMenu + NSMenu + + + xcc + XcodeCapp + + + + IBProjectSource + ./Classes/AppController.h + + + + XcodeCapp + NSObject + + id + id + id + id + id + id + + + + checkProjectWithCappLint: + id + + + clearErrors: + id + + + openErrorInEditor: + id + + + openErrorsPanel: + id + + + openXcodeProject: + id + + + synchronizeProject: + id + + + + NSArrayController + NSTableView + NSPanel + NSTextField + NSProgressIndicator + NSPanel + + + + errorListController + NSArrayController + + + errorTable + NSTableView + + + errorsPanel + NSPanel + + + fieldCurrentTask + NSTextField + + + progressIndicator + NSProgressIndicator + + + updatingCappuccinoPanel + NSPanel + + + + IBProjectSource + ./Classes/XcodeCapp.h + + + + 0 IBCocoaFramework YES