Re: [Qbs] Passing paths to properties

2020-02-05 Thread Christian Kandeler
On Tue, 4 Feb 2020 21:40:24 +0300
Alberto Mardegan  wrote:

> I was happy to see that the FileInfo.resolvePath() already exists. :-)
> It's not documented, however; is there any reason for that, or should we
> add it to the reference?

The missing documentation is probably unintended.


Christian
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Passing paths to properties

2020-02-04 Thread Alberto Mardegan
On 03/02/20 15:37, Christian Kandeler wrote:
>>
>> This and in addition - since the documentation already calls the property a
>> "path" [1] - introduce a path property type in Qbs which does that
>> automatically for us in its toString() method.
> 
> https://doc.qt.io/qbs/language-introduction.html#property-types

It seems to me, though, that this "path" type is little more than an
alias to "string", in that it doesn't have any methods and doesn't seem
to be treated specially.

Anyway:

  https://codereview.qt-project.org/c/qbs/qbs/+/289261

I was happy to see that the FileInfo.resolvePath() already exists. :-)
It's not documented, however; is there any reason for that, or should we
add it to the reference?

Ciao,
  Alberto

-- 
http://www.mardy.it - Geek in un lingua international
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Passing paths to properties

2020-02-03 Thread Christian Kandeler
On Sat, 1 Feb 2020 09:30:33 +0100
Richard Weickelt  wrote:

> > 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?
> 
> You mean qbs.installDir? That is - by definition - relative to 
> qbs.installRoot.
> 
> > 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?
> 
> This and in addition - since the documentation already calls the property a
> "path" [1] - introduce a path property type in Qbs which does that
> automatically for us in its toString() method.

https://doc.qt.io/qbs/language-introduction.html#property-types


Christian
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Passing paths to properties

2020-02-01 Thread Richard Weickelt
> 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?

You mean qbs.installDir? That is - by definition - relative to qbs.installRoot.

> 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?

This and in addition - since the documentation already calls the property a
"path" [1] - introduce a path property type in Qbs which does that
automatically for us in its toString() method.

[1] https://doc.qt.io/qbs/qml-qbsmodules-android-sdk.html#sourcesDir-prop
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] Passing paths to properties

2020-01-31 Thread Alberto Mardegan
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?


Ciao,
  Alberto

-- 
http://www.mardy.it - Geek in un lingua international
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs