[Qt-creator] [Qbs] Qtc+Qbs+git wroktree = cannot lock build graph
Eike Ziller
Eike.Ziller at qt.io
Wed Dec 13 08:58:36 CET 2017
> On 12. Dec 2017, at 23:02, Christian Gagneraud <chgans at gmail.com> wrote:
>
> On 12/12/2017 9:56 PM, Christian Kandeler wrote:
>> On Tue, 12 Dec 2017 10:03:58 +1300 Christian Gagneraud
>> <chgans at gmail.com> wrote:
>>> Not sure if it's a Qtc or a Qbs issue, but here is my problem: I'm
>>> using git worktrees, which means i have the same project
>>> checked-out on different branches in different sibling directories,
>>> the main qbs files have the same name, and so by default, Qtc try
>>> to use the same build directory, luckily qbs refuse to go ahead
>>> (not sure if with qmake i'll get a warning about that). Anyway, the
>>> solution is to edit the project's build settings. It's OK, but it's
>>> a bit annoying over time. What about if Qtc would hash the path to
>>> the project file and use it (as a prefix) to name the default build
>>> folder?
>> Shouldn't you be able to set
>> Tools->Options->Build&Run->General->Default build directory to a
>> value that makes sense for your setup?
>
> Yes, I would need to add a unique marker based on CurrentProject::FilePath, is there a javascript function to calculate a hash of the file path?
>
> So my case is:
>
> $ cd ~/Projects/$project
> $ ls
> master
> <branch1>
> <branch2>
> ...
>
> Each <branch> directory contains a git worktree, so they all have the same project name and so the same location and directory name for their build: ~/Projects/$project/build-<project>-<kit>-<config>, i would like to have ~/Projects/$project/build-<project>-<kit>-<config>-<hash-of-project-filepath>.
Maybe you could use %{CurrentProject:VcsTopic}
Otherwise
%{JS:Util.completeBaseName("%{CurrentProject:Path}”)}
will expand to the last path component of the project file, e.g. if the project file is
"/foo/bar/1.0/foo.pro"
it will expand to
“1.0”
(The JS variable will evaluate the javascript following “JS:”; you find the methods that are available in “Util” here: http://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/coreplugin/corejsextensions.h .)
Br, Eike
--
Eike Ziller
Principal Software Engineer
The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
More information about the Qt-creator
mailing list