From fc5f1a24a553fbcb9970e00888ab3e6a67b8ad66 Mon Sep 17 00:00:00 2001 From: Chintan Prajapati Date: Thu, 9 Jul 2015 12:40:47 +0530 Subject: [PATCH 1/2] Resolved : https://github.com/Galeas/CocoaPodUI/issues/27 Added Xcode 6.3.2 GUID --- CocoaPodUI/CocoaPodUI-Info.plist | 1 + CocoaPodUI/Controllers/CreatePodController.m | 2 +- .../PodsManagementViewController.m | 47 +++++++++++++------ .../PodsManagementViewController.xib | 8 ++-- 4 files changed, 39 insertions(+), 19 deletions(-) diff --git a/CocoaPodUI/CocoaPodUI-Info.plist b/CocoaPodUI/CocoaPodUI-Info.plist index a0dab97..17d8fbd 100644 --- a/CocoaPodUI/CocoaPodUI-Info.plist +++ b/CocoaPodUI/CocoaPodUI-Info.plist @@ -24,6 +24,7 @@ 1 DVTPlugInCompatibilityUUIDs + E969541F-E6F9-4D25-8158-72DC3545A6C6 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 9F75337B-21B4-4ADC-B558-F9CADF7073A7 992275C1-432A-4CF7-B659-D84ED6D42D3F diff --git a/CocoaPodUI/Controllers/CreatePodController.m b/CocoaPodUI/Controllers/CreatePodController.m index 5adc7d0..b59f156 100644 --- a/CocoaPodUI/Controllers/CreatePodController.m +++ b/CocoaPodUI/Controllers/CreatePodController.m @@ -72,7 +72,7 @@ - (void)setPlatformName:(NSString *)platformName - (NSArray *)versions { if ([self.platformName isEqualToString:@"iOS"]) { - return @[@"4.3", @"5.0", @"6.0", @"7.0"]; + return @[@"4.3", @"5.0", @"6.0", @"7.0", @"8.0", @"9.0"]; } else { return @[@"10.5", @"10.6", @"10.7", @"10.8", @"10.9"]; diff --git a/CocoaPodUI/Controllers/PodsManagementViewController.m b/CocoaPodUI/Controllers/PodsManagementViewController.m index fde6597..f6e8795 100644 --- a/CocoaPodUI/Controllers/PodsManagementViewController.m +++ b/CocoaPodUI/Controllers/PodsManagementViewController.m @@ -650,18 +650,12 @@ - (void)installTask:(PodTask)type completion:(void(^)(BOOL, NSError*))success __weak typeof(self) weakSelf = self; __block NSError *error = nil; - __block BOOL successFlag = YES; + id logView = self.enableConsoleOutput ? [self logView:nil] : nil; [output setReadabilityHandler:^(NSFileHandle *fileHandler) { NSData *data = [fileHandler availableData]; // this will read to EOF, so call only once NSString *text = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; - if ([text rangeOfString:@"[!] From now on use"].location == NSNotFound || [text rangeOfString:@"Integrating client project"].location == NSNotFound) { - NSRange possibleErrorRange = [text rangeOfString:@"[!] "]; - if (possibleErrorRange.location != NSNotFound) { - error = [NSError errorWithDomain:@"error::CocoaPodUI" code:666 userInfo:@{@"reason":[text substringFromIndex:NSMaxRange(possibleErrorRange)]}]; - successFlag = NO; - } - } + NSString *logString = [NSString stringWithFormat:@"\n%@", text]; [weakSelf.overlayController performSelectorOnMainThread:@selector(appendText:) withObject:logString waitUntilDone:YES]; if (logView) { @@ -681,13 +675,13 @@ - (void)installTask:(PodTask)type completion:(void(^)(BOOL, NSError*))success } }]; - [installTask setTerminationHandler:^(NSTask *task) { - DLog(@"COCOAPODUI::INSTALLATION TERMINATION HANDLER"); - if (success != nil) { - DLog(@"COCOAPODUI::WILL_PERFORM_INSTALSUCCESS_BLOCK"); - success(successFlag, error); - } - }]; +// [installTask setTerminationHandler:^(NSTask *task) { +// DLog(@"COCOAPODUI::INSTALLATION TERMINATION HANDLER"); +// if (success != nil) { +// DLog(@"COCOAPODUI::WILL_PERFORM_INSTALSUCCESS_BLOCK"); +// success(successFlag, error); +// } +// }]; NSMutableDictionary * environment = [[[NSProcessInfo processInfo] environment] mutableCopy]; environment[@"LC_ALL"]=@"en_US.UTF-8"; @@ -701,6 +695,29 @@ - (void)installTask:(PodTask)type completion:(void(^)(BOOL, NSError*))success } [installTask waitUntilExit]; + + int status = [installTask terminationStatus]; + + if (status == 0) { + if (success != nil) { + DLog(@"COCOAPODUI::WILL_PERFORM_INSTALSUCCESS_BLOCK"); + success(YES, error); + } + } + else { + NSData *data = [output availableData]; // this will read to EOF, so call only once + NSString *text = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; + NSRange possibleErrorRange = [text rangeOfString:@"[!] "]; + if (possibleErrorRange.location != NSNotFound) { + error = [NSError errorWithDomain:@"error::CocoaPodUI" code:666 userInfo:@{@"reason":[text substringFromIndex:NSMaxRange(possibleErrorRange)]}]; + success(NO, error); + } + else { + error = [NSError errorWithDomain:@"error::CocoaPodUI" code:666 userInfo:@{@"reason":text}]; + success(NO, error); + } + + } } - (NSString*)podfileString diff --git a/CocoaPodUI/Controllers/PodsManagementViewController.xib b/CocoaPodUI/Controllers/PodsManagementViewController.xib index ef5025f..6a663f2 100644 --- a/CocoaPodUI/Controllers/PodsManagementViewController.xib +++ b/CocoaPodUI/Controllers/PodsManagementViewController.xib @@ -1,8 +1,8 @@ - + - + @@ -34,9 +34,10 @@ + - + @@ -351,6 +352,7 @@ + From 6fa56a5a24210ba82a60fac6f4925ccc17f16a13 Mon Sep 17 00:00:00 2001 From: Mihir Mehta Date: Wed, 22 Jul 2015 14:18:04 +0530 Subject: [PATCH 2/2] Added DVTPlugInCompatibilityUUID for Xcode Version 6.4 (6E35b) --- CocoaPodUI/CocoaPodUI-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/CocoaPodUI/CocoaPodUI-Info.plist b/CocoaPodUI/CocoaPodUI-Info.plist index 17d8fbd..8e89872 100644 --- a/CocoaPodUI/CocoaPodUI-Info.plist +++ b/CocoaPodUI/CocoaPodUI-Info.plist @@ -24,6 +24,7 @@ 1 DVTPlugInCompatibilityUUIDs + 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 E969541F-E6F9-4D25-8158-72DC3545A6C6 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 9F75337B-21B4-4ADC-B558-F9CADF7073A7