From 98fb2dbe5c6d98c5db04ea9dc9a9bb9b7651d27c Mon Sep 17 00:00:00 2001 From: Egor Tolstoy Date: Sat, 7 Nov 2015 14:18:47 +0300 Subject: [PATCH 1/5] Added the simplest implementation of preattaching infrastructure components --- .../TyphoonAssembly+TyphoonAssemblyFriend.h | 2 ++ Source/Factory/Assembly/TyphoonAssembly.m | 6 ++-- .../Internal/TyphoonBlockComponentFactory.m | 21 ++++++++++++ Tests/Factory/Assembly/TyphoonAssemblyTests.m | 32 ++++++++++++------- 4 files changed, 46 insertions(+), 15 deletions(-) diff --git a/Source/Factory/Assembly/TyphoonAssembly+TyphoonAssemblyFriend.h b/Source/Factory/Assembly/TyphoonAssembly+TyphoonAssemblyFriend.h index 4637795cf..25ae69163 100644 --- a/Source/Factory/Assembly/TyphoonAssembly+TyphoonAssemblyFriend.h +++ b/Source/Factory/Assembly/TyphoonAssembly+TyphoonAssemblyFriend.h @@ -21,6 +21,8 @@ - (NSArray *)definitions; +- (NSArray *)preattachedInfrastructureComponents; + - (TyphoonDefinition *)definitionForKey:(NSString *)key; - (Class)assemblyClassForKey:(NSString *)key; diff --git a/Source/Factory/Assembly/TyphoonAssembly.m b/Source/Factory/Assembly/TyphoonAssembly.m index 4ee6da09a..5074f1ae0 100644 --- a/Source/Factory/Assembly/TyphoonAssembly.m +++ b/Source/Factory/Assembly/TyphoonAssembly.m @@ -31,6 +31,7 @@ @interface TyphoonAssembly () @property(readwrite) NSSet *definitionSelectors; +@property(readwrite) NSArray *preattachedInfrastructureComponents; @property(readwrite) NSDictionary *assemblyClassPerDefinitionKey; @@ -123,6 +124,7 @@ - (id)init { _definitionBuilder = [[TyphoonAssemblyDefinitionBuilder alloc] initWithAssembly:self]; _adviser = [[TyphoonAssemblyAdviser alloc] initWithAssembly:self]; _collector = [[TyphoonCollaboratingAssembliesCollector alloc] initWithAssemblyClass:[self class]]; + _preattachedInfrastructureComponents = [NSArray array]; [self proxyCollaboratingAssembliesPriorToActivation]; } @@ -199,8 +201,7 @@ - (void)makeDefault { - (void)attachPostProcessor:(id )postProcessor { if (!_factory) { - [NSException raise:NSInternalInconsistencyException - format:@"attachPostProcessor: requires the assembly to be activated."]; + _preattachedInfrastructureComponents = [_preattachedInfrastructureComponents arrayByAddingObject:postProcessor]; } [_factory attachPostProcessor:postProcessor]; } @@ -333,5 +334,4 @@ - (Class)assemblyClassForKey:(NSString *)key } } - @end diff --git a/Source/Factory/Internal/TyphoonBlockComponentFactory.m b/Source/Factory/Internal/TyphoonBlockComponentFactory.m index acb4d3453..befe56a14 100644 --- a/Source/Factory/Internal/TyphoonBlockComponentFactory.m +++ b/Source/Factory/Internal/TyphoonBlockComponentFactory.m @@ -18,6 +18,10 @@ #import "TyphoonAssembly+TyphoonAssemblyFriend.h" #import "TyphoonAssemblyPropertyInjectionPostProcessor.h" #import "TyphoonIntrospectionUtils.h" +#import "TyphoonTypeConverterRegistry.h" +#import "TyphoonTypeConverter.h" +#import "TyphoonInstancePostProcessor.h" +#import "TyphoonComponentFactory+TyphoonDefinitionRegisterer.h" @interface TyphoonComponentFactory (Private) @@ -72,6 +76,7 @@ - (void)buildAssembly:(TyphoonAssembly*)assembly [assembly prepareForUse]; + [self registerAllPreattachedInfrastructureComponents:assembly]; [self registerAllDefinitions:assembly]; } @@ -92,6 +97,22 @@ - (void)registerAllDefinitions:(TyphoonAssembly *)assembly } } +- (void)registerAllPreattachedInfrastructureComponents:(TyphoonAssembly *)assembly { + NSArray *infrastructureComponents = [assembly preattachedInfrastructureComponents]; + + for (id component in infrastructureComponents) { + if ([component conformsToProtocol:@protocol(TyphoonDefinitionPostProcessor)]) { + [self attachPostProcessor:component]; + } + else if ([component conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { + [self addInstancePostProcessor:component]; + } + else if ([component conformsToProtocol:@protocol(TyphoonTypeConverter)]) { + [self.typeConverterRegistry registerTypeConverter:component]; + } + } +} + //------------------------------------------------------------------------------------------- #pragma mark - Overridden Methods //------------------------------------------------------------------------------------------- diff --git a/Tests/Factory/Assembly/TyphoonAssemblyTests.m b/Tests/Factory/Assembly/TyphoonAssemblyTests.m index 1f2aff7bb..fc411611e 100644 --- a/Tests/Factory/Assembly/TyphoonAssemblyTests.m +++ b/Tests/Factory/Assembly/TyphoonAssemblyTests.m @@ -17,6 +17,7 @@ #import "TyphoonLoopedCollaboratingAssemblies.h" #import "MediocreQuest.h" #import "OCLogTemplate.h" +#import "TyphoonPatcher.h" @interface TyphoonAssemblyTests : XCTestCase @end @@ -146,18 +147,6 @@ - (void)test_before_activation_raises_exception_when_invoking_TyphoonComponentFa } } -- (void)test_before_activation_raises_exception_when_invoking_attachPostProcessor -{ - @try { - MiddleAgesAssembly *assembly = [MiddleAgesAssembly assembly]; - [assembly attachPostProcessor:nil]; - XCTFail(@"Should have thrown exception"); - } - @catch (NSException *e) { - XCTAssertEqualObjects(@"attachPostProcessor: requires the assembly to be activated.", [e description]); - } -} - - (void)test_before_activation_raises_exception_when_invoking_subscription { @try { @@ -226,4 +215,23 @@ - (void)test_nil_definition_with_injection_hooks } } +- (void)test_before_activation_stores_post_processors +{ + MiddleAgesAssembly *assembly = [MiddleAgesAssembly assembly]; + + TyphoonPatcher *patcher = [TyphoonPatcher new]; + [assembly attachPostProcessor:patcher]; + + TyphoonBlockComponentFactory *factory = [[TyphoonBlockComponentFactory alloc] initWithAssembly:assembly]; + NSArray *attachedPostProcessors = factory.definitionPostProcessors; + BOOL isPatcherAttached = NO; + for (id postProcessor in attachedPostProcessors) { + if ([postProcessor isEqual:patcher]) { + isPatcherAttached = YES; + } + } + + XCTAssertTrue(isPatcherAttached); +} + @end From 947cc50d178cc8844b675ae89af47f1eb239f9d0 Mon Sep 17 00:00:00 2001 From: Egor Tolstoy Date: Sat, 7 Nov 2015 14:48:19 +0300 Subject: [PATCH 2/5] Renamed -attachPostProcessor to -attachDefinitionPostProcessor and deprecated the old method --- Source/Configuration/Startup/TyphoonStartup.m | 2 +- Source/Factory/Assembly/TyphoonAssembly.m | 15 +++++++++++-- .../Internal/TyphoonBlockComponentFactory.m | 4 ++-- Source/Factory/TyphoonComponentFactory.h | 8 ++++--- Source/Factory/TyphoonComponentFactory.m | 21 ++++++++++++------- Source/Factory/TyphoonDefinitionRegisterer.m | 2 +- Tests/Factory/Assembly/TyphoonAssemblyTests.m | 9 ++------ .../TyphoonBlockComponentFactoryTests.m | 4 ++-- Tests/Test/Patcher/TyphoonPatcherTests.m | 2 +- 9 files changed, 40 insertions(+), 27 deletions(-) diff --git a/Source/Configuration/Startup/TyphoonStartup.m b/Source/Configuration/Startup/TyphoonStartup.m index 552a9b6cb..78dc56521 100644 --- a/Source/Configuration/Startup/TyphoonStartup.m +++ b/Source/Configuration/Startup/TyphoonStartup.m @@ -129,7 +129,7 @@ + (void)swizzleSetDelegateMethodOnApplicationClass if (initialFactory) { id processor = [self configPostProcessor]; if (processor) { - [initialFactory attachPostProcessor:processor]; + [initialFactory attachDefinitionPostProcessor:processor]; } [self injectInitialFactoryIntoDelegate:delegate]; [TyphoonComponentFactory setFactoryForResolvingUI:initialFactory]; diff --git a/Source/Factory/Assembly/TyphoonAssembly.m b/Source/Factory/Assembly/TyphoonAssembly.m index 5074f1ae0..f40a8e48d 100644 --- a/Source/Factory/Assembly/TyphoonAssembly.m +++ b/Source/Factory/Assembly/TyphoonAssembly.m @@ -199,11 +199,18 @@ - (void)makeDefault { [_factory makeDefault]; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" - (void)attachPostProcessor:(id )postProcessor { + [self attachDefinitionPostProcessor:postProcessor]; +} +#pragma clang diagnostic pop + +- (void)attachDefinitionPostProcessor:(id )definitionPostProcessor { if (!_factory) { - _preattachedInfrastructureComponents = [_preattachedInfrastructureComponents arrayByAddingObject:postProcessor]; + [self preattachDefinitionPostProcessor:definitionPostProcessor]; } - [_factory attachPostProcessor:postProcessor]; + [_factory attachDefinitionPostProcessor:definitionPostProcessor]; } - (id)objectForKeyedSubscript:(id)key { @@ -334,4 +341,8 @@ - (Class)assemblyClassForKey:(NSString *)key } } +- (void)preattachDefinitionPostProcessor:(id )postProcessor { + _preattachedInfrastructureComponents = [_preattachedInfrastructureComponents arrayByAddingObject:postProcessor]; +} + @end diff --git a/Source/Factory/Internal/TyphoonBlockComponentFactory.m b/Source/Factory/Internal/TyphoonBlockComponentFactory.m index befe56a14..12795d27b 100644 --- a/Source/Factory/Internal/TyphoonBlockComponentFactory.m +++ b/Source/Factory/Internal/TyphoonBlockComponentFactory.m @@ -61,7 +61,7 @@ - (id)initWithAssemblies:(NSArray *)assemblies { self = [super init]; if (self) { - [self attachPostProcessor:[TyphoonAssemblyPropertyInjectionPostProcessor new]]; + [self attachDefinitionPostProcessor:[TyphoonAssemblyPropertyInjectionPostProcessor new]]; for (TyphoonAssembly *assembly in assemblies) { [self buildAssembly:assembly]; } @@ -102,7 +102,7 @@ - (void)registerAllPreattachedInfrastructureComponents:(TyphoonAssembly *)assemb for (id component in infrastructureComponents) { if ([component conformsToProtocol:@protocol(TyphoonDefinitionPostProcessor)]) { - [self attachPostProcessor:component]; + [self attachDefinitionPostProcessor:component]; } else if ([component conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { [self addInstancePostProcessor:component]; diff --git a/Source/Factory/TyphoonComponentFactory.h b/Source/Factory/TyphoonComponentFactory.h index edd0c6ace..3ed45eb93 100644 --- a/Source/Factory/TyphoonComponentFactory.h +++ b/Source/Factory/TyphoonComponentFactory.h @@ -80,10 +80,12 @@ - (void)makeDefault; /** -Attach a TyphoonComponentFactoryPostProcessor to this component factory. -@param postProcessor The post-processor to attach. +Attach a TyphoonDefinitionPostProcessor to this component factory. +@param definitionPostProcessor The definition post processor to attach. */ -- (void)attachPostProcessor:(id )postProcessor; +- (void)attachDefinitionPostProcessor:(id)definitionPostProcessor; + +- (void)attachPostProcessor:(id)postProcessor DEPRECATED_MSG_ATTRIBUTE("use attachDefinitionPostProcessor instead"); @end diff --git a/Source/Factory/TyphoonComponentFactory.m b/Source/Factory/TyphoonComponentFactory.m index 6fc39e74b..8de5a308a 100644 --- a/Source/Factory/TyphoonComponentFactory.m +++ b/Source/Factory/TyphoonComponentFactory.m @@ -79,9 +79,9 @@ - (id)init _typeConverterRegistry = [[TyphoonTypeConverterRegistry alloc] init]; _definitionPostProcessors = [[NSMutableArray alloc] init]; _instancePostProcessors = [[NSMutableArray alloc] init]; - [self attachPostProcessor:[TyphoonParentReferenceHydratingPostProcessor new]]; + [self attachDefinitionPostProcessor:[TyphoonParentReferenceHydratingPostProcessor new]]; [self attachAutoInjectionPostProcessorIfNeeded]; - [self attachPostProcessor:[TyphoonFactoryPropertyInjectionPostProcessor new]]; + [self attachDefinitionPostProcessor:[TyphoonFactoryPropertyInjectionPostProcessor new]]; } return self; } @@ -92,7 +92,7 @@ - (void)attachAutoInjectionPostProcessorIfNeeded NSNumber *value = bundleInfoDictionary[@"TyphoonAutoInjectionEnabled"]; if (!value || [value boolValue]) { - [self attachPostProcessor:[TyphoonFactoryAutoInjectionPostProcessor new]]; + [self attachDefinitionPostProcessor:[TyphoonFactoryAutoInjectionPostProcessor new]]; } } @@ -242,17 +242,22 @@ - (void)enumerateDefinitions:(void (^)(TyphoonDefinition *definition, NSUInteger } } - -- (void)attachPostProcessor:(id)postProcessor -{ - LogTrace(@"Attaching post processor: %@", postProcessor); - [_definitionPostProcessors addObject:postProcessor]; +- (void)attachDefinitionPostProcessor:(id)definitionPostProcessor { + LogTrace(@"Attaching definition post processor: %@", definitionPostProcessor); + [_definitionPostProcessors addObject:definitionPostProcessor]; if ([self isLoaded]) { LogDebug(@"Definitions registered, refreshing all singletons."); [self unload]; } } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" +- (void)attachPostProcessor:(id)postProcessor +{ + [self attachDefinitionPostProcessor:postProcessor]; +} +#pragma clang diagnostic pop - (void)inject:(id)instance { diff --git a/Source/Factory/TyphoonDefinitionRegisterer.m b/Source/Factory/TyphoonDefinitionRegisterer.m index 9dffd5b13..eb89b22ee 100644 --- a/Source/Factory/TyphoonDefinitionRegisterer.m +++ b/Source/Factory/TyphoonDefinitionRegisterer.m @@ -93,7 +93,7 @@ - (void)registerInfrastructureComponentFromDefinition id infrastructureComponent = [_componentFactory newOrScopeCachedInstanceForDefinition:_definition args:nil]; if ([_definition.type conformsToProtocol:@protocol(TyphoonDefinitionPostProcessor)]) { - [_componentFactory attachPostProcessor:infrastructureComponent]; + [_componentFactory attachDefinitionPostProcessor:infrastructureComponent]; } else if ([_definition.type conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { [_componentFactory addInstancePostProcessor:infrastructureComponent]; diff --git a/Tests/Factory/Assembly/TyphoonAssemblyTests.m b/Tests/Factory/Assembly/TyphoonAssemblyTests.m index fc411611e..2436f8a9a 100644 --- a/Tests/Factory/Assembly/TyphoonAssemblyTests.m +++ b/Tests/Factory/Assembly/TyphoonAssemblyTests.m @@ -220,16 +220,11 @@ - (void)test_before_activation_stores_post_processors MiddleAgesAssembly *assembly = [MiddleAgesAssembly assembly]; TyphoonPatcher *patcher = [TyphoonPatcher new]; - [assembly attachPostProcessor:patcher]; + [assembly attachDefinitionPostProcessor:patcher]; TyphoonBlockComponentFactory *factory = [[TyphoonBlockComponentFactory alloc] initWithAssembly:assembly]; NSArray *attachedPostProcessors = factory.definitionPostProcessors; - BOOL isPatcherAttached = NO; - for (id postProcessor in attachedPostProcessors) { - if ([postProcessor isEqual:patcher]) { - isPatcherAttached = YES; - } - } + BOOL isPatcherAttached = [attachedPostProcessors containsObject:patcher]; XCTAssertTrue(isPatcherAttached); } diff --git a/Tests/Factory/Internal/TyphoonBlockComponentFactoryTests.m b/Tests/Factory/Internal/TyphoonBlockComponentFactoryTests.m index 7fe8b985c..31d2a324e 100644 --- a/Tests/Factory/Internal/TyphoonBlockComponentFactoryTests.m +++ b/Tests/Factory/Internal/TyphoonBlockComponentFactoryTests.m @@ -56,7 +56,7 @@ - (void)setUp internalProcessorsCount = [[_componentFactory definitionPostProcessors] count]; TyphoonConfigPostProcessor *processor = [TyphoonConfigPostProcessor forResourceNamed:@"SomeProperties.properties"]; - [_componentFactory attachPostProcessor:processor]; + [_componentFactory attachDefinitionPostProcessor:processor]; _exceptionTestFactory = [[TyphoonBlockComponentFactory alloc] initWithAssembly:[ExceptionTestAssembly assembly]]; _circularDependenciesFactory = [[TyphoonBlockComponentFactory alloc] @@ -217,7 +217,7 @@ - (void)test_resolves_property_values TyphoonComponentFactory *factory = [[TyphoonBlockComponentFactory alloc] initWithAssembly:[TyphoonConfigAssembly assembly]]; TyphoonConfigPostProcessor *processor = [TyphoonConfigPostProcessor forResourceNamed:@"SomeProperties.properties"]; - [factory attachPostProcessor:processor]; + [factory attachDefinitionPostProcessor:processor]; Knight *knight = [factory componentForKey:@"knight"]; XCTAssertEqual(knight.damselsRescued, (NSUInteger)12); diff --git a/Tests/Test/Patcher/TyphoonPatcherTests.m b/Tests/Test/Patcher/TyphoonPatcherTests.m index 1dbeb715f..972ef4e29 100644 --- a/Tests/Test/Patcher/TyphoonPatcherTests.m +++ b/Tests/Test/Patcher/TyphoonPatcherTests.m @@ -121,7 +121,7 @@ - (void)applyAPatch return knight; }]; - [_assembly attachPostProcessor:_patcher]; + [_assembly attachDefinitionPostProcessor:_patcher]; } - (void)assertPatchApplied From 5e593f18a89e38860c0fcce23ab6f2b9708a6aec Mon Sep 17 00:00:00 2001 From: Egor Tolstoy Date: Sat, 7 Nov 2015 15:01:41 +0300 Subject: [PATCH 3/5] Implemented -attachInstancePostProcessor method in TyphoonAssembly --- Source/Factory/Assembly/TyphoonAssembly.m | 17 ++++++++++++----- .../Internal/TyphoonBlockComponentFactory.m | 2 +- ...mponentFactory+TyphoonDefinitionRegisterer.h | 2 +- Source/Factory/TyphoonComponentFactory.h | 13 ++++++++++--- Source/Factory/TyphoonComponentFactory.m | 17 ++++++++++++----- Source/Factory/TyphoonDefinitionRegisterer.m | 2 +- Tests/Factory/Assembly/TyphoonAssemblyTests.m | 15 ++++++++++++--- Tests/Factory/TyphoonComponentFactoryTests.m | 6 +++--- 8 files changed, 52 insertions(+), 22 deletions(-) diff --git a/Source/Factory/Assembly/TyphoonAssembly.m b/Source/Factory/Assembly/TyphoonAssembly.m index f40a8e48d..6848d70a0 100644 --- a/Source/Factory/Assembly/TyphoonAssembly.m +++ b/Source/Factory/Assembly/TyphoonAssembly.m @@ -206,11 +206,18 @@ - (void)attachPostProcessor:(id )postProcessor { } #pragma clang diagnostic pop -- (void)attachDefinitionPostProcessor:(id )definitionPostProcessor { +- (void)attachDefinitionPostProcessor:(id )postProcessor { if (!_factory) { - [self preattachDefinitionPostProcessor:definitionPostProcessor]; + [self preattachInfrastructureComponent:postProcessor]; } - [_factory attachDefinitionPostProcessor:definitionPostProcessor]; + [_factory attachDefinitionPostProcessor:postProcessor]; +} + +- (void)attachInstancePostProcessor:(id)postProcessor { + if (!_factory) { + [self preattachInfrastructureComponent:postProcessor]; + } + [_factory attachInstancePostProcessor:postProcessor]; } - (id)objectForKeyedSubscript:(id)key { @@ -341,8 +348,8 @@ - (Class)assemblyClassForKey:(NSString *)key } } -- (void)preattachDefinitionPostProcessor:(id )postProcessor { - _preattachedInfrastructureComponents = [_preattachedInfrastructureComponents arrayByAddingObject:postProcessor]; +- (void)preattachInfrastructureComponent:(id)component { + _preattachedInfrastructureComponents = [_preattachedInfrastructureComponents arrayByAddingObject:component]; } @end diff --git a/Source/Factory/Internal/TyphoonBlockComponentFactory.m b/Source/Factory/Internal/TyphoonBlockComponentFactory.m index 12795d27b..d0e9575db 100644 --- a/Source/Factory/Internal/TyphoonBlockComponentFactory.m +++ b/Source/Factory/Internal/TyphoonBlockComponentFactory.m @@ -105,7 +105,7 @@ - (void)registerAllPreattachedInfrastructureComponents:(TyphoonAssembly *)assemb [self attachDefinitionPostProcessor:component]; } else if ([component conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { - [self addInstancePostProcessor:component]; + [self attachInstancePostProcessor:component]; } else if ([component conformsToProtocol:@protocol(TyphoonTypeConverter)]) { [self.typeConverterRegistry registerTypeConverter:component]; diff --git a/Source/Factory/Internal/TyphoonComponentFactory+TyphoonDefinitionRegisterer.h b/Source/Factory/Internal/TyphoonComponentFactory+TyphoonDefinitionRegisterer.h index 5a2a19fc9..681b69fa7 100644 --- a/Source/Factory/Internal/TyphoonComponentFactory+TyphoonDefinitionRegisterer.h +++ b/Source/Factory/Internal/TyphoonComponentFactory+TyphoonDefinitionRegisterer.h @@ -25,6 +25,6 @@ - (void)addDefinitionToRegistry:(TyphoonDefinition *)definition; -- (void)addInstancePostProcessor:(id )postProcessor; +- (void)addInstancePostProcessor:(id )postProcessor DEPRECATED_MSG_ATTRIBUTE("use attachInstancePostProcessor instead"); @end diff --git a/Source/Factory/TyphoonComponentFactory.h b/Source/Factory/TyphoonComponentFactory.h index 3ed45eb93..40eeb8e53 100644 --- a/Source/Factory/TyphoonComponentFactory.h +++ b/Source/Factory/TyphoonComponentFactory.h @@ -13,6 +13,7 @@ #import #import "TyphoonDefinitionPostProcessor.h" +#import "TyphoonInstancePostProcessor.h" #import "TyphoonComponentsPool.h" @class TyphoonDefinition; @@ -81,11 +82,17 @@ /** Attach a TyphoonDefinitionPostProcessor to this component factory. -@param definitionPostProcessor The definition post processor to attach. +@param postProcessor The definition post processor to attach. */ -- (void)attachDefinitionPostProcessor:(id)definitionPostProcessor; +- (void)attachDefinitionPostProcessor:(id)postProcessor; -- (void)attachPostProcessor:(id)postProcessor DEPRECATED_MSG_ATTRIBUTE("use attachDefinitionPostProcessor instead"); +/** + Attach a TyphoonInstancePostProcessor to this component factory. + @param postProcessor The instance post processor to attach. + */ +- (void)attachInstancePostProcessor:(id)postProcessor; + +- (void)attachPostProcessor:(id)postProcessor DEPRECATED_MSG_ATTRIBUTE("use attachDefinitionPostProcessor instead"); @end diff --git a/Source/Factory/TyphoonComponentFactory.m b/Source/Factory/TyphoonComponentFactory.m index 8de5a308a..9a7488e55 100644 --- a/Source/Factory/TyphoonComponentFactory.m +++ b/Source/Factory/TyphoonComponentFactory.m @@ -242,15 +242,20 @@ - (void)enumerateDefinitions:(void (^)(TyphoonDefinition *definition, NSUInteger } } -- (void)attachDefinitionPostProcessor:(id)definitionPostProcessor { - LogTrace(@"Attaching definition post processor: %@", definitionPostProcessor); - [_definitionPostProcessors addObject:definitionPostProcessor]; +- (void)attachDefinitionPostProcessor:(id)postProcessor { + LogTrace(@"Attaching definition post processor: %@", postProcessor); + [_definitionPostProcessors addObject:postProcessor]; if ([self isLoaded]) { LogDebug(@"Definitions registered, refreshing all singletons."); [self unload]; } } +- (void)attachInstancePostProcessor:(id)postProcessor { + LogTrace(@"Attaching instance post processor: %@", postProcessor); + [_instancePostProcessors addObject:postProcessor]; +} + #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" - (void)attachPostProcessor:(id)postProcessor @@ -463,10 +468,12 @@ - (void)addDefinitionToRegistry:(TyphoonDefinition *)definition [_registry addObject:definition]; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" - (void)addInstancePostProcessor:(id)postProcessor { - [_instancePostProcessors addObject:postProcessor]; + [self attachInstancePostProcessor:postProcessor]; } - +#pragma clang diagnostic pop @end diff --git a/Source/Factory/TyphoonDefinitionRegisterer.m b/Source/Factory/TyphoonDefinitionRegisterer.m index eb89b22ee..56043773c 100644 --- a/Source/Factory/TyphoonDefinitionRegisterer.m +++ b/Source/Factory/TyphoonDefinitionRegisterer.m @@ -96,7 +96,7 @@ - (void)registerInfrastructureComponentFromDefinition [_componentFactory attachDefinitionPostProcessor:infrastructureComponent]; } else if ([_definition.type conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { - [_componentFactory addInstancePostProcessor:infrastructureComponent]; + [_componentFactory attachInstancePostProcessor:infrastructureComponent]; } else if ([_definition.type conformsToProtocol:@protocol(TyphoonTypeConverter)]) { [_componentFactory.typeConverterRegistry registerTypeConverter:infrastructureComponent]; diff --git a/Tests/Factory/Assembly/TyphoonAssemblyTests.m b/Tests/Factory/Assembly/TyphoonAssemblyTests.m index 2436f8a9a..bb4dffdc6 100644 --- a/Tests/Factory/Assembly/TyphoonAssemblyTests.m +++ b/Tests/Factory/Assembly/TyphoonAssemblyTests.m @@ -18,6 +18,7 @@ #import "MediocreQuest.h" #import "OCLogTemplate.h" #import "TyphoonPatcher.h" +#import "TyphoonInstancePostProcessorMock.h" @interface TyphoonAssemblyTests : XCTestCase @end @@ -215,18 +216,26 @@ - (void)test_nil_definition_with_injection_hooks } } -- (void)test_before_activation_stores_post_processors +- (void)test_before_activation_preattaches_infrastructure_components { MiddleAgesAssembly *assembly = [MiddleAgesAssembly assembly]; TyphoonPatcher *patcher = [TyphoonPatcher new]; [assembly attachDefinitionPostProcessor:patcher]; + TyphoonInstancePostProcessorMock *instancePostProcessor = [TyphoonInstancePostProcessorMock new]; + [assembly attachInstancePostProcessor:instancePostProcessor]; + TyphoonBlockComponentFactory *factory = [[TyphoonBlockComponentFactory alloc] initWithAssembly:assembly]; - NSArray *attachedPostProcessors = factory.definitionPostProcessors; - BOOL isPatcherAttached = [attachedPostProcessors containsObject:patcher]; + + NSArray *attachedDefinitionPostProcessors = factory.definitionPostProcessors; + BOOL isPatcherAttached = [attachedDefinitionPostProcessors containsObject:patcher]; + + NSArray *attachedInstancePostProcessors = factory.instancePostProcessors; + BOOL isInstancePostProcessorAttached = [attachedInstancePostProcessors containsObject:instancePostProcessor]; XCTAssertTrue(isPatcherAttached); + XCTAssertTrue(isInstancePostProcessorAttached); } @end diff --git a/Tests/Factory/TyphoonComponentFactoryTests.m b/Tests/Factory/TyphoonComponentFactoryTests.m index dbbebf7aa..3f0edd361 100644 --- a/Tests/Factory/TyphoonComponentFactoryTests.m +++ b/Tests/Factory/TyphoonComponentFactoryTests.m @@ -225,9 +225,9 @@ - (void)test_component_post_processors_applied_in_order TyphoonInstancePostProcessorMock*processor1 = [[TyphoonInstancePostProcessorMock alloc] initWithOrder:INT_MAX]; TyphoonInstancePostProcessorMock*processor2 = [[TyphoonInstancePostProcessorMock alloc] initWithOrder:0]; TyphoonInstancePostProcessorMock*processor3 = [[TyphoonInstancePostProcessorMock alloc] initWithOrder:INT_MIN]; - [_componentFactory addInstancePostProcessor:processor1]; - [_componentFactory addInstancePostProcessor:processor2]; - [_componentFactory addInstancePostProcessor:processor3]; + [_componentFactory attachInstancePostProcessor:processor1]; + [_componentFactory attachInstancePostProcessor:processor2]; + [_componentFactory attachInstancePostProcessor:processor3]; [_componentFactory registerDefinition:[TyphoonDefinition withClass:[Knight class]]]; __block NSMutableArray *orderedApplied = [[NSMutableArray alloc] initWithCapacity:3]; From 0abfa1350cc84f627ec1ac9aed46a8c1b3a8ed66 Mon Sep 17 00:00:00 2001 From: Egor Tolstoy Date: Sat, 7 Nov 2015 15:13:27 +0300 Subject: [PATCH 4/5] Added the capability of preattaching type converters --- Source/Factory/Assembly/TyphoonAssembly.m | 7 +++++++ Source/Factory/Internal/TyphoonBlockComponentFactory.m | 2 +- Source/Factory/TyphoonComponentFactory.h | 7 +++++++ Source/Factory/TyphoonComponentFactory.m | 5 +++++ Source/Factory/TyphoonDefinitionRegisterer.m | 2 +- Tests/Factory/Assembly/TyphoonAssemblyTests.m | 7 +++++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Source/Factory/Assembly/TyphoonAssembly.m b/Source/Factory/Assembly/TyphoonAssembly.m index 6848d70a0..8a667964a 100644 --- a/Source/Factory/Assembly/TyphoonAssembly.m +++ b/Source/Factory/Assembly/TyphoonAssembly.m @@ -220,6 +220,13 @@ - (void)attachInstancePostProcessor:(id)postProces [_factory attachInstancePostProcessor:postProcessor]; } +- (void)attachTypeConverter:(id)typeConverter { + if (!_factory) { + [self preattachInfrastructureComponent:typeConverter]; + } + [_factory attachTypeConverter:typeConverter]; +} + - (id)objectForKeyedSubscript:(id)key { if (!_factory) { [NSException raise:NSInternalInconsistencyException diff --git a/Source/Factory/Internal/TyphoonBlockComponentFactory.m b/Source/Factory/Internal/TyphoonBlockComponentFactory.m index d0e9575db..c14a22ac7 100644 --- a/Source/Factory/Internal/TyphoonBlockComponentFactory.m +++ b/Source/Factory/Internal/TyphoonBlockComponentFactory.m @@ -108,7 +108,7 @@ - (void)registerAllPreattachedInfrastructureComponents:(TyphoonAssembly *)assemb [self attachInstancePostProcessor:component]; } else if ([component conformsToProtocol:@protocol(TyphoonTypeConverter)]) { - [self.typeConverterRegistry registerTypeConverter:component]; + [self attachTypeConverter:component]; } } } diff --git a/Source/Factory/TyphoonComponentFactory.h b/Source/Factory/TyphoonComponentFactory.h index 40eeb8e53..4c3810261 100644 --- a/Source/Factory/TyphoonComponentFactory.h +++ b/Source/Factory/TyphoonComponentFactory.h @@ -14,6 +14,7 @@ #import #import "TyphoonDefinitionPostProcessor.h" #import "TyphoonInstancePostProcessor.h" +#import "TyphoonTypeConverter.h" #import "TyphoonComponentsPool.h" @class TyphoonDefinition; @@ -92,6 +93,12 @@ Attach a TyphoonDefinitionPostProcessor to this component factory. */ - (void)attachInstancePostProcessor:(id)postProcessor; +/** + Attach a TyphoonTypeConverter to this component factory. + @param typeConverter The type converter to attach. + */ +- (void)attachTypeConverter:(id)typeConverter; + - (void)attachPostProcessor:(id)postProcessor DEPRECATED_MSG_ATTRIBUTE("use attachDefinitionPostProcessor instead"); @end diff --git a/Source/Factory/TyphoonComponentFactory.m b/Source/Factory/TyphoonComponentFactory.m index 9a7488e55..fe8fbd089 100644 --- a/Source/Factory/TyphoonComponentFactory.m +++ b/Source/Factory/TyphoonComponentFactory.m @@ -256,6 +256,11 @@ - (void)attachInstancePostProcessor:(id)postProces [_instancePostProcessors addObject:postProcessor]; } +- (void)attachTypeConverter:(id)typeConverter { + LogTrace(@"Attaching type conveter: %@", typeConverter); + [_typeConverterRegistry registerTypeConverter:typeConverter]; +} + #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" - (void)attachPostProcessor:(id)postProcessor diff --git a/Source/Factory/TyphoonDefinitionRegisterer.m b/Source/Factory/TyphoonDefinitionRegisterer.m index 56043773c..0f692c60d 100644 --- a/Source/Factory/TyphoonDefinitionRegisterer.m +++ b/Source/Factory/TyphoonDefinitionRegisterer.m @@ -99,7 +99,7 @@ - (void)registerInfrastructureComponentFromDefinition [_componentFactory attachInstancePostProcessor:infrastructureComponent]; } else if ([_definition.type conformsToProtocol:@protocol(TyphoonTypeConverter)]) { - [_componentFactory.typeConverterRegistry registerTypeConverter:infrastructureComponent]; + [_componentFactory attachTypeConverter:infrastructureComponent]; } } diff --git a/Tests/Factory/Assembly/TyphoonAssemblyTests.m b/Tests/Factory/Assembly/TyphoonAssemblyTests.m index bb4dffdc6..37a023aa3 100644 --- a/Tests/Factory/Assembly/TyphoonAssemblyTests.m +++ b/Tests/Factory/Assembly/TyphoonAssemblyTests.m @@ -19,6 +19,7 @@ #import "OCLogTemplate.h" #import "TyphoonPatcher.h" #import "TyphoonInstancePostProcessorMock.h" +#import "NSNullTypeConverter.h" @interface TyphoonAssemblyTests : XCTestCase @end @@ -226,6 +227,9 @@ - (void)test_before_activation_preattaches_infrastructure_components TyphoonInstancePostProcessorMock *instancePostProcessor = [TyphoonInstancePostProcessorMock new]; [assembly attachInstancePostProcessor:instancePostProcessor]; + NSNullTypeConverter *typeConverter = [NSNullTypeConverter new]; + [assembly attachTypeConverter:typeConverter]; + TyphoonBlockComponentFactory *factory = [[TyphoonBlockComponentFactory alloc] initWithAssembly:assembly]; NSArray *attachedDefinitionPostProcessors = factory.definitionPostProcessors; @@ -234,8 +238,11 @@ - (void)test_before_activation_preattaches_infrastructure_components NSArray *attachedInstancePostProcessors = factory.instancePostProcessors; BOOL isInstancePostProcessorAttached = [attachedInstancePostProcessors containsObject:instancePostProcessor]; + BOOL isTypeConverterAttached = [factory.typeConverterRegistry converterForType:[typeConverter supportedType]] != nil; + XCTAssertTrue(isPatcherAttached); XCTAssertTrue(isInstancePostProcessorAttached); + XCTAssertTrue(isTypeConverterAttached); } @end From a84c7b2e609e98fc4920954cbfd6df6a95cfe186 Mon Sep 17 00:00:00 2001 From: Egor Tolstoy Date: Sat, 7 Nov 2015 15:26:22 +0300 Subject: [PATCH 5/5] Incapsulated the preattached components registration logic in a separate class --- .../Internal/TyphoonBlockComponentFactory.m | 21 ++------ .../TyphoonPreattachedComponentsRegisterer.h | 23 +++++++++ .../TyphoonPreattachedComponentsRegisterer.m | 48 +++++++++++++++++++ Typhoon.xcodeproj/project.pbxproj | 12 +++++ 4 files changed, 87 insertions(+), 17 deletions(-) create mode 100644 Source/Factory/TyphoonPreattachedComponentsRegisterer.h create mode 100644 Source/Factory/TyphoonPreattachedComponentsRegisterer.m diff --git a/Source/Factory/Internal/TyphoonBlockComponentFactory.m b/Source/Factory/Internal/TyphoonBlockComponentFactory.m index c14a22ac7..85cf91da8 100644 --- a/Source/Factory/Internal/TyphoonBlockComponentFactory.m +++ b/Source/Factory/Internal/TyphoonBlockComponentFactory.m @@ -22,6 +22,7 @@ #import "TyphoonTypeConverter.h" #import "TyphoonInstancePostProcessor.h" #import "TyphoonComponentFactory+TyphoonDefinitionRegisterer.h" +#import "TyphoonPreattachedComponentsRegisterer.h" @interface TyphoonComponentFactory (Private) @@ -62,7 +63,10 @@ - (id)initWithAssemblies:(NSArray *)assemblies self = [super init]; if (self) { [self attachDefinitionPostProcessor:[TyphoonAssemblyPropertyInjectionPostProcessor new]]; + TyphoonPreattachedComponentsRegisterer *preattachedComponentsRegisterer = [[TyphoonPreattachedComponentsRegisterer alloc] initWithComponentFactory:self]; + for (TyphoonAssembly *assembly in assemblies) { + [preattachedComponentsRegisterer doRegistrationForAssembly:assembly]; [self buildAssembly:assembly]; } } @@ -76,7 +80,6 @@ - (void)buildAssembly:(TyphoonAssembly*)assembly [assembly prepareForUse]; - [self registerAllPreattachedInfrastructureComponents:assembly]; [self registerAllDefinitions:assembly]; } @@ -97,22 +100,6 @@ - (void)registerAllDefinitions:(TyphoonAssembly *)assembly } } -- (void)registerAllPreattachedInfrastructureComponents:(TyphoonAssembly *)assembly { - NSArray *infrastructureComponents = [assembly preattachedInfrastructureComponents]; - - for (id component in infrastructureComponents) { - if ([component conformsToProtocol:@protocol(TyphoonDefinitionPostProcessor)]) { - [self attachDefinitionPostProcessor:component]; - } - else if ([component conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { - [self attachInstancePostProcessor:component]; - } - else if ([component conformsToProtocol:@protocol(TyphoonTypeConverter)]) { - [self attachTypeConverter:component]; - } - } -} - //------------------------------------------------------------------------------------------- #pragma mark - Overridden Methods //------------------------------------------------------------------------------------------- diff --git a/Source/Factory/TyphoonPreattachedComponentsRegisterer.h b/Source/Factory/TyphoonPreattachedComponentsRegisterer.h new file mode 100644 index 000000000..23b388c61 --- /dev/null +++ b/Source/Factory/TyphoonPreattachedComponentsRegisterer.h @@ -0,0 +1,23 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// TYPHOON FRAMEWORK +// Copyright 2015, Typhoon Framework Contributors +// All Rights Reserved. +// +// NOTICE: The authors permit you to use, modify, and distribute this file +// in accordance with the terms of the license agreement accompanying it. +// +//////////////////////////////////////////////////////////////////////////////// + +#import + +@class TyphoonComponentFactory; +@class TyphoonAssembly; + +@interface TyphoonPreattachedComponentsRegisterer : NSObject + +- (instancetype)initWithComponentFactory:(TyphoonComponentFactory *)componentFactory; + +- (void)doRegistrationForAssembly:(TyphoonAssembly *)assembly; + +@end diff --git a/Source/Factory/TyphoonPreattachedComponentsRegisterer.m b/Source/Factory/TyphoonPreattachedComponentsRegisterer.m new file mode 100644 index 000000000..cd9c9d825 --- /dev/null +++ b/Source/Factory/TyphoonPreattachedComponentsRegisterer.m @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// TYPHOON FRAMEWORK +// Copyright 2015, Typhoon Framework Contributors +// All Rights Reserved. +// +// NOTICE: The authors permit you to use, modify, and distribute this file +// in accordance with the terms of the license agreement accompanying it. +// +//////////////////////////////////////////////////////////////////////////////// + +#import "TyphoonPreattachedComponentsRegisterer.h" +#import "TyphoonComponentFactory.h" +#import "TyphoonAssembly+TyphoonAssemblyFriend.h" + +@interface TyphoonPreattachedComponentsRegisterer () + +@property (strong, nonatomic) TyphoonComponentFactory *factory; + +@end + +@implementation TyphoonPreattachedComponentsRegisterer + +- (instancetype)initWithComponentFactory:(TyphoonComponentFactory *)componentFactory { + self = [super init]; + if (self) { + _factory = componentFactory; + } + return self; +} + +- (void)doRegistrationForAssembly:(TyphoonAssembly *)assembly { + NSArray *infrastructureComponents = [assembly preattachedInfrastructureComponents]; + + for (id component in infrastructureComponents) { + if ([component conformsToProtocol:@protocol(TyphoonDefinitionPostProcessor)]) { + [self.factory attachDefinitionPostProcessor:component]; + } + else if ([component conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { + [self.factory attachInstancePostProcessor:component]; + } + else if ([component conformsToProtocol:@protocol(TyphoonTypeConverter)]) { + [self.factory attachTypeConverter:component]; + } + } +} + +@end diff --git a/Typhoon.xcodeproj/project.pbxproj b/Typhoon.xcodeproj/project.pbxproj index 018e28662..43297c981 100644 --- a/Typhoon.xcodeproj/project.pbxproj +++ b/Typhoon.xcodeproj/project.pbxproj @@ -538,6 +538,10 @@ 9F0F25331BEA2845002AD880 /* TyphoonNSColorTypeConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F0F25241BEA2327002AD880 /* TyphoonNSColorTypeConverter.h */; }; 9F0F25341BEA2859002AD880 /* TyphoonColorConversionUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F0F252E1BEA2571002AD880 /* TyphoonColorConversionUtils.h */; }; 9F0F25351BEA37B0002AD880 /* TyphoonTypeConversionUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F0F25131BEA1267002AD880 /* TyphoonTypeConversionUtils.m */; }; + 9F1187A11BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1187A01BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.m */; }; + 9F1187A21BEE2521008859E0 /* TyphoonPreattachedComponentsRegisterer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F11879F1BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.h */; }; + 9F1187A31BEE2536008859E0 /* TyphoonPreattachedComponentsRegisterer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1187A01BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.m */; }; + 9F1187A41BEE253E008859E0 /* TyphoonPreattachedComponentsRegisterer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1187A01BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.m */; }; 9F2C08A81BA0C7AF0049D751 /* TyphoonCollaboratingAssembliesCollector.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F2C08A71BA0C7AF0049D751 /* TyphoonCollaboratingAssembliesCollector.m */; }; 9F5E6FAC1BA15073000356A0 /* TyphoonCollaboratingAssembliesCollectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F5E6FAB1BA15073000356A0 /* TyphoonCollaboratingAssembliesCollectorTests.m */; }; 9F65CEDA1BA153850015765B /* TyphoonCollaboratingAssembliesCollector.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F2C08A71BA0C7AF0049D751 /* TyphoonCollaboratingAssembliesCollector.m */; }; @@ -1104,6 +1108,8 @@ 9F0F252A1BEA23E6002AD880 /* TyphoonNSColorTypeConverterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TyphoonNSColorTypeConverterTests.m; path = Tests/OSX/TypeConversion/TyphoonNSColorTypeConverterTests.m; sourceTree = SOURCE_ROOT; }; 9F0F252E1BEA2571002AD880 /* TyphoonColorConversionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TyphoonColorConversionUtils.h; path = Helpers/TyphoonColorConversionUtils.h; sourceTree = ""; }; 9F0F252F1BEA2571002AD880 /* TyphoonColorConversionUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TyphoonColorConversionUtils.m; path = Helpers/TyphoonColorConversionUtils.m; sourceTree = ""; }; + 9F11879F1BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TyphoonPreattachedComponentsRegisterer.h; sourceTree = ""; }; + 9F1187A01BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TyphoonPreattachedComponentsRegisterer.m; sourceTree = ""; }; 9F2C08A61BA0C7AF0049D751 /* TyphoonCollaboratingAssembliesCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TyphoonCollaboratingAssembliesCollector.h; sourceTree = ""; }; 9F2C08A71BA0C7AF0049D751 /* TyphoonCollaboratingAssembliesCollector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TyphoonCollaboratingAssembliesCollector.m; sourceTree = ""; }; 9F5E6FAB1BA15073000356A0 /* TyphoonCollaboratingAssembliesCollectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TyphoonCollaboratingAssembliesCollectorTests.m; sourceTree = ""; }; @@ -1547,6 +1553,8 @@ 6B076F491936F63A0083714E /* TyphoonComponentFactory.m */, 6B076F4A1936F63A0083714E /* TyphoonDefinitionRegisterer.h */, 6B076F4B1936F63A0083714E /* TyphoonDefinitionRegisterer.m */, + 9F11879F1BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.h */, + 9F1187A01BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.m */, ); path = Factory; sourceTree = ""; @@ -2562,6 +2570,7 @@ BA79830373597A7AA358C2D8 /* TyphoonCollaboratingAssemblyProxy.h in Headers */, 9F0591E11BE88408007CCB9C /* TyphoonStoryboardProvider.h in Headers */, 9F0591E01BE88404007CCB9C /* TyphoonViewHelpers.h in Headers */, + 9F1187A21BEE2521008859E0 /* TyphoonPreattachedComponentsRegisterer.h in Headers */, BA798EB0684A45DDBA818962 /* TyphoonBlockComponentFactory.h in Headers */, BA79808B1AE811F764E7B14F /* TyphoonCircularDependencyTerminator.h in Headers */, BA798A97C60EC12681B6AAF4 /* TyphoonAssemblyDefinitionBuilder.h in Headers */, @@ -2908,6 +2917,7 @@ 6B0770A41936F9000083714E /* TyphoonInjectionByCollection.m in Sources */, 6B0770A51936F9000083714E /* TyphoonInjectionByComponentFactory.m in Sources */, 9FDF58CE1BA4162100678B2B /* TyphoonStoryboardProvider.m in Sources */, + 9F1187A11BEE22F2008859E0 /* TyphoonPreattachedComponentsRegisterer.m in Sources */, 6B0770A61936F9000083714E /* TyphoonInjectionByConfig.m in Sources */, 6B0770A71936F9000083714E /* TyphoonInjectionByDictionary.m in Sources */, 6B0770A81936F9000083714E /* TyphoonInjectionByFactoryReference.m in Sources */, @@ -3142,6 +3152,7 @@ 6B0773B51937831B0083714E /* TyphoonAssembly.m in Sources */, 6B0773BF1937831B0083714E /* NSInvocation+TCFInstanceBuilder.m in Sources */, 6B0773C01937831B0083714E /* NSInvocation+TCFUnwrapValues.m in Sources */, + 9F1187A31BEE2536008859E0 /* TyphoonPreattachedComponentsRegisterer.m in Sources */, 6B0773C11937831B0083714E /* NSMethodSignature+TCFUnwrapValues.m in Sources */, 6B0773C21937831B0083714E /* NSValue+TCFUnwrapValues.m in Sources */, 6B0773C31937831B0083714E /* TyphoonCallStack.m in Sources */, @@ -3318,6 +3329,7 @@ 90ABC4051A36B1B4008D8162 /* TyphoonOptionMatcher.m in Sources */, 90ABC4061A36B1B4008D8162 /* TyphoonDefinition+Option.m in Sources */, 90ABC4071A36B1B4008D8162 /* TyphoonConfigPostProcessor.m in Sources */, + 9F1187A41BEE253E008859E0 /* TyphoonPreattachedComponentsRegisterer.m in Sources */, 90ABC4081A36B1B4008D8162 /* TyphoonJsonStyleConfiguration.m in Sources */, 90ABC4091A36B1B4008D8162 /* TyphoonPlistStyleConfiguration.m in Sources */, 90ABC40A1A36B1B4008D8162 /* TyphoonPropertyStyleConfiguration.m in Sources */,