fix calculation of old inputs for dynamic rules

Instead of deducing the old inputs of a rule from the inputs of its
created transformers, we hold a dedicated list of old inputs, because
the former approach doesn't work for dynamic rules.

This fixes a speed regression introduced in 32c4d3d7.
The outputArtifacts script of dynamic rules was always run on
compatible inputs that were not input of transformers, e.g.
C++ sources that don't have a Q_OBJECT macro.

Change-Id: I2d43fa7c91ed9084bd27dc9b948c06152bfce726
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Tests: Move waitForNewTimestamp() function to shared file.

We want to use it in the API tests too.

Change-Id: I8fad090ea98f67e50b7b2a8e3854c5b618172364
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
fix setup of cpp.compilerPathByLanguage

The existence of the correct compiler binaries was checked, but the
compilerPathByLanguage map was never updated. It always contained
the initial strings "gcc", "g++" and so on.

Change-Id: Ied9e164af0fd102b2a061665921f51f96ca9eb80
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Invalidate project after certain unsuccessful re-resolving attempts.

Namely, if the build data has been mangled by the re-resolving attempt.

Change-Id: Ibe020a6bda38a335f95e2d2cef4f37fac3199a7d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Add missing comma to error message.

Change-Id: I90b1b4dd35c6b2c625d11137e0f7d76d92641f72
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Avoid contractions in user-visible messages.

Change-Id: I68685166bfaa873f1e5995c7d507afef45b03055
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
add trace output for RuleNode::apply

Change-Id: Icbb514d6ec2b13f2660cf86003aea0c6bbd8e132
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
fix condition for "conflicting rules" error

Change-Id: I3877fcee643e1b80b2ee5030bc2dd98bb13244cd
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Speed up artifact removal.

The current recursive algorithm for removing an artifact from the input
set of all rule nodes, while admittedly very l33t-looking, results in
a quasi-infinite loop when a larger number of artifacts are to be
removed. Instead, we now simply iterate over the list of nodes.
A further speed-up might be possible by doing batch changes, but this
one solves the immediate problem.

Change-Id: Id3c19321c82d5097e58b1b312c8717c59dc06eb3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
add getter/setters for Artifact::fileTags

The setters take care of keeping the product's artifact-by-filetags hash
up to date. Before, one had to set up the artifact's file tags before
insertArtifactToProduct was called. Otherwise the hash didn't get updated.

Change-Id: Ibb530d2c992d72c0a99152009b4e6eecbf770098
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
do not call createOutputArtifacts for the same filePath more than once

Task-number: QBS-645
Change-Id: Ia54f71ed7543617ba0b44f05e868a899a7c42e9b
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
do not add file tags to re-used output artifacts

This was needed when we createOutputArtifact was called multiple times
for the same file path. This doesn't happen anymore.

Task-number: QBS-645
Change-Id: Ia99975ee64a183fa5718a2dd56ff4ce1bb11f2ed
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
set alwaysUpdated and properties for re-used Artifact objects

Otherwise we can end up with outdated values.

Task-number: QBS-645
Change-Id: If953d9530f3211666e903b2615410ed9ba2ac0f0
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Autotests: Make "copy and touch" operation atomic.

On Windows, QFile::copy does not update the timestamp on the target
file.
This fixes the "projectInvalidation" API test on that OS.

Change-Id: I01c232de0f4e5e9bc5d2d28c24d5fb5516a58ca3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
add test for dynamic multiplex rule inputs

Task-number: QBS-645
Change-Id: Ib14533084c575d91cc937ca1f7e05145c06b108f
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
multiplex rules now always see all inputs

Multiplex rules now always see all inputs they're interested in and not
only the compatible inputs that are out of date.
Also, we do not need to re-use transformers, because that's a fruitless
optimization attempt that complicated the code.
Eventually, we're able to remove the hard-to-grasp "regenerating
transformer" block.

Task-number: QBS-645
Change-Id: I86dd307ee6ffa95baddd4e49307f0c1816e29901
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Lower the logger level for sanity check output.

Nobody ever wants to see these messages on log level "debug".

Change-Id: Ic999ee5381099421b7aedf2279d060a4e9555fbd
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
move Transformer creation out of createOutputArtifact

We don't re-use transformers anymore, so let's create them
unconditionally.

Change-Id: Iab0b1afe0f6b6224e1a24373ea94254b79847449
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Set minimum qbs version.

Change-Id: I9f1a349c8e34052d322f3cce1bc7da1a35f93764
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Be smarter about storing property maps.

The current code just dumps such maps into the file via the ">>"
operator, so no strings are shared. This patch fixes that.
Example results for building Qt Creator:
Size of build graph on disk: ~65 MB -> ~34 MB.
Size of build graph in memory: ~250MB -> ~150 MB.

Change-Id: Ic89d0f6c37ba1cd7b3aa8a35517bb6a6a37061c2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>