RejectedSoftware Forums

Sign up

Wildcarding?

I've got a lots of individual sourceFiles statements like below:

sourceFiles "../common/camera.d"
sourceFiles "../common/cameraModule.d"
...

Can I do something like
sourceFiles "../common/*.d"

DUB did not like the above line.

Looked around the documentation but did not find anything.

Re: Wildcarding?

Am 06.02.2017 um 03:32 schrieb Kyle Heaser:

I've got a lots of individual sourceFiles statements like below:

sourceFiles "../common/camera.d"
sourceFiles "../common/cameraModule.d"
...

Can I do something like
sourceFiles "../common/*.d"

DUB did not like the above line.

Looked around the documentation but did not find anything.

It should actually accept that syntax in general (it calls glob() to
match files). The documentation mentions it only very implicitly by
calling the arguments "patterns".

I'll have to look at the implementation, but it may be that this is
hitting an edge case with the ".." in front of the path. Generally,
using source files from outside of the package folder is discouraged and
wouldn't work for packages registered on code.dlang.org, but as long as
that is accepted, it of course still needs to work properly.

Re: Wildcarding?

Am 08.02.2017 um 15:17 schrieb Sönke Ludwig:

Am 06.02.2017 um 03:32 schrieb Kyle Heaser:

I've got a lots of individual sourceFiles statements like below:

sourceFiles "../common/camera.d"
sourceFiles "../common/cameraModule.d"
...

Can I do something like
sourceFiles "../common/*.d"

DUB did not like the above line.

Looked around the documentation but did not find anything.

It should actually accept that syntax in general (it calls glob() to
match files). The documentation mentions it only very implicitly by
calling the arguments "patterns".

I'll have to look at the implementation, but it may be that this is
hitting an edge case with the ".." in front of the path. Generally,
using source files from outside of the package folder is discouraged and
wouldn't work for packages registered on code.dlang.org, but as long as
that is accepted, it of course still needs to work properly.

A quick look revealed that I was wrong and this is in fact not
implemented for "sourceFiles". There is a corresponding issue already:
#825

As a partial improvement, have you considered using:

sourcePaths "../common"
excludedSourceFiles "../common/somefile.d"

"excludedSourceFiles" also does support wildcards, so that might also help.