I need to use many files with HTML or SQL templates. Now I load them at run-time and need to keep near executable.
I want to compile them into executable, but keep editing these files in external HTML or SQL editors - with highlight & options to validate or run.
I know that I can use Lazarus Resources (
https://wiki.freepascal.org/Lazarus_Resources) and load content using TResourceStream.
But I'm sure that using string consts will work much faster and be easier to use.
So what I need:
- enum all *.htm & *.sql files in directory of current unit
- create file with string consts (const name should be based on template file name)
- include this file into project
- when any of *.htm & *.sql is changed - file should be regenerated
- OS - Windows & Linux
Is something like this already available in FPC/Lazarus?
Maybe there is better idea?
Or I should create on my own solution, run it manually or connect using Project Options / Compiler Commands, Execute before?