ninenines / erlang.mk

A build tool for Erlang that just works.
https://erlang.mk
ISC License
578 stars 241 forks source link

erlydtl plugin won't recompile templates when template in {% include %} or {% extends %} tag got changed #230

Open brigadier opened 9 years ago

brigadier commented 9 years ago

Django templates can be dependent on other templates with {% include %} and {% extends %} tags. Erlydtl compiles such templates as monolithic one, it won't call one template from another. As erlang.mk depends on file change timestamps, such templates don't get recompiled.

As a workaround I do touch ./templates/* && make app, but it would be nicer to have a builtin detection of inheritance and dependency.

essen commented 9 years ago

We can do a recompile of all templates if one changed. Does that sound good? Looking inside templates is the road to madness, though.

brigadier commented 9 years ago

No, don't think it's good to recompile everything,

essen commented 9 years ago

Then I am open to suggestion for a solution. Parsing all files is not a very good idea I think, because if you're going to parse everything you might as well just recompile everything.

brigadier commented 9 years ago

Sure, parsing doesn't look so good too. I've opened the issue mainly to have it tracked, not for immediate solution.

essen commented 9 years ago

I think I will add a recompile of all templates when one has changed, that should be better than the current behavior anyway.

essen commented 9 years ago

I think we can do without parsing all files. We only need to detect includes and base templates and make a set of dependency rules to recompile everything needed, the same way erlc -M does.