I did it wrong. Although the template context can be read from a classpath (as per the transformer adapter), the templates themselves are expected to be in the current project's file structure.
I originally needed the standard model (ie the model context) to be defined in a single place, and to have downstream modules use those contexts to generate different types of file - java, cpp, python etc. But newly user-defined modules need to define their own YAML contexts, and use the existing templates (available as resources) to generate their code. They're defining their YAML, but importing their templates.
[x] Enable both context and templates to handle classpath URLs.
There are other issues we might sweep up too.
[x] It should be called a "templating" plugin, not a "transformer" plugin;
[x] Test resources (templates, contexts) should be available on top of non-test ones (not instead of as currently);
[x] It still needs to be able to read from the file structure;
[x] It should support adding multiple template files to a given mustache instance, to allow template importing. We really need this to mitigate huge copy+paste areas in our existing templates, esp responses vs notification-sections.
[x] Use SnakeYAML instead of Jackson, to get default <<: behaviour - even though I think we can't use it in Zscript due to MrBean etc.
I did it wrong. Although the template context can be read from a classpath (as per the transformer adapter), the templates themselves are expected to be in the current project's file structure.
I originally needed the standard model (ie the model context) to be defined in a single place, and to have downstream modules use those contexts to generate different types of file - java, cpp, python etc. But newly user-defined modules need to define their own YAML contexts, and use the existing templates (available as resources) to generate their code. They're defining their YAML, but importing their templates.
There are other issues we might sweep up too.
<<:
behaviour - even though I think we can't use it in Zscript due to MrBean etc.