Skip to content

Commit

Permalink
Fixing test frameworks :(
Browse files Browse the repository at this point in the history
Making each file more standalone for piecemeal includes, or to allow includes from other than the main PCH file
  • Loading branch information
casademora committed May 9, 2012
1 parent 3d37bdb commit 5c5ea83
Show file tree
Hide file tree
Showing 29 changed files with 364 additions and 72 deletions.
Expand Up @@ -7,6 +7,8 @@
// //


#import "NSAttributeDescription+MagicalDataImport.h" #import "NSAttributeDescription+MagicalDataImport.h"
#import "NSManagedObject+MagicalDataImport.h"
#import "MagicalImportFunctions.h"


@implementation NSAttributeDescription (MagicalRecord_DataImport) @implementation NSAttributeDescription (MagicalRecord_DataImport)


Expand Down Expand Up @@ -43,4 +45,5 @@ - (id) MR_valueForKeyPath:(NSString *)keyPath fromObjectData:(id)objectData;


return value == [NSNull null] ? nil : value; return value == [NSNull null] ? nil : value;
} }

@end @end
Expand Up @@ -8,6 +8,7 @@


#import "NSRelationshipDescription+MagicalDataImport.h" #import "NSRelationshipDescription+MagicalDataImport.h"
#import "NSManagedObject+MagicalDataImport.h" #import "NSManagedObject+MagicalDataImport.h"
#import "MagicalImportFunctions.h"
#import "MagicalRecord.h" #import "MagicalRecord.h"


@implementation NSRelationshipDescription (MagicalRecord_DataImport) @implementation NSRelationshipDescription (MagicalRecord_DataImport)
Expand Down
Expand Up @@ -7,6 +7,12 @@
// //


#import "NSManagedObject+MagicalAggregation.h" #import "NSManagedObject+MagicalAggregation.h"
#import "NSManagedObjectContext+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalThreading.h"
#import "NSManagedObject+MagicalRequests.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObject+MagicalFinders.h"
#import "MagicalRecord+ErrorHandling.h"


@implementation NSManagedObject (MagicalAggregation) @implementation NSManagedObject (MagicalAggregation)


Expand Down
Expand Up @@ -7,6 +7,9 @@
// //


#import "NSManagedObject+MagicalFinders.h" #import "NSManagedObject+MagicalFinders.h"
#import "NSManagedObject+MagicalRequests.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalThreading.h"


@implementation NSManagedObject (MagicalFinders) @implementation NSManagedObject (MagicalFinders)


Expand Down
Expand Up @@ -7,6 +7,8 @@
// //


#import "NSManagedObject+MagicalRequests.h" #import "NSManagedObject+MagicalRequests.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalThreading.h"


@implementation NSManagedObject (MagicalRequests) @implementation NSManagedObject (MagicalRequests)


Expand Down
Expand Up @@ -7,6 +7,9 @@
// //


#import "NSManagedObjectContext+MagicalObserving.h" #import "NSManagedObjectContext+MagicalObserving.h"
#import "NSManagedObjectContext+MagicalRecord.h"
#import "MagicalRecord.h"
#import "MagicalRecord+iCloud.h"


static void const * kMagicalRecordNotifiesMainContextAssociatedValueKey = @"kMagicalRecordNotifiesMainContextOnSave"; static void const * kMagicalRecordNotifiesMainContextAssociatedValueKey = @"kMagicalRecordNotifiesMainContextOnSave";
NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification = @"kMagicalRecordDidMergeChangesFromiCloudNotification"; NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification = @"kMagicalRecordDidMergeChangesFromiCloudNotification";
Expand Down
Expand Up @@ -7,6 +7,9 @@
// //


#import "NSManagedObjectContext+MagicalSaves.h" #import "NSManagedObjectContext+MagicalSaves.h"
#import "MagicalRecord+ErrorHandling.h"
#import "NSManagedObjectContext+MagicalRecord.h"
#import "MagicalRecord.h"


@interface NSManagedObjectContext (InternalMagicalSaves) @interface NSManagedObjectContext (InternalMagicalSaves)


Expand Down
Expand Up @@ -7,6 +7,8 @@
// //


#import "NSManagedObjectContext+MagicalThreading.h" #import "NSManagedObjectContext+MagicalThreading.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalRecord.h"


static NSString const * kMagicalRecordManagedObjectContextKey = @"MagicalRecord_NSManagedObjectContextForThreadKey"; static NSString const * kMagicalRecordManagedObjectContextKey = @"MagicalRecord_NSManagedObjectContextForThreadKey";


Expand Down
3 changes: 3 additions & 0 deletions MagicalRecord/Core/MagicalRecord+Setup.m
Expand Up @@ -7,6 +7,9 @@
// //


#import "MagicalRecord+Setup.h" #import "MagicalRecord+Setup.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSPersistentStoreCoordinator+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalRecord.h"


