Support for async codegen and Sourcery 2.2.3#359
Support for async codegen and Sourcery 2.2.3#359art-divin wants to merge 6 commits intoMakeAWishFoundation:masterfrom
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.
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.
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
swifttemplateDetails
In order to be able to generate the code concurrently for every type, shared state needs to be removed.
This PR does the following: