Permalink
Browse files

DCAKit dependency

  • Loading branch information...
1 parent afcf9ed commit 8f714f8d4e5e45d84305817c750c392eed74e609 @drewcrawford committed Feb 21, 2013

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -3,7 +3,7 @@
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
- parallelizeBuildables = "YES"
+ parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
@@ -14,6 +14,20 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
+ BlueprintIdentifier = "3A84833616D5DBB200927A33"
+ BuildableName = "libDCAKit.a"
+ BlueprintName = "DCAKit"
+ ReferencedContainer = "container:../DCAKit/DCAKit.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
BlueprintIdentifier = "3A34EC1714DC975000C7CAC6"
BuildableName = "libCoreDataHelp.a"
BlueprintName = "CoreDataHelp"
@@ -45,8 +45,6 @@
3A35F66915202705004AEBA8 /* NSManagedObjectModel+CDHAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A35F66715202705004AEBA8 /* NSManagedObjectModel+CDHAdditions.m */; };
3A49EF7F16CC6FD600B4B147 /* CDHRepo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF7D16CC6FD600B4B147 /* CDHRepo.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A49EF8016CC6FD600B4B147 /* CDHRepo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A49EF7E16CC6FD600B4B147 /* CDHRepo.m */; };
- 3A49EF8516CC780C00B4B147 /* NSError+LessTerrible.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF8316CC780C00B4B147 /* NSError+LessTerrible.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 3A49EF8616CC780C00B4B147 /* NSError+LessTerrible.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A49EF8416CC780C00B4B147 /* NSError+LessTerrible.m */; };
3A49EF8A16CC84DE00B4B147 /* FutureLite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF8816CC84DE00B4B147 /* FutureLite.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A49EF8B16CC84DE00B4B147 /* FutureLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A49EF8916CC84DE00B4B147 /* FutureLite.m */; };
3A49EF8C16CC8C4900B4B147 /* FutureLite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF8816CC84DE00B4B147 /* FutureLite.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -56,7 +54,6 @@
3A49EF9316CC8F6B00B4B147 /* NSFetchRequest+CDH.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF9116CC8F6B00B4B147 /* NSFetchRequest+CDH.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A49EF9416CC8F6B00B4B147 /* NSFetchRequest+CDH.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A49EF9216CC8F6B00B4B147 /* NSFetchRequest+CDH.m */; };
3A49EF9516CC8F8800B4B147 /* NSFetchRequest+CDH.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF9116CC8F6B00B4B147 /* NSFetchRequest+CDH.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 3A49EF9616CCCC5800B4B147 /* NSError+LessTerrible.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF8316CC780C00B4B147 /* NSError+LessTerrible.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A49EF9916CCCE8100B4B147 /* NSManagedObject+ExternalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF9716CCCE8000B4B147 /* NSManagedObject+ExternalStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A49EF9A16CCCE8100B4B147 /* NSManagedObject+ExternalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A49EF9716CCCE8000B4B147 /* NSManagedObject+ExternalStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A49EF9B16CCCE8100B4B147 /* NSManagedObject+ExternalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A49EF9816CCCE8000B4B147 /* NSManagedObject+ExternalStorage.m */; };
@@ -107,13 +104,6 @@
remoteGlobalIDString = 3A34EC1714DC975000C7CAC6;
remoteInfo = CoreDataHelp;
};
- 3A49EF8116CC707200B4B147 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 3A34EC0F14DC975000C7CAC6 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 3A34EC1714DC975000C7CAC6;
- remoteInfo = CoreDataHelp;
- };
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@@ -142,8 +132,6 @@
3A35F66715202705004AEBA8 /* NSManagedObjectModel+CDHAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSManagedObjectModel+CDHAdditions.m"; sourceTree = "<group>"; };
3A49EF7D16CC6FD600B4B147 /* CDHRepo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDHRepo.h; sourceTree = "<group>"; };
3A49EF7E16CC6FD600B4B147 /* CDHRepo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDHRepo.m; sourceTree = "<group>"; };
- 3A49EF8316CC780C00B4B147 /* NSError+LessTerrible.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSError+LessTerrible.h"; sourceTree = "<group>"; };
- 3A49EF8416CC780C00B4B147 /* NSError+LessTerrible.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError+LessTerrible.m"; sourceTree = "<group>"; };
3A49EF8816CC84DE00B4B147 /* FutureLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FutureLite.h; sourceTree = "<group>"; };
3A49EF8916CC84DE00B4B147 /* FutureLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FutureLite.m; sourceTree = "<group>"; };
3A49EF8E16CC8E2500B4B147 /* RegistryObserverProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegistryObserverProtocol.h; sourceTree = "<group>"; };
@@ -273,8 +261,6 @@
3A5C681A1559B0AD000C1AAB /* NSIncrementalStore+CDHAdditions.m */,
3ACBFA371568C1A700CCD332 /* NSThreadWrapper.h */,
3ACBFA381568C1A700CCD332 /* NSThreadWrapper.m */,
- 3A49EF8316CC780C00B4B147 /* NSError+LessTerrible.h */,
- 3A49EF8416CC780C00B4B147 /* NSError+LessTerrible.m */,
3A49EF9116CC8F6B00B4B147 /* NSFetchRequest+CDH.h */,
3A49EF9216CC8F6B00B4B147 /* NSFetchRequest+CDH.m */,
3A49EF9716CCCE8000B4B147 /* NSManagedObject+ExternalStorage.h */,
@@ -356,7 +342,6 @@
3A49EF8D16CC8C5300B4B147 /* CDHRepo.h in Headers */,
3A49EF9016CC8E2500B4B147 /* RegistryObserverProtocol.h in Headers */,
3A49EF9516CC8F8800B4B147 /* NSFetchRequest+CDH.h in Headers */,
- 3A49EF9616CCCC5800B4B147 /* NSError+LessTerrible.h in Headers */,
3A49EF9A16CCCE8100B4B147 /* NSManagedObject+ExternalStorage.h in Headers */,
3A49EFA216CCD89000B4B147 /* FutureRegistry.h in Headers */,
3A49EFA816CCE2F100B4B147 /* NSObject+KVOHelp.h in Headers */,
@@ -384,7 +369,6 @@
3A5C681B1559B0AD000C1AAB /* NSIncrementalStore+CDHAdditions.h in Headers */,
3ACBFA391568C1A700CCD332 /* NSThreadWrapper.h in Headers */,
3A49EF7F16CC6FD600B4B147 /* CDHRepo.h in Headers */,
- 3A49EF8516CC780C00B4B147 /* NSError+LessTerrible.h in Headers */,
3A49EF8A16CC84DE00B4B147 /* FutureLite.h in Headers */,
3A49EF8F16CC8E2500B4B147 /* RegistryObserverProtocol.h in Headers */,
3A49EF9316CC8F6B00B4B147 /* NSFetchRequest+CDH.h in Headers */,
@@ -408,7 +392,6 @@
buildRules = (
);
dependencies = (
- 3A49EF8216CC707200B4B147 /* PBXTargetDependency */,
);
name = CoreDataHelpHeaders;
productName = CoreDataHelp;
@@ -550,7 +533,6 @@
3A5C681C1559B0AD000C1AAB /* NSIncrementalStore+CDHAdditions.m in Sources */,
3ACBFA3A1568C1A700CCD332 /* NSThreadWrapper.m in Sources */,
3A49EF8016CC6FD600B4B147 /* CDHRepo.m in Sources */,
- 3A49EF8616CC780C00B4B147 /* NSError+LessTerrible.m in Sources */,
3A49EF8B16CC84DE00B4B147 /* FutureLite.m in Sources */,
3A49EF9416CC8F6B00B4B147 /* NSFetchRequest+CDH.m in Sources */,
3A49EF9B16CCCE8100B4B147 /* NSManagedObject+ExternalStorage.m in Sources */,
@@ -582,11 +564,6 @@
target = 3A34EC1714DC975000C7CAC6 /* CoreDataHelp */;
targetProxy = 3A34EC2E14DC975000C7CAC6 /* PBXContainerItemProxy */;
};
- 3A49EF8216CC707200B4B147 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 3A34EC1714DC975000C7CAC6 /* CoreDataHelp */;
- targetProxy = 3A49EF8116CC707200B4B147 /* PBXContainerItemProxy */;
- };
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
View
@@ -7,7 +7,7 @@
//
#import "CDHRepo.h"
-#import "NSError+LessTerrible.h"
+#import <DCAKit/NSError+LessTerrible.h>
static CDHRepo *rootRepo;
@interface CDHRepo() {
NSManagedObjectContext *_moc;
@@ -21,7 +21,6 @@
#import <CoreDataHelp/CDHRepo.h>
#import <CoreDataHelp/RegistryObserverProtocol.h>
#import <CoreDataHelp/NSFetchRequest+CDH.h>
-#import <CoreDataHelp/NSError+LessTerrible.h>
#import <CoreDataHelp/NSManagedObject+ExternalStorage.h>
#import <CoreDataHelp/NSObject+KVOHelp.h>
@@ -1,20 +0,0 @@
-//
-// NSError+LessTerrible.h
-// Adrenaline
-//
-// Created by Drew Crawford on 1/9/13.
-// Copyright (c) 2013 DrewCrawfordApps. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface NSError (LessSuck)
-/**Less terrible errors */
--(NSString*) lessTerribleFailureReason;
--(void) present;
-
-//any keys you set in here will get reported with errors...
-@property (readonly) NSMutableDictionary *environment;
-
-+(void) setExceptionalAPIKey:(NSString*) exceptionalKey;
-@end
@@ -1,103 +0,0 @@
-//
-// NSError+LessTerrible.m
-// Adrenaline
-//
-// Created by Drew Crawford on 1/9/13.
-// Copyright (c) 2013 DrewCrawfordApps. All rights reserved.
-//
-#define ISO_TIMEZONE_UTC_FORMAT @"Z"
-#define ISO_TIMEZONE_OFFSET_FORMAT @"%+02d%02d"
-
-#import "NSError+LessTerrible.h"
-#import <UIKit/UIKit.h>
-
-static NSString *exceptionalAPIKey;
-static NSMutableDictionary *environment;
-
-@implementation NSError (LessSuck)
-- (NSString *)lessTerribleFailureReason {
- if ([self domain]==NSURLErrorDomain && [self code]==NSURLErrorUserCancelledAuthentication) {
- return @"User unauthorized.";
- }
- return [self localizedDescription];
-}
-
-- (NSString*) lessTerribleRecoverySuggestion {
- if ([self domain]==NSURLErrorDomain && [self code]==NSURLErrorUserCancelledAuthentication) {
- return @"Check your login credentials and try again.";
- }
- return [self localizedRecoverySuggestion];
-}
-
--(void) present {
- [self log];
- UIAlertView *uav = [[UIAlertView alloc] initWithTitle:[self lessTerribleFailureReason] message:[self lessTerribleRecoverySuggestion] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
- dispatch_async(dispatch_get_main_queue(), ^{
- [uav show];
- });
-
-}
-
-#pragma mark - Exceptional
-
-
--(NSString *) strFromISO8601:(NSDate *) date {
- static NSDateFormatter* sISO8601 = nil;
-
- if (!sISO8601) {
- sISO8601 = [[NSDateFormatter alloc] init];
-
- NSTimeZone *timeZone = [NSTimeZone localTimeZone];
- int offset = [timeZone secondsFromGMT];
-
- NSMutableString *strFormat = [NSMutableString stringWithString:@"yyyyMMdd'T'HH:mm:ss"];
- offset /= 60; //bring down to minutes
- if (offset == 0)
- [strFormat appendString:ISO_TIMEZONE_UTC_FORMAT];
- else
- [strFormat appendFormat:ISO_TIMEZONE_OFFSET_FORMAT, offset / 60, offset % 60];
-
- [sISO8601 setTimeStyle:NSDateFormatterFullStyle];
- [sISO8601 setDateFormat:strFormat];
- }
- return[sISO8601 stringFromDate:date];
-}
-
-+(void) setExceptionalAPIKey:(NSString*) exceptionalKey {
- exceptionalAPIKey = exceptionalKey;
- environment = [[NSMutableDictionary alloc] init];
-}
-
--(NSMutableDictionary*) environment {
- return environment;
-}
-
-//http://docs.exceptional.io/api/publish/
--(void) log {
- if (!exceptionalAPIKey) {
- NSLog(@"Cannot log an error because no exceptional API key is set. Consider creating one.");
- return;
- }
- NSDictionary *appDict = [[NSBundle mainBundle] infoDictionary];
- NSDictionary *client = @{@"name":appDict[@"CFBundleName"],@"version":appDict[@"CFBundleVersion"],@"build":appDict[@"CFBundleShortVersionString"],@"deviceName":UIDevice.currentDevice.name,@"OSVersion":UIDevice.currentDevice.systemVersion,@"model":UIDevice.currentDevice.model,@"orientation":@(UIDevice.currentDevice.orientation),@"userInfo":[self.userInfo description]};
- for (id key in client.allKeys) {
- environment[[NSString stringWithFormat:@"__client_%@",key]]=client[key];
- }
-
-
-
- NSDictionary *dict = @{@"exception":@{@"backtrace" : [NSThread callStackSymbols],@"exception_class":self.domain,@"message":self.lessTerribleFailureReason,@"occurred_at":[self strFromISO8601:[NSDate date]]},@"application_environment":@{@"application_root_directory":@"Steve Jobs says no",@"env":environment}};
- NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://api.exceptional.io/api/errors?api_key=%@&protocol_version=6",exceptionalAPIKey]]];
- NSAssert([NSJSONSerialization isValidJSONObject:dict], @"Not a valid json object?");
-
- NSError *jsonErr = nil;
- NSData *errData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:&jsonErr];
- [request setHTTPBody:errData];
- [request setHTTPMethod:@"POST"];
- NSURLResponse *response = nil;
- NSError *err = nil;
- [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
-
-
-}
-@end
@@ -7,7 +7,7 @@
//
#import "NSManagedObject+ExternalStorage.h"
-#import "NSError+LessTerrible.h"
+#import <DCAKit/NSError+LessTerrible.h>
@implementation NSManagedObject (ExternalStorage)
- (void)setCacheFileWithData:(NSData *)data forKey :(NSString *)key {
CFUUIDRef uniqueID = CFUUIDCreate(NULL);
View
@@ -3,17 +3,31 @@
# Install with
# ln -sf ../../pre-commit.py .git/hooks/pre-commit
-
+# or (if submodule)
+# ln -sf ../../../../[path from root of repo]/pre-commit.py [path to root .git]/modules/NAME/hooks/pre-commit
PROJECT_NAME = "CoreDataHelp"
-WORKSPACE_NAME = "CoreDataHelp.xcodeproj/project.xcworkspace"
-TEST_SCHEME = "CoreDataHelpTests"
-BUILD_SCHEME = "CoreDataHelp"
+WORKSPACE_NAME = "CDHWorkspace_with_parent_DCAKit.xcworkspace"
+TEST_SCHEME = "CoreDataHelpTests-commithook"
+TEST_CUSTOMFLAGS = "HEADER_SEARCH_PATHS=../DCAKit/"
+BUILD_SCHEME = "CoreDataHelp-commithook"
+BUILD_CUSTOMFLAGS = ""
TEST_SUITE_NAME = "CoreDataHelpTests"
+
+#no config below - paste over me
+
+#version history
+# v0.1 - submodule support
+# v0.2 - improved test output regex
+# v0.3 - better git_index_file workaround
+# v0.4 - support custom flags
+
+
def getSO(cmd):
import subprocess
+ print "run",cmd
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
output,stderr = proc.communicate()
proc.wait() # this might hang with a LOT of output
@@ -22,6 +36,7 @@ def getSO(cmd):
def getO(cmd):
import subprocess
+ print "run",cmd
return subprocess.check_output(cmd, shell=True)
@@ -39,6 +54,29 @@ def success():
#remove any old notification
getO("""develop-environment/terminal-notifier.app/Contents/MacOS/terminal-notifier -remove "{PROJECT_NAME}" """.format(PROJECT_NAME=PROJECT_NAME))
try:
+ print "Submodules check..."
+ o = getO("""git submodule status""")
+ for moduledescriptor in o.split("\n"):
+ moduledescriptor = moduledescriptor.strip()
+ if len(moduledescriptor)==0: continue
+ sha = moduledescriptor.split(" ")[0]
+ path = moduledescriptor.split(" ")[1]
+
+ #verify clean status
+ #we must unset GIT_INDEX_FILE since it is set by the commit hook and it interferes with our ability to get anything done
+ import os
+ if os.environ.has_key("GIT_INDEX_FILE"):
+ del os.environ["GIT_INDEX_FILE"]
+ o = getO("""cd {PATH} && git status --porcelain""".format(PATH=path))
+ if (o!=""):
+ fail("Submodule {PATH} has non-clean status {STATUS}".format(PATH=path,STATUS=o))
+
+ sha = sha.strip("+") #this is used iff the submodule's actual HEAD is newer than what the parent repo's pointer is, which is almost always true in our workflow
+
+ #determine if the submodule's commits are out there anywhere
+ o = getO("cd {PATH} && git fetch && git branch -r --contains {SHA}".format(PATH=path,SHA=sha))
+ if not "origin" in o:
+ fail("{PATH} needs push".format(PATH=path),detail="Can't find ref {SHA} in remote".format(SHA=sha))
print "Forgetting to check in files check..."
requireArray = [".m",".h"]
@@ -52,7 +90,7 @@ def success():
print "build/analyze/warning check"
- (code,output) = getSO("xcodebuild -configuration Release -sdk iphonesimulator -workspace {WORKSPACE_NAME} -IDEBuildOperationMaxNumberOfConcurrentCompile=1 -scheme {SCHEME_NAME} RUN_CLANG_STATIC_ANALYZER=YES clean build ".format(SCHEME_NAME=BUILD_SCHEME,WORKSPACE_NAME=WORKSPACE_NAME))
+ (code,output) = getSO("xcodebuild -configuration Release -sdk iphonesimulator -workspace {WORKSPACE_NAME} -IDEBuildOperationMaxNumberOfConcurrentCompile=1 -scheme {SCHEME_NAME} RUN_CLANG_STATIC_ANALYZER=YES {CUSTOM_FLAGS} clean build ".format(SCHEME_NAME=BUILD_SCHEME,WORKSPACE_NAME=WORKSPACE_NAME,CUSTOM_FLAGS=BUILD_CUSTOMFLAGS))
@@ -75,7 +113,7 @@ def success():
print "unit test check"
#run the unit tests
- (code,output) = getSO("xcodebuild -sdk iphonesimulator -configuration UnitTest -workspace {WORKSPACE_NAME} -scheme {SCHEME_NAME} RUN_UNIT_TEST_WITH_IOS_SIM=YES clean build".format(SCHEME_NAME=TEST_SCHEME,WORKSPACE_NAME=WORKSPACE_NAME))
+ (code,output) = getSO("xcodebuild -sdk iphonesimulator -configuration UnitTest -workspace {WORKSPACE_NAME} -scheme {SCHEME_NAME} RUN_UNIT_TEST_WITH_IOS_SIM=YES {CUSTOM_FLAGS} clean build".format(SCHEME_NAME=TEST_SCHEME,WORKSPACE_NAME=WORKSPACE_NAME,CUSTOM_FLAGS=TEST_CUSTOMFLAGS))
if code != 0:
print output
@@ -87,7 +125,7 @@ def success():
fail("Build did not succeed","Can't find text ** BUILD SUCCEEDED ** in output. Can you?")
- regex1 = r"Test Suite '"+TEST_SUITE_NAME + r"' finished at .*\nExecuted .* with (.*) failures"
+ regex1 = r"Test Suite '.*"+TEST_SUITE_NAME + r".*' finished at .*\nExecuted .* with (.*) failure"
spolsky_msg = re.search(regex1,output)
if not spolsky_msg:
print output

0 comments on commit 8f714f8

Please sign in to comment.