From f3785e5fd181bf5b0562678f20ce8e390cee58a1 Mon Sep 17 00:00:00 2001 From: Vineet Choudhary Date: Mon, 14 Jan 2019 13:27:48 +0530 Subject: [PATCH 1/2] Fixed command line args issue for keep same link option --- .../CIProjectBuilder/CIProjectBuilder.m | 21 ++++++++++++++----- AppBox/Info.plist | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/AppBox/Common/CIProjectBuilder/CIProjectBuilder.m b/AppBox/Common/CIProjectBuilder/CIProjectBuilder.m index cfeda290..ad8e9d8d 100644 --- a/AppBox/Common/CIProjectBuilder/CIProjectBuilder.m +++ b/AppBox/Common/CIProjectBuilder/CIProjectBuilder.m @@ -81,9 +81,17 @@ + (XCProject *)xcProjectWithRepoPath:(NSString *)repoPath andSettingFilePath:(NS project.teamId = [projectRawSetting valueForKey: RepoTeamIdKey]; } + //Dropbox keep same link + if ([projectRawSetting.allKeys containsObject:RepoKeepSameLinkKey]) { + project.keepSameLink = [projectRawSetting valueForKey:RepoKeepSameLinkKey]; + project.isKeepSameLinkEnabled = project.keepSameLink.boolValue; + } + //Dropbox folder name if ([projectRawSetting.allKeys containsObject:RepoDropboxFolderNameKey]) { - project.keepSameLink = [projectRawSetting valueForKey:RepoKeepSameLinkKey]; + NSString *bundlePath = [projectRawSetting valueForKey:RepoDropboxFolderNameKey]; + bundlePath = [bundlePath stringByReplacingOccurrencesOfString:@" " withString:abEmptyString]; + project.bundleDirectory = [NSURL URLWithString:bundlePath]; } //xcode version @@ -258,15 +266,16 @@ +(void)setCommonArgumentsToProject:(XCProject *)project { } } - //Project Personal Messages + //Project Keep Same Link else if ([argument containsString:abArgsKeepSameLink]) { NSArray *components = [argument componentsSeparatedByString:abArgsKeepSameLink]; [ABLog log:@"Keep Same Links Components = %@", components]; if (components.count == 2) { - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Changing project personal message to %@ from %@", [components lastObject], project.personalMessage]]; + [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Changing Keep Same Link to %@ from %@", [components lastObject], project.personalMessage]]; project.keepSameLink = [[components lastObject] isEqualToString:@"0"] ? @0 : @1; + project.isKeepSameLinkEnabled = project.keepSameLink.boolValue; } else { - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Invalid Personal Message Argument %@",arguments]]; + [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Invalid Keep Same Link Argument %@",arguments]]; exit(abExitCodeForInvalidCommand); } } @@ -277,7 +286,9 @@ +(void)setCommonArgumentsToProject:(XCProject *)project { [ABLog log:@"Dropbox folder Components = %@", components]; if (components.count == 2) { [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Changing Dropbox folder name to %@ from %@", [components lastObject], project.personalMessage]]; - //project.db = [components lastObject]; + NSString *bundlePath = [NSString stringWithFormat:@"/%@",[components lastObject]]; + bundlePath = [bundlePath stringByReplacingOccurrencesOfString:@" " withString:abEmptyString]; + project.bundleDirectory = [NSURL URLWithString:bundlePath]; } else { [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Invalid Dropbox Folder Name Argument %@",arguments]]; exit(abExitCodeForInvalidCommand); diff --git a/AppBox/Info.plist b/AppBox/Info.plist index a63c0a80..737c5b60 100644 --- a/AppBox/Info.plist +++ b/AppBox/Info.plist @@ -104,7 +104,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.7.1 + 2.7.2 CFBundleSignature ???? CFBundleURLTypes From c81def50437f8a886e07b4d0fcb3da0739035a4b Mon Sep 17 00:00:00 2001 From: Vineet Choudhary Date: Mon, 14 Jan 2019 15:41:27 +0530 Subject: [PATCH 2/2] Hide more log if Limited log enable in CI Settings --- .../xcshareddata/xcschemes/AppBox.xcscheme | 2 +- AppBox/AppDelegate.m | 8 ++--- .../CIProjectBuilder/CIProjectBuilder.m | 36 ++++++++++--------- AppBox/Common/UploadManager/UploadManager.m | 10 +++--- AppBox/Common/XcodeHandler/XCHandler.m | 4 +-- AppBox/Model/ProjectModel/XCProject.m | 4 +-- .../HomeViewController/HomeViewController.m | 3 +- .../MenuHandler/NSApplication+MenuHandler.m | 4 +-- 8 files changed, 37 insertions(+), 34 deletions(-) diff --git a/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme b/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme index 600885d8..1997f450 100644 --- a/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme +++ b/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme @@ -63,7 +63,7 @@ 0){ - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Loaded Meta Data %@",response]]; + [ABLog log:@"Loaded Meta Data %@",response]; self.project.uniqueLinkJsonMetaData = [response.entries firstObject]; } @@ -670,7 +670,7 @@ -(void)handleSharedURLResult:(NSString *)url{ //create app info file short sharable url else if (self.dbFileType == DBFileTypeJson){ NSString *shareableLink = [url substringToIndex:url.length-5]; - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"APPInfo Sharable link - %@",shareableLink]]; + [ABLog log:@"APPInfo Sharable link - %@",shareableLink]; self.project.uniquelinkShareableURL = [NSURL URLWithString:shareableLink]; NSMutableDictionary *dictUniqueFile = [[self getUniqueJsonDict] mutableCopy]; [dictUniqueFile setObject:shareableLink forKey:UNIQUE_LINK_SHARED]; diff --git a/AppBox/Common/XcodeHandler/XCHandler.m b/AppBox/Common/XcodeHandler/XCHandler.m index 028598fd..d2020210 100644 --- a/AppBox/Common/XcodeHandler/XCHandler.m +++ b/AppBox/Common/XcodeHandler/XCHandler.m @@ -28,7 +28,7 @@ +(void)getXCodePathWithCompletion:(void (^) (NSString *xcodePath, NSString *appl +(NSString *)checkXCodePath:(NSString *)xcodePath { xcodePath = [xcodePath stringByRemovingPercentEncoding]; if ([[NSFileManager defaultManager] fileExistsAtPath:xcodePath]){ - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"XCode = %@", xcodePath]]; + [ABLog log:@"XCode = %@", xcodePath]; return xcodePath; }else{ return nil; @@ -38,7 +38,7 @@ +(NSString *)checkXCodePath:(NSString *)xcodePath { +(NSString *)checkALPath:(NSString *)xcodePath { NSString *alPath = [[xcodePath stringByAppendingPathComponent:abApplicationLoaderALToolLocation] stringByRemovingPercentEncoding]; if ([[NSFileManager defaultManager] fileExistsAtPath:alPath]){ - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Application Loader = %@", alPath]]; + [ABLog log:@"Application Loader = %@", alPath]; return alPath; } else { return nil; diff --git a/AppBox/Model/ProjectModel/XCProject.m b/AppBox/Model/ProjectModel/XCProject.m index b5cd2b94..a70c1ece 100644 --- a/AppBox/Model/ProjectModel/XCProject.m +++ b/AppBox/Model/ProjectModel/XCProject.m @@ -55,11 +55,11 @@ -(void)createManifestWithIPAURL:(NSURL *)ipaURL completion:(void(^)(NSURL *manif NSMutableDictionary *manifestDict = [[NSMutableDictionary alloc] init]; [manifestDict setValue:[NSArray arrayWithObjects:mainItemDict, nil] forKey:@"items"]; - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"\n\n======\nManifest\n======\n\n %@",manifestDict]]; + [ABLog log:@"\n\n======\nManifest\n======\n\n %@",manifestDict]; NSString *manifestPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"manifest.plist"]; if ([manifestDict writeToFile:manifestPath atomically:YES]){ - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Menifest File Created and Saved at %@", manifestPath]]; + [ABLog log:@"Menifest File Created and Saved at %@", manifestPath]; dispatch_async(dispatch_get_main_queue(), ^{ completion([NSURL fileURLWithPath:manifestPath]); }); diff --git a/AppBox/ViewController/HomeViewController/HomeViewController.m b/AppBox/ViewController/HomeViewController/HomeViewController.m index 38168a1f..9e09b712 100644 --- a/AppBox/ViewController/HomeViewController/HomeViewController.m +++ b/AppBox/ViewController/HomeViewController/HomeViewController.m @@ -182,9 +182,10 @@ - (void)initIPAUploadProcessForURL:(NSURL *)ipaURL { [buttonSendMail setState:NSOnState]; } [project setIpaFullPath:ipaURL]; - [selectedFilePath setURL:ipaURL];  + [selectedFilePath setURL:ipaURL]; [textFieldEmail setStringValue:project.emails]; [textFieldMessage setStringValue:project.personalMessage]; + [buttonUniqueLink setState:project.keepSameLink.boolValue ? NSOnState : NSOffState]; [self actionButtonTapped:buttonAction]; } diff --git a/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m b/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m index f74bb149..bb4e936a 100644 --- a/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m +++ b/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m @@ -45,8 +45,8 @@ - (void)updateDropboxUsage{ [self updateDropboxUsageFileButton]; //log space usage - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Used Space : %@MB", usage]]; - [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Available Space : %@MB", allocated]]; + [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"DropBox Used Space : %@MB", usage]]; + [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"DropBox Available Space : %@MB", allocated]]; //check if dopbox running out of space if ((allocated.integerValue - usage.integerValue) < abDropboxOutOfSpaceWarningSize){