[Qbs] Writing a custom script by QBS
Christian Kandeler
christian.kandeler at qt.io
Fri Oct 20 11:06:30 CEST 2017
On Fri, 20 Oct 2017 16:41:33 +0800
Ben Lau <xbenlau at gmail.com> wrote:
> From my first email, I have raised few examples
>
> deployment = depends on a product's output , but no output file
> starting a mock server = no dependence, just run a command, never stop, no
> output file
The "never stop" part is of course not so well-suited for a build process. You'd probably just run a script there that starts the real process in the background and then returns.
> To simulate the condition of `code analysis`, I made this script and just
> run `ls` command (in real case, it should be replaced by another tools)
[ ... ]
> That works for the first time, but if I run `qbs -p ls` again. That will
> just report:
>
> $ qbs -p ls
>
> Restoring build graph from disk
> Building for configuration default
> Build done for configuration default.
>
> Any solution for this problem?
By default, rules only run if they have to, that is, if an input file was updated or a property that was used in the script has changed. If you don't want that, you can set the "alwaysRun" property to true.
You might want to take a look at the documentation, by the way: https://doc.qt.io/qbs/rule-item.html
Christian
More information about the Qbs
mailing list