Feature/appleguice swift#21
Open
Alexs1987 wants to merge 19 commits into
Open
Conversation
added 10 commits
December 5, 2017 21:17
The improvements - 1. The original code went over the same classes twice. Made sure each class is only deal with once. 2. Made sure we are not traversing over NSObject, <NSObject> protocol and classes that are prefixed with UI (Like UIView, UIViewController…) 3. Got rid of recursions and implemented everything iteratively. Recursion adds couple of more seconds to the execution time. 4. appleGuiceBootstrapper.sh has an option to exclude certain files (like .frameworks) or directories (like Pods) Overral I saw 70-80% improvement in the execution time.
…develop # Conflicts: # Bootstrapper/appleGuiceBootstrapper.cpp
Example usage - Place the prefixes you want to ignore as the last parameter - $(SHELL) $(PODS_ROOT)/AppleGuice/Bootstrapper/appleGuiceBootstrapper.sh . ./tmpAgBindings *.framework* Pods UI,NS
Owner
|
Hey Alex, |
added 5 commits
March 25, 2018 15:25
Author
|
Hey Tomer, I've added more unit tests for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings the ability to auto inject into swift classes.
Writing something like that in a swift class (That inherits eventually from NSObject)
@objc var _ioc_testService: TestServiceProtocol?Will cause AppleGuice to auto inject the implementation.
Moreover, in order for
NSProtocolFromStringandNSClassFromStringto work (Which are used extensively in AppleGuice code to read the mappings in the bootstrapper), we need to pass it something like that${MODULE_NAME}.{PROTCOL_NAME}(For example MyAwesomeFramework.MyAwesomeService).To get the module name we need to let the bootstrapper know in which module the current swift class/protocol resides. That we do by defining in each swift target/Dynamic framework a protocol called
${MODULE_NAME}AppleGuiceModule. Each injectable class/protocol in the module must conform to this protocol. That way the bootrapper will know how to represent the MyAwesomeService in the dynamic framework MyAwesomeFramework to MyAwesomeFramework.MyAwesomeService