[Qbs] Passing paths to properties

Alberto Mardegan mardy at users.sourceforge.net
Sat Feb 1 08:58:53 CET 2020

Hi there!
  I was trying to customize the location of my Android resources within
a project, by playing with the resourcesDir and sourceSetDir properties.

It took me a while (and a look at the QBS Android.sdk module sources) to
realize that I should pass an *absolute* path to these properties.
Indeed, prefix these paths with product.sourceDirectory made everything
work fine.

I believe that most other properies which accept a path (like
installDir, and the prefix property within a Group) all happily accept a
relative path, so can we consider this a bug in Android.sdk?

Also, while thinking about a solution to this, I was thinking that a
resolvePath() method in the FileInfo service could be useful:

  var path = ... // absolute or relative
  var absolutePath = FileInfo.resolvePath(path, basePath);

which would return path, if it's already absolute, or join it with
basePath if path is relative.

Would this be a useful addition, or do we already have something like
this in QBS?


http://www.mardy.it - Geek in un lingua international

More information about the Qbs mailing list