From 33351fa2ae052935400ac01102bcf5bd12b4b986 Mon Sep 17 00:00:00 2001 From: Elijah Windsor Date: Sun, 24 Apr 2016 16:47:06 -0400 Subject: [PATCH 1/5] Added ahGroupIdentifier --- AppHub/AppHub/AHPaths.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AppHub/AppHub/AHPaths.h b/AppHub/AppHub/AHPaths.h index 3df19c9..f2bc712 100644 --- a/AppHub/AppHub/AHPaths.h +++ b/AppHub/AppHub/AHPaths.h @@ -12,3 +12,6 @@ extern NSURL *AHBundleDirectory(NSString *buildID); extern NSURL *AHCurrentBuildInfoDirectory(void); extern NSURL *AHBuildsDirectory(void); extern NSURL *AHRootDirectory(void); + +NSString *ahGroupIdentifier = nil; + From 33626f52103ddb4d48ebaf4b439c685ed302d330 Mon Sep 17 00:00:00 2001 From: Elijah Windsor Date: Sun, 24 Apr 2016 16:47:55 -0400 Subject: [PATCH 2/5] Modifying AHRootDirectory -- if ahGroupIdentifier is null, return default root dir, if it is set use the shared space --- AppHub/AppHub/AHPaths.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AppHub/AppHub/AHPaths.m b/AppHub/AppHub/AHPaths.m index eceba59..a78ffb2 100644 --- a/AppHub/AppHub/AHPaths.m +++ b/AppHub/AppHub/AHPaths.m @@ -31,5 +31,9 @@ NSURL *AHRootDirectory(void) { - return [[[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] lastObject] URLByAppendingPathComponent:AHDirectoryName isDirectory:YES]; + if(ahGroupIdentifier == nil) { + return [[[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] lastObject] URLByAppendingPathComponent:AHDirectoryName isDirectory:YES]; + } else { + return [[[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:ahGroupIdentifier] URLByAppendingPathComponent: AHDirectoryName isDirectory:YES]; + } } From 1136c6cfe50bf58f4f588d849ebbbb2b6c53aaa0 Mon Sep 17 00:00:00 2001 From: Elijah Windsor Date: Sun, 24 Apr 2016 16:48:24 -0400 Subject: [PATCH 3/5] Added currentBuildForGroupIdentifier which takes groupIdentifier string, assigns it to ahGroupIdentifier, and returns [self currentBuild] --- AppHub/AppHub/AHBuildManager.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AppHub/AppHub/AHBuildManager.m b/AppHub/AppHub/AHBuildManager.m index 03fd285..2c936a9 100644 --- a/AppHub/AppHub/AHBuildManager.m +++ b/AppHub/AppHub/AHBuildManager.m @@ -79,6 +79,12 @@ - (NSDictionary *)currentBuildInfo return [NSDictionary dictionaryWithContentsOfURL:AHCurrentBuildInfoDirectory()]; } +- (AHBuild *)currentBuildForGroupIdentifier:(NSString *)groupIdentifier { + ahGroupIdentifier = groupIdentifier; + + return [self currentBuild]; +} + - (AHBuild *)currentBuild { NSDictionary *currentBuildInfo = [self currentBuildInfo]; From 736811f06b52a0476c9c30ca69af9b22b259b48c Mon Sep 17 00:00:00 2001 From: Elijah Windsor Date: Sun, 24 Apr 2016 23:20:49 -0400 Subject: [PATCH 4/5] Fixed duplicate symbol issues --- AppHub/AppHub/AHPaths.h | 3 +-- AppHub/AppHub/AHPaths.m | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AppHub/AppHub/AHPaths.h b/AppHub/AppHub/AHPaths.h index f2bc712..c108ce9 100644 --- a/AppHub/AppHub/AHPaths.h +++ b/AppHub/AppHub/AHPaths.h @@ -13,5 +13,4 @@ extern NSURL *AHCurrentBuildInfoDirectory(void); extern NSURL *AHBuildsDirectory(void); extern NSURL *AHRootDirectory(void); -NSString *ahGroupIdentifier = nil; - +extern NSString *ahGroupIdentifier; \ No newline at end of file diff --git a/AppHub/AppHub/AHPaths.m b/AppHub/AppHub/AHPaths.m index a78ffb2..af2d7ec 100644 --- a/AppHub/AppHub/AHPaths.m +++ b/AppHub/AppHub/AHPaths.m @@ -9,6 +9,8 @@ #import "AHConstants.h" +NSString *ahGroupIdentifier = nil; + NSURL *AHBuildDirectory(NSString *buildID) { return [AHBuildsDirectory() URLByAppendingPathComponent:buildID isDirectory:YES]; From da507c9d227334611464c06dfd93bf65a8ea46c9 Mon Sep 17 00:00:00 2001 From: Elijah Windsor Date: Tue, 26 Apr 2016 12:06:42 -0400 Subject: [PATCH 5/5] Exporting currentBuildForGroupIdentifier (not sure how this worked before) --- AppHub/AppHub/AHBuildManager.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AppHub/AppHub/AHBuildManager.h b/AppHub/AppHub/AHBuildManager.h index 7627878..4caa4b3 100644 --- a/AppHub/AppHub/AHBuildManager.h +++ b/AppHub/AppHub/AHBuildManager.h @@ -97,6 +97,8 @@ extern NSString *const AHBuildManagerBuildKey; */ - (void)fetchBuildWithCompletionHandler:(AHBuildResultBlock)completionHandler; +- (AHBuild *)currentBuildForGroupIdentifier:(NSString *)groupIdentifier; + /** * Hook called after NSURLSessionDownloadTask has created *