On Thursday, 15 December 2016 at 02:58:11 UTC, rikki cattermole
wrote:
I did a lot of work in this area.
There are two solutions:
1) Use a package file and public import all modules via it.
From this do some form of 'registration' in a module
constructor. Using __traits(allMembers, retrieve the imports
and with that the other modules.
2) Before compilation create a file that contains a list of all
the module names.
I prefer 2 now days.
It's not D modules. I'm talking about loading dynamic file
content from dynamically created files. The first one won't work,
because it only imports modules and you still have to give DMD
each module that you compile.
The second one won't work either, because again the files are not
D modules. They're regular files that I need to handle at
compile-time.
Besides your suggestion still requires manual work, which is what
I need to avoid. I know how I can do it by specifying the files,
but that's exactly what I want to avoid. I don't want to specify
which files I need to handle, I just need to be able to handle
all files in a folder without having to specify them somewhere
after the creation.