-
Notifications
You must be signed in to change notification settings - Fork 118
Support for async codegen and Sourcery 2.2.3 #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
d818256
to
0f27e9a
Compare
This could probably overrule #352 |
Templates/Main.swifttemplate
Outdated
<%_ var all = types.all | ||
all += types.protocols.map { $0 } | ||
all += types.protocolCompositions.map { $0 } | ||
func generate(type: Type, methodRegistrar: MethodRegistrar, subscriptRegistrar: SubscriptRegistrar) async -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @markst , actually the screenshot looks fine. There's a print statement below, and the contents of the file on the screenshot is not the final code which would go into the generated mock
We might also need to update |
I've built from this branch multiple times:
but using the build binary:
Insists on the template including
I can't work out where this template is coming from, it's determined not to use the template in your branch despite building from checked out branch. |
Ah! it's because we need to update the base64 encoded files at |
<%_ var all = types.all | ||
all += types.protocols.map { $0 } | ||
all += types.protocolCompositions.map { $0 } | ||
func generate(type: Type, methodRegistrar: MethodRegistrar, subscriptRegistrar: SubscriptRegistrar) async -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think we're just missing an opening tag:
func generate(type: Type, methodRegistrar: MethodRegistrar, subscriptRegistrar: SubscriptRegistrar) async -> String { | |
<%_ | |
func generate(type: Type, methodRegistrar: MethodRegistrar, subscriptRegistrar: SubscriptRegistrar) async -> String { |
Related to krzysztofzablocki/Sourcery#1308
Context
This PR adds facilities to support concurrent codegen based on
swifttemplate
Details
In order to be able to generate the code concurrently for every type, shared state needs to be removed.
This PR does the following: