www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How add all folders of a diretory using -J ?

reply Baby Beaker <thegrapevine email.com> writes:
Exemple:

Inside folder Project I have ten folders. How can I add this ten 
folders using dmd and -J command? I don't want add one by one.
Apr 01 2020
parent WebFreak001 <d.forum webfreak.org> writes:
On Wednesday, 1 April 2020 at 23:19:39 UTC, Baby Beaker wrote:
 Exemple:

 Inside folder Project I have ten folders. How can I add this 
 ten folders using dmd and -J command? I don't want add one by 
 one.
you could use `-J .` (-J projectFolder) so in your imports you can use `import("subfoldername/textfile.txt")`. For -J I would definitely recommend that because it avoids potential duplicate filenames for your 10 different folders. Though obviously with this approach you will have to specify the folder names each time, which you might or might not want. Otherwise you will need to manually list them or add a small script for this in your build process. If you use dub, you will have to manually list them out in the JSON/SDL, though supporting globs for this would be a pretty cool additional feature. Currently dub only supports globs for removing source files (because it can do it without filesystem access)
Apr 02 2020