[QBS] Re-do the wildcard implementation.

Ruslan Nigmatullin euroelessar at yandex.ru
Mon Jan 14 11:07:05 CET 2013


As it was shown, file pattern semantic is not clear right now in qbs and compete with bash patterns.

It was proposed to use zsh-style patterns, which are very similiar with wildcard patterns, but introduce one more synax sugar: "**" (double stars), documentation (bash, 4.0) says, that:

> The pattern ** used in a pathname expansion context will match all files and zero or more directories and subdirectories.
> If the pattern is followed by a /, only directories and subdirectories match.

So the pattern "src/**/*.cpp" will handle _all_ "*.cpp" files in "src" and all subdirectories of "src", I think this semantic is rather clear and, as we see, it's easy to be documented.

So,
Group { recursive: true; files: "artwork/*" }
can be replaced by
Group { file: "artwork/**/*" }
and their behaviour is absolutely identical.

As additional bonus with this flag we can use both recursive and non-recursive targets in one Groups, which can simplify qbs-based build scripts.

--
Ruslan Nigmatullin



More information about the Qbs mailing list