How to get all modules in a package at CT?

Neia Neutuladh neia at ikeran.org
Sat Nov 24 16:17:00 UTC 2018


Easiest way is to put this in your build script:

find path/to/package -name '*.d' | \
   xargs grep '^module ' | \
   sed 's,^module,import,' \
   > data/modules.d

Add `-J data` to your DMD command line, or add `"stringImportPaths":
["data"]` to dub.json.

Then in your file:

mixin(import("modules.d"));


More information about the Digitalmars-d-learn mailing list