summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph
Commit message (Collapse)AuthorAgeFilesLines
* introduce class BuildGraphNodedynablasterJoerg Bornemann2013-11-2742-757/+1940
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support different types of nodes in the build graph, we introduce the base class BuildGraphNode. Artifact now derives from BuildGraphNode. A - yet unused - RuleNode class is introduced that represents a rule in the build graph. Change-Id: Ie1ad5e7a9e65bfd5f99d3e824737516053de0f94 ***new artifacts hash in ProductBuildData Change-Id: I50521ec64f734bfb3662759076fa5e7912ac084e ***automoc fixup Change-Id: Ie2bb228ae38d63deccc600d67d283bc3beda9fec slightly nicer rule debug output Change-Id: I60ddef73cd7f0a67055f2d56e6dbe7fa45ddd450 create RuleNode objects and add them to roots Change-Id: I51a0f89b98cda524d34888ab758d7bd397d82f00 ***execute rule nodes on build Change-Id: I291c32868cd982e37393d6bc8d696f2b63fbff50 ***ArtifactSet::fromNodeSet Change-Id: I7586bcfbe43406c22b1ee1a1fd826beaa247164f ***update after rebase Change-Id: I5f73afc80b746b11eeb83aeadf29c2358accbab8 ***phonytarget Change-Id: I587b7e072e54b866e8d5ea37c874e6a8baa550e0 update after rebase Change-Id: I6017c0cbe9244fea04d513f53e3a2a85092bf962 skip nodes early We must skip Building and Built nodes. m_leaves can contain duplicates now. Change-Id: If275106a47c403a455103f4deeb20049548007f5 debug message Change-Id: I90e238eef72a8a02fb0a9f2c77715f5f15c1442d disable phony thingy Change-Id: I7bb60b850b96b65ab738c11e96c3a84cbe58d2f7 connect each output of a rule to the rule itself Change-Id: I159d76c4b63094058cc9a07ccc2d0b67c7ce06e6 TagScanner Change-Id: I4741e48cd674c0ca830ee1b4d05b59a8c542694f TagScanner deps Change-Id: If3e43a7ac25616cd151229684a085ac8ee787645 update after rebase Change-Id: I58d49a5ed1049a17733fc2154588f12c1cda53e6 only root tag scanners in product Change-Id: Ia94732a5632156a5ec3c5518c9596cd4cefac105 run TagScanners Change-Id: I869a183f2da23a43957a6df45dc5a1b30b10af92 TagScannerRunner Change-Id: Id3c5fac73e6fb84e56d6ab1d48a959f3677f7a67 crash fix Change-Id: Ie3c26dbed41ab4615915a08913c495868c3a8910 more TagScanRunner Change-Id: I80b79f101c0f4d802fb4f6515c0848e369fed066 handle removal of filetags Change-Id: Icdd8d05c2e26953f7b12d968aa5dfcc23928b9ba Qt4 build fix Change-Id: Ie5fcb64e36ddc5004003183bea7243536bc8ab15 do not waste space with type information Change-Id: I7b9354e6fceead228ba335723b9addeb701bef56 update nodes that must get new transformers Change-Id: I06cd7ffe606ae643393350c5959ef6475343929f update after rebase Change-Id: If080e664972f2950c12fd800a3e4b521e65dca3a only run tag scanners on changed sources And do not call RulesApplicator in bgloader. Change-Id: I5140c91c79a842dab933ad7b328100bdec13cb10 Conflicts: src/lib/buildgraph/buildgraphloader.cpp sketch of moc tagscanners impl Change-Id: I7736c2da1b1742bc3556ef660c163e6c32cbd4c9 Conflicts: share/qbs/modules/Qt/core/core.qbs MocTagScanner Change-Id: I87199e8f355b8b20cf2387f4d4190a20bddae0db fix lib.qbs Change-Id: Ibcb5bc290d3839b04828f8c9b155577634bcc9e4 moctagscanner split Change-Id: Iace5d48483c02b5d33d9ccd54ac07162bfc09d27
* API: Allow to remove files from a product.Christian Kandeler2013-11-253-29/+38
| | | | | | | Task-number: QBS-20 Change-Id: Ia8b8c4745e8e68ec219e16876fb630d02453425b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2013-11-222-0/+26
|\ | | | | | | | | | | | | | | | | Conflicts: src/lib/language/moduleloader.cpp src/lib/language/tst_language.cpp src/lib/language/tst_language.h Change-Id: Iaaf4e015a234cdd9f51630ad218daec1b83b2a84
| * Take the qbs.install* properties into account when change tracking.Christian Kandeler2013-11-212-0/+26
| | | | | | | | | | | | | | | | | | | | | | These are currently ignored, because we only look for properties that were requested in prepare scripts. This does not typically happen for installation parameters, but since they end up in the output artifacts, changes to them still require re-setting up the respective build data. Task-number: QBS-359 Change-Id: I571cb4c1a02ea790ddde2f244136c6a0fd6fb627 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | prioritize artifacts by product when buildingJoerg Bornemann2013-11-143-11/+72
| | | | | | | | | | | | | | | | | | | | To prevent disk cache misses, esp. when using precompiled headers, we're prioritizing the artifacts we're building by product. Task-number: QBS-460 Change-Id: Iff2373147c2fe6f86ac79c9785c8c89260aba5b4 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2013-11-142-9/+20
|\ \ | |/ | | | | Change-Id: I7475c4a71c15c83c59400c44ef96d73d15caea58
| * Fix bug in rescuing build data.Christian Kandeler2013-11-112-9/+18
| | | | | | | | | | | | | | | | | | | | We tried to get information about an artifact's children from the artifact itself. However, that artifact could have gotten disconnected along the way and not know anything about its children anymore. We must therefore save such information in an extra data structure. Change-Id: Id2043f97e857bf8779184e88b1425fdcf85e3f2e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * Take rules into account when tracking changes.Christian Kandeler2013-11-111-0/+2
| | | | | | | | | | | | | | | | | | This will cause rebuilding if, for example, a rule in a module that the product uses gets its source code changed (and the rule is actually being used). Change-Id: I009685c85fcc8fa0ae3ecc7c32194685a1558104 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Rethrow exceptionTobias Hunger2013-11-131-1/+1
| | | | | | | | | | | | | | ... instead of throwing a copy Change-Id: Ic4a5701d72158d3ef67106493b22d528c890654a Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Fix meaning of "Command.silent".Christian Kandeler2013-11-064-7/+17
| | | | | | | | | | | | | | | | | | | | | | The new, saner meaning is: If this property is set to true, then qbs will not print the status message (containing the command description). Accordingly, the default is changed to false. Also, there is now a check that prints a warning if a non-silent command has an empty description. Change-Id: I5a8fd4e2f8901f6e2858946901e8081a6929d43f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Remove unused setters from the Command class.Christian Kandeler2013-11-061-5/+0
|/ | | | | Change-Id: Ic9613a904940eb97af509a60319ddce76f242cb2 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Check for duplicate product names.Christian Kandeler2013-10-281-3/+12
| | | | | | | | Strangely, no such check exists currently. Instead, one will typically get an internal error on the artifact level later on. Change-Id: Id9cd749a70564100bd7286b896f64cafbe9bfb73 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Take dependencies into account when tracking changes.Christian Kandeler2013-10-221-0/+15
| | | | | | | They are currently ignored. Change-Id: I94b89f9b7c6838106670d553429b297823ac861f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Prevent sibling artifacts from getting different transformers.Christian Kandeler2013-10-152-1/+6
| | | | | | | | | | | It is a strict requirement that all output artifacts in a rule point to the same Transformer object. This invariant can currently break under very specific circumstances related to build graph change tracking, which is likely the cause of QBS-379. Task-number: QBS-379 Change-Id: I85dc28e69794df5f50c5155171b393ab14ca6dbc Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* detect cycles in rule dependenciesJoerg Bornemann2013-10-142-4/+23
| | | | | | | | | | This fixes a stack overflow that occurred when having cycles in rule dependencies. Task-number: QBS-396 Change-Id: I1907ef66d74340c090b09be72d2352892baca986 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Add another build graph sanity check.Christian Kandeler2013-10-141-0/+5
| | | | | Change-Id: I9860fdea260ee53a04c5ba4e630ddf7cf4bfe7f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* in the scanner, only remove connections the scanner createdJoerg Bornemann2013-10-115-5/+11
| | | | | | | Task-number: QBS-394 Change-Id: I4659746be6004042949038450e2015fbb5f70b77 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Tell users which build graph we are talking about...Christian Kandeler2013-10-111-3/+4
| | | | | | | | ... when complaining about a project file mismatch. Task-number: QBS-382 Change-Id: I25ad56acace014fb03bb7eb55433823ba14d8978 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do not ever set up build data for disabled products.Christian Kandeler2013-10-022-2/+6
| | | | | | | | This currently happens when we add a new disabled product and a build graph already exists. Change-Id: I71825cf9057493a178d484c988eb06258ab89dbf Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do some build graph sanity checks.Christian Kandeler2013-09-306-4/+66
| | | | | | | Check some invariants after resolving, restoring and change tracking. Change-Id: I84e92d6f16a96d4a54c928e8cebc06efbf8fde2c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix calling of prepare script functionJoerg Bornemann2013-09-248-22/+45
| | | | | | | | | The scope that contains inputs, outputs and friends was bound to the function object, which is wrong when applying the function later on. Instead, we're passing those variables as function arguments now. Change-Id: I7ad7b6a742091fae889ed57b7c9cbceea4a2ead2 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix handling of disabled products when restoring.Christian Kandeler2013-09-201-4/+16
| | | | | | | | | If build data already exists (i.e. the product was not disabled before), we must not swap it over to the new product, and we need to remove all the artifacts from the build graph. Change-Id: I210f8da72a7252905a6c92f3db6b2a907922f7b0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add support for C, Objective-C and Objective-C++ precompiled headers.Jake Petroules2013-09-191-2/+2
| | | | | | | Task-number: QBS-278 Change-Id: I2999a64168f70aff21007e55d52314433425e84e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix imports/extensions for script propertiesJoerg Bornemann2013-09-192-4/+2
| | | | | | | | | Import directives in files of imported items were ignored for prepare scripts. We must use the file context (that contains the imports) of the file where the script property is set. Change-Id: Icca3fc84dd1e130446775122b7b58e6e9ddced98 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Transformer.explicitlyDependsOn addedJoerg Bornemann2013-09-181-0/+16
| | | | | Change-Id: If4f695878087f0cd72d85e497d918c4f70e42001 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* ResolvedTransformer::Ptr -> ResolvedTransformerPtrJoerg Bornemann2013-09-181-1/+1
| | | | | | | | Also introduce ResolvedTransformerConstPtr for consistency and use it where appropriate. Change-Id: I4922c71a681e970e57502269d8ee259dcacde39f Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix a number of bugs uncovered by a recent leak fix (ff5b33b82b).Christian Kandeler2013-09-114-57/+88
| | | | | | | | | | | | | | | To name just a few: - Product removal, adaptation and re-resolving/swapping build data was done in the wrong order, resulting in outdated information still being present and necessary new one not being there yet. - Outdated artifacts were deleted too early, so that look-ups into the old project build data would cause undefined behavior. - The list of products whose file list was changed could contain the same entry twice, causing asserts when the same code was run again for the same product. Change-Id: I0c318fb18d5a8293d863ea6802203200941b9b7b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove redundant method parameter.Christian Kandeler2013-09-093-15/+7
| | | | | | | Presumably the author thought the function was static. Change-Id: I5637493c6694edb15349d6189b098990471585be Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix artifact leaks in build graph loader and automoc.Christian Kandeler2013-09-094-5/+8
| | | | | Change-Id: I989d88c58586ab9b6fe9f7870432f7266a00b9cc Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix incorrect logging output.Jake Petroules2013-09-041-2/+2
| | | | | | | | | | | commandArgsToString will already always start with a space so the extra one was redundant and incorrect. empty string arguments are also quoted for clarity (these empty strings do get passed as actual arguments so this is good for debugging). Change-Id: Iba1c825a4ce62544b4df5e554c9453d2d2e22b10 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix crash on restoring.Christian Kandeler2013-08-301-0/+2
| | | | | | | Do not apply rules to disabled products. Change-Id: Ib9b32420ecefdc76e86c80ce2f4d1cb6ad44d4b4 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* AutoMoc: do not scan files twiceJoerg Bornemann2013-08-272-30/+24
| | | | | | | | We scanned files for the Q_OBJECT macro and then again to find moc_XXX.cpp includes. This can be done in one pass. Change-Id: I3b14be2a922ce244730b3ce21e7803c605ba59be Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* don't pass file tags to scanner pluginsJoerg Bornemann2013-08-273-41/+26
| | | | | | | The scanners already know the file tags they're responsible for. Change-Id: If5ed47bfc011357737df08e3fe834ec8fcf4318b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* rename class PrepareScript to ScriptFunctionJoerg Bornemann2013-08-262-3/+3
| | | | | | | | Later, we want to use this class for script function properties that have a name that's different from "prepare". Change-Id: Ic58a577116aa2b60b65b8648473bc84ff9d56aeb Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix tracking of added file tagsJoerg Bornemann2013-08-261-1/+3
| | | | | | | | An added file tag was used to apply rules but it was not stored in the artifact. Change-Id: I0d4ce6b7b1372310fb1825bb2e2c47181e293079 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix change tracking for properties requested from prepare scripts.Christian Kandeler2013-08-235-34/+112
| | | | | | | | | | | | | | When evaluating prepare scripts, we currently gather values requested from products as well as artifacts, but we do not differentiate between the two cases and upon restoring, we always compare the old property values to the product properties. This results in an insane amount of recompiling if any build system file changes due to false positives. With this patch, we record whether a property was requested from a product or an artifact, and use the right set of properties when tracking changes. Change-Id: Ib1fa4fad41019cfa7d3a10e0a91e7709c2f56414 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix over-eager cleaning operation.Christian Kandeler2013-08-231-1/+1
| | | | | | | | | Do not remove empty directories outside of the build tree. Artifacts can end up there via product.destinationDirectory. Task-number: QBS-325 Change-Id: I457400c31fa5f6e342c5479fd8e80fba8553bb13 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* API: Add ability to retrieve the list of files to be installed.Christian Kandeler2013-08-212-16/+52
| | | | | | | This sort of information is something an IDE would like to show. Change-Id: I2284f3e36c7ed90a880b1df9027a976b2ce7fb63 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Compile fix for BuildGraphLoader.Christian Kandeler2013-08-191-0/+1
| | | | | Change-Id: Iac3ff31fccb322cc5953d7d8b31c155a61f856cd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Even better handling of property changes when restoring a build graph.Christian Kandeler2013-08-192-21/+20
| | | | | | | | | | | | | | | | | | | | | | | In detail: - Fix the build config comparison function so that it not only checks whether keys present in both maps are the same, but also whether there are additional keys in one of the maps. - Do not abort loading a restored build graph when the comparison fails; instead, handle that condition the same way we handle changes in build system files, environment variables etc; that is, re-resolve the project and check whether the build data needs to be set up from scratch for any products. - Take overridden properties into account when comparing the old and new property maps. This has no effect on the command line client at the moment, because it does its own merging, but other API clients will benefit. A particularly nice "side effect" of this patch is that changing properties on the command line now works as expected with regards to change tracking. Task-number: QBS-374 Change-Id: I55583fb7a2ae78b80de225b09aa559229d851339 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix build error with Qt 4.Christian Kandeler2013-08-141-2/+4
| | | | | | | QSharedPointer::reset() is new in Qt 5. Change-Id: I6314aed42706b59b19fcc15f8d623f15cc942029 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Better handling of property changes when restoring a build graph.Christian Kandeler2013-08-146-112/+137
| | | | | | | | | | | | If a property change is discovered in any given product, the current code throws away the whole build graph, generates a new one and then re- inserts selected data from the old one. With this patch, we only regenerate the build data of the affected product (and still re-insert some existing data into it as to not rebuild artifacts that are up to date). Change-Id: I49e475c66dfb84ad20253ab53daf25acfe5a738b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Handle changes in transformers when re-using a stored build graph.Christian Kandeler2013-08-142-21/+57
| | | | | | | | Also fixes a bug when comparing file lists in products and sets up the infrastructure for additional checks. Change-Id: I65b15620e12651ed845a102eb5bfe98f9be458a9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Treat a product file the same way as other build system files...Christian Kandeler2013-08-141-4/+1
| | | | | | | | | | ... when doing change tracking after restoring a build graph. Changes in one product can influence properties in other products via the surrounding project. Change-Id: I4294b326280e676939de9533309fdfa9146f9e92 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove redundant check when setting up properties.Christian Kandeler2013-08-131-3/+2
| | | | | | | | We only want to prevent the modules property from being exported, so let's just say that. Change-Id: I6d9ccfaf72cf0b9de4bc9d435b633dc659f57f95 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Don't check for QVariant::isValid() when setting up observed properties.Christian Kandeler2013-08-131-2/+2
| | | | | | | | An invalid QVariant can be the result of an undefined property, whose uses still need to be tracked. Change-Id: I66c74ae0a36b2f597a2774221bafac7fb3e994d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* introduce Transformer::product()Joerg Bornemann2013-08-124-8/+11
| | | | | | | | Simplifies the calling code. Remove pointless nullpointer check from jscommandexecutor. Change-Id: I867181d2b750f32f04376ce860f5dee6555d3e33 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Use the canonical way of moc file inclusion.Christian Kandeler2013-08-081-1/+1
| | | | | Change-Id: I8fbd49fb0997338019d9f8cb85155cfc673eac16 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* sort files in buildgraph.priJoerg Bornemann2013-08-021-36/+36
| | | | | Change-Id: I46d2963aed1be00a79a129f61f447a4685e56055 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* unmystify the serialization of artifactsJoerg Bornemann2013-08-022-56/+12
| | | | | | | | | Move the serialization responsibility to Artifact itself. Do not store parents. They are merely backpointers that can be restored after loading. Change-Id: I82b07f6ac07bd74b638985d86635894330743558 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>