Skip to content
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

#970 - Allow for additional template Modifiers #983

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

artman41
Copy link
Contributor

@artman41 artman41 commented Jul 4, 2023

Implements #970

  • Templates now exist under templates/
  • Templates can now have a directory and extension defined
  • Added hrl template
  • Updated supervisor template to include Child Specs
  • Made some bootstrap templates generateable via new

@artman41 artman41 changed the title !970 - Allow for additional template Modifiers 970 - Allow for additional template Modifiers Jul 4, 2023
@artman41 artman41 changed the title 970 - Allow for additional template Modifiers #970 - Allow for additional template Modifiers Jul 4, 2023
@artman41 artman41 force-pushed the updated_templates branch 2 times, most recently from 90a238b to cf901e7 Compare July 4, 2023 23:25
@essen
Copy link
Member

essen commented Nov 5, 2024

Please also rebase this one.

* Templates now exist under templates/
* Templates can now have a directory and extension defined
* Added hrl template
* Updated supervisor template to include Child Specs
* Made some bootstrap templates generateable via new
@artman41
Copy link
Contributor Author

@essen rebased this one 👍

@essen
Copy link
Member

essen commented Nov 16, 2024

Thank you!

@essen
Copy link
Member

essen commented Nov 19, 2024

I think I would take a different approach. It would be good if template files were completely outside of Makefiles in the Erlang.mk source, as well as in third party plugins. This would make editing and testing them simpler. Of course the compiled Erlang.mk file should include them inside the file, not separately. So it all comes down to being able to declare templates that will be loaded from a file if the corresponding variable doesn't exist, and making the Erlang.mk build embed the files inside variables.

If templates become core functionality, then the entire bootstrap plugin probably should be core as well. Not much remains.

I will work on something.

@essen essen mentioned this pull request Nov 21, 2024
@essen
Copy link
Member

essen commented Nov 21, 2024

I have opened #1013 for my version of the thing. Almost all templates including internal have been replaced. Makefiles remain. Some plain substitution happens for module names and whatnot. Erlang.mk still embeds templates but it's possible to use tpl_my_template = $(file < templates.my_template) to define a template, I will probably port the Cowboy templates as a third party plugin using this method (so these will never be embedded). There's still some more work to do but it's getting there. Once the core of the changes is done I'll leave it up to you to update the templates, add the hrl one and any other small things.

By the way do you remember why you moved them to core?

@essen
Copy link
Member

essen commented Nov 22, 2024

I have merged my changes: a6f9a45

When you have time, please add the additional templates and template fixes you included in this PR or were thinking of including.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants