AutomaticSettings
AutomaticSettings copied to clipboard
Question - how to configure stencil + .sourcery.yml
Hi @krzysztofzablocki
I just opened a PR which compiles on mac.
I'm having issues though configuring the template + sourcery file.
Here is an example project
https://github.com/avnerbarr/TestSourcery
The workflow isn't completely clear to me.
I'm creating a "settings" struct and adding the conformance.
I see that in the yml there is an include to AutomaticSettingsProtocols.swift
. Isn't this part of the imported library?
sources:
include:
- AutomaticSettingsProtocols.swift <<<<<<<<<< this part
Also regarding the structure which I need to provide (the container views for Settings
?). Could you point me to an explanation of which views I should provide, and the usage of AutomaticSettingsViewModel
etc.
Thanks!
@avnerbarr
- the reason you need to include AutomaticSettingsProtocols.swift is that otherwise Sourcery doesn't know about those protocols so the template won't know your type implement them (depending on how you integrate you could copy the protocols and put them as private in your project so they don't clash with framework or just point sourcery at the source code file)
- as for Views you only need the main view, all the code I'm using for integration is in https://github.com/krzysztofzablocki/AutomaticSettings/tree/main/Example/Example/Settings%20Integration so you can copy the same setup, after that the only thing left is to just create an instance of your View / VM https://github.com/krzysztofzablocki/AutomaticSettings/blob/main/Example/Example/ExampleApp.swift#L35
@avnerbarr do you need more help?