@implementation MagicalRecord (Setup) @implementation MagicalRecord (Setup)


Expand Down
2 changes: 2 additions & 0 deletions MagicalRecord/Core/MagicalRecord+ShorthandSupport.h
Expand Up @@ -10,6 +10,8 @@


@interface MagicalRecord (ShorthandSupport) @interface MagicalRecord (ShorthandSupport)


#ifdef MR_SHORTHAND
+ (void) swizzleShorthandMethods; + (void) swizzleShorthandMethods;
#endif


@end @end
2 changes: 2 additions & 0 deletions MagicalRecord/Core/MagicalRecord+iCloud.m
Expand Up @@ -7,6 +7,8 @@
// //


#import "MagicalRecord+iCloud.h" #import "MagicalRecord+iCloud.h"
#import "NSPersistentStoreCoordinator+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalRecord.h"


static BOOL _iCloudEnabled = NO; static BOOL _iCloudEnabled = NO;


Expand Down
24 changes: 24 additions & 0 deletions MagicalRecord/Core/MagicalRecord.h
Expand Up @@ -9,6 +9,30 @@
#define MAC_PLATFORM_ONLY YES #define MAC_PLATFORM_ONLY YES
#endif #endif


// enable to use caches for the fetchedResultsControllers (iOS only)
// #define STORE_USE_CACHE

#define kCreateNewCoordinatorOnBackgroundOperations 0

#ifndef MR_ENABLE_ACTIVE_RECORD_LOGGING
#ifdef DEBUG
#define MR_ENABLE_ACTIVE_RECORD_LOGGING 1
#else
#define MR_ENABLE_ACTIVE_RECORD_LOGGING 0
#endif
#endif

#if MR_ENABLE_ACTIVE_RECORD_LOGGING != 0
#ifdef LOG_VERBOSE
extern int ddLogLevel;
#define MRLog(...) DDLogVerbose(__VA_ARGS__)
#else
#define MRLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#endif
#else
#define MRLog(...) ((void)0)
#endif

#ifdef NS_BLOCKS_AVAILABLE #ifdef NS_BLOCKS_AVAILABLE


@class NSManagedObjectContext; @class NSManagedObjectContext;
Expand Down
45 changes: 18 additions & 27 deletions MagicalRecord/CoreData+MagicalRecord.h
@@ -1,38 +1,14 @@


// enable to use caches for the fetchedResultsControllers (iOS only)
// #define STORE_USE_CACHE

#define kCreateNewCoordinatorOnBackgroundOperations 0

#ifndef MR_ENABLE_ACTIVE_RECORD_LOGGING
#ifdef DEBUG
#define MR_ENABLE_ACTIVE_RECORD_LOGGING 1
#else
#define MR_ENABLE_ACTIVE_RECORD_LOGGING 0
#endif
#endif

#ifdef __OBJC__

#if MR_ENABLE_ACTIVE_RECORD_LOGGING != 0
#ifdef LOG_VERBOSE
#define MRLog(...) DDLogVerbose(__VA_ARGS__)
#else
#define MRLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#endif
#else
#define MRLog(...) ((void)0)
#endif


#ifndef NS_BLOCKS_AVAILABLE #ifndef NS_BLOCKS_AVAILABLE
#warning MagicalRecord requires blocks #warning MagicalRecord requires blocks
#endif #endif


#ifdef __OBJC__
// #if !( __has_feature(objc_arc) && __has_feature(objc_arc_weak) ) // #if !( __has_feature(objc_arc) && __has_feature(objc_arc_weak) )
// #error MagicalRecord now requires ARC to be enabled // #error MagicalRecord now requires ARC to be enabled
// #endif // #endif


#import <CoreFoundation/CoreFoundation.h>
#import <CoreData/CoreData.h> #import <CoreData/CoreData.h>


#ifdef MR_SHORTHAND #ifdef MR_SHORTHAND
Expand Down Expand Up @@ -69,3 +45,18 @@
#import "NSEntityDescription+MagicalDataImport.h" #import "NSEntityDescription+MagicalDataImport.h"


#endif #endif
g.h"
#import "NSPersistentStoreCoordinator+MagicalRecord.h"
#import "NSManagedObjectModel+MagicalRecord.h"
#import "NSPersistentStore+MagicalRecord.h"
#import "MagicalImportFunctions.h"
#import "NSManagedObject+MagicalDataImport.h"
#import "NSNumber+MagicalDataImport.h"
#import "NSObject+MagicalDataImport.h"
#import "NSString+MagicalDataImport.h"
#import "NSAttributeDescription+MagicalDataImport.h"
#import "NSRelationshipDescription+MagicalDataImport.h"
#import "NSEntityDescription+MagicalDataImport.h"
#endif

0 comments on commit 5c5ea83

Please sign in to comment.