How add all folders of a diretory using -J ?

WebFreak001 d.forum at webfreak.org
Thu Apr 2 07:00:11 UTC 2020


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)


More information about the Digitalmars-d-learn mailing list