[QBS] Re-do the wildcard implementation.

Poenitz Andre Andre.Poenitz at digia.com
Tue Jan 15 11:23:07 CET 2013


André Somers wrote:
> Op 14-1-2013 11:07, Ruslan Nigmatullin schreef:
> > 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.
> 
> To me, this pattern looks really, really unclear. Even with your
> explanation, it makes very little sense to me. I'm quite sure I'll not
> be the only one to be confused.
>
> André

I find it rather nice, compact, and way more powerful than a few boolean flags. 

Whether it fits "in spirit" I don't know, but I don't think it opens the door
for issues the flags version doesn't have.

The other Andre'



More information about the Qbs mailing list