Refactor BuildGraphLoader::trackProjectChanges().

It's becoming hard to keep an overview of which checks are being done to
find out whether we need to re-resolve, so introduce one function per
check.
In addition, skip checks if we already know we need to re-resolve.

Change-Id: I6abeb41c6089e7fb7a0bfa2e69361ab8e58f477f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Handle "indirect" changes to a product's file list.

If the list of source files in a product changed without the respective
file having been touched (e.g. because the list was dependent on an
environment variable), we re-resolved the product, but we did not touch
the build data, so the new file was not compiled.

Change-Id: Ib63020339aa0bbc2a858ed22f938ab76fb0611c5
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Use previous results of calls to "File.exists()" in change tracking.

This is the same kind of "external change" as those coming from the
environment or JavaScript files, and is thus handled the same way.

Change-Id: I0a097d6d5c39ece859e6784f65f77f35a7273d59
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Set engine environment before starting the module loader.

This was wrong all along, resulting in potentially different results
of calls to qbs.getenv() during evaluation.

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