aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language
Commit message (Collapse)AuthorAgeFilesLines
* Amend property evaluation optimization.v1.3.4Christian Kandeler2015-02-161-3/+5
| | | | | | | | | There is code further down in the chain (e.g. setupBuildEnvironment()) that expects the first module instance it finds to contain the right definition for all its properties. So make sure that is the case. Change-Id: I55f10d626f5be7ec8502f54e0b1a9673df0b5d93 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Don't evaluate properties that will never be seen.Christian Kandeler2015-02-132-35/+88
| | | | | | | | | | | | | During project resolving, we can make use of our knowledge of how the PropertyFinder works, skipping evaluation for "shadowed" properties. In the long term, we might want to get rid of the nested modules map altogether and replace it with a "flat" map (with special support for mergeable list values). Task-number: QBS-746 Change-Id: I75f62239daadce1f8826444a2e3b3a51d581df98 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* fix scalar property lookup some moreJoerg Bornemann2015-02-101-1/+18
| | | | | | | | | | | | | | | | | | Let there be a product P that depends on module A. Module A depends on module B.A sets B.foo to 1. Default value of B.foo is 0. The value of product.moduleProperty("B", "foo") is 1. Now add the direct dependency B to P. P does not overwrite the default value of B.foo. The overwritten value of B.foo from A takes precedence. This semantics change is needed to make sure that adding/removing modules to a product does not change property values in surprising ways. Task-number: QBS-736 Change-Id: I73152a24649bc670a9075e82998ef2b0d8709a84 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* fix look-up of scalar propertiesJoerg Bornemann2015-01-296-37/+59
| | | | | | | | | | | | | | | | | The property map of a product used to contain all modules of the dependency tree as direct children. The same was true for the product's Item. This setup was done in ModuleLoader::createAdditionalModuleInstancesInProduct. The whole approach led to problems when retrieving module values from modules deeper in the dependency hierarchy. Basic idea of this fix is to make ProjectResolver::resolveModule recursively walk the module dependency tree instead of trying to gather information on the root level. Change-Id: Icf1325272f90d7924437f41ca6f403d7264ce84c Task-number: QBS-726 Task-number: QBS-706 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* enhance error message for failing environment setupJoerg Bornemann2015-01-281-1/+1
| | | | | | Change-Id: Ia542e2ffe1fe2d4d89fd2da62bf7d465cf040014 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* fix caching for properties transitively dependent on productJoerg Bornemann2015-01-275-3/+46
| | | | | | | | | | Let there be property A using the product identifier on the right hand side. Let there be property B using A on the rhs. B must also be considered as dependent on product. Change-Id: I237ce7103e0707f6a1bc99bc0195ec714da04116 Task-number: QBS-729 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Update LicenseEike Ziller2015-01-2660-360/+360
| | | | | Change-Id: I092fca9f950de1ba38826c33b155f86feae2770b Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* more fine-grained cache disablingJoerg Bornemann2015-01-218-6/+42
| | | | | | | | | | | | Disable caching only for properties that reference product in some way. This fixes the performance regression introduced by 0d477159e6. Additionally, the property cache in ModuleProperties must be disabled too. Otherwise we might return wrong cached values. Task-number: QBS-729 Task-number: QBS-732 Change-Id: I4c46e4c5ddf20053851d7ee5e9a51f6f3f082a6d Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* fix product variable in Export itemsJoerg Bornemann2015-01-207-24/+111
| | | | | | | | | | | Consider a module M that's exported by Product B. Product A depends on product B and thus depends on M. This patch fixes the product variable in M that was referring to the exporting product B, not the importing product A. Task-number: QBS-729 Change-Id: Ia30b7159aa5d5ec37fe6257300e6c16205141f86 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Fix project parse error.Christian Kandeler2015-01-194-4/+30
| | | | | | | | | | Access to qbs properties was magically available even before loading the qbs module (for reasons beyond my knowledge), but this only worked when no qbs properties were set in the product. Task-number: QBS-728 Change-Id: If4323d4bd390d561b788538af7e69fca042a7f02 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Add XFAIL-ing autotest for newly discovered bug.Christian Kandeler2015-01-162-1/+6
| | | | | | Task-number: QBS-729 Change-Id: Iad875ff8910141976b6359a9927ec340622475d2 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* fix compilation with minimal Qt configurationJoerg Bornemann2014-12-231-0/+2
| | | | | | | | Add missing includes. Change-Id: I8473af332919ef4c2d9e66f56c6d15b136ec3a54 Task-number: QBS-719 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* Fix ResolvedFileContext comparison.Christian Kandeler2014-12-152-2/+4
| | | | | | | The order of JS extensions and imports does not matter. Change-Id: I452e8e6e64f588b061211031968d5741c01339d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Catch exceptions by const reference.Christian Kandeler2014-11-281-2/+2
| | | | | | Change-Id: Ib155b1b6f4e5d618d6e3143f43a2e7f9e7e1d410 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Fix rule comparison.Christian Kandeler2014-11-121-2/+3
| | | | | | | | | | We used to just compare the source code of the prepare script, but that was too much of an optimization. Simply use the ScriptFunction's operator== (which was also missing a member comparison), everything else is a maintenance nightmare. Change-Id: I625263e8dea42cbf42624c00434032d7b7146dc9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Set the initial value for "destinationDirectory" to "buildDirectory".Christian Kandeler2014-10-161-0/+1
| | | | | | | | In BuiltinDeclarations. The replacement we do in ProjectResolver could be too late for some contexts. Change-Id: If418f894fd8d161399b25a03e56876b34c3ee1cc Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* License update.Eike Ziller2014-10-1660-420/+480
| | | | | | | Add LGPLv3 option. Change-Id: I8a63ad5e46a2701032b2103f791df4dec5b707e8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* yield error on undefined elements in string listsJoerg Bornemann2014-10-143-0/+11
| | | | | | | | Instead of converting undefined values in string list properties to the string "undefined", we yield an error. Change-Id: Id370dafa67061f1f1a86bbeaaeed152be6fc751f Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* let Item::clone() create a deep copy of the item treeJoerg Bornemann2014-10-135-2/+39
| | | | | | | | | | Product multiplexing uses Item::clone() to create a product item per profile. Cloning the product is not enough, however. We must create clones of the children and item properties too. Task-number: QBS-690 Change-Id: I8f46488ffa5df255ee9c2b0571145c7ff034c204 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* avoid usage of QScriptContext::callee in callbacksJoerg Bornemann2014-10-102-0/+4
| | | | | | | | | | In order to fix QBS-695 we must work-around QTBUG-39416. Instead of relying on the callee() and extracting data from it, we're passing payload via QScriptEngine::newFunction. Change-Id: I1d454fba78523c7cd77a906952bdd48cbd5330db Task-number: QBS-695 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* make product's file path cache thread-safeJoerg Bornemann2014-10-102-1/+19
| | | | | | | This cache is accessed from multiple threads. Change-Id: I85f8d2a08215bd5d7478ae862ff611deaa07d400 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Add tools/architectures.hChristian Kandeler2014-10-061-1/+2
| | | | | | | | | | The architecture-related functions do not belong into hostosinfo.h. What's even worse is that we currently include that private header in Qt Creator, which is a no-go. So introduce a new public header that supplies the required functionality. Change-Id: I413c1bcfdf799f3aa768ce5c116f0122da8ac81c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Make the "sourceDirectory" property get inherited by sub-projects.Christian Kandeler2014-10-021-1/+2
| | | | | Change-Id: I3bfa722cdae4a68d779019bc3660aef289b8154e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Check whether profiles listed in Product.profiles actually exist.Christian Kandeler2014-09-261-1/+9
| | | | | | | | Otherwise people will get cryptic messages about missing properties if they mistype a profile name. Change-Id: I732a7ab6a5c0f79ddee7d4f028c2514aec265d0a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix evaluation in subitems of disabled productsJoerg Bornemann2014-09-261-2/+1
| | | | | | | | | | | Property evaluation in subitems of disabled products didn't work properly and led to evaluation errors. Even though a product is disabled, we must handle its subitems in the ModuleLoader to make module properties available. Task-number: QBS-671 Change-Id: Ibe051357095766b47e242b65c7899baeb6b0ee43 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* remove dead codeJoerg Bornemann2014-09-262-9/+0
| | | | | | | | Removed code that handles Artifact items below Product items. This is not supported and never really was. Change-Id: Id9e6d72c0f8eaab1dbfd59732bb4fd5057aad8b2 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix evaluation scope of module propertiesJoerg Bornemann2014-09-255-12/+17
| | | | | | | | | | | | | | Consider module A that depends on module B. Module properties of B were evaluated in the wrong scope. The comment in evaluatorscriptclass.cpp states correctly "Own properties of module instances must not have the instance itself in the scope.", but the corresponding check was slightly wrong. We must check whether the item that the property belongs to is a module instance or not. Task-number: QBS-515 Change-Id: Ic96b83fbca8b9ea783165a15b7c8398640a4dd84 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Evaluate Project.minimumQbsVersion earlier.Christian Kandeler2014-09-026-36/+40
| | | | | | | | Currently, this property is evaluated after checking the module properties and item types, so it cannot fulfill its purpose at all. Change-Id: I6b84d9af69e1c0147f87eb0fead4409dbb036d5c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix equality operators.Christian Kandeler2014-08-292-36/+17
| | | | | | | | | | | The Standard does not allow to dereference null pointers, even if that reference is then only used to compare the pointer values. So introduce a wrapper function that does the pointer-related checks first. Task-number: QBS-674 Change-Id: I9a14b4871b91102699f09ed922b9ab0e0265209a Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* Apply file tags filter also to Transformer outputs.Christian Kandeler2014-08-213-6/+17
| | | | | | | | This is currently done only for Rule artifacts. Task-number: QBS-668 Change-Id: Iddeda8a9d567cc8122f3aca2c1c1e3ea878e687c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* add missing member copy in Item::cloneJoerg Bornemann2014-08-141-0/+1
| | | | | | | | This has no immediate effect as we're not cloning module instances at the moment, but needs to be added for the sake of correctness. Change-Id: I389519efae2ffad4c2710d3d36ee1077e5de982a Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* remove unused member from Item classJoerg Bornemann2014-08-141-4/+0
| | | | | Change-Id: I045279dd983c13640f65f08229fc8e6a65e4f642 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix unclean source file paths resulting from groups with prefixes.Christian Kandeler2014-08-071-0/+1
| | | | | | | | | | | | | Example: Group { prefix: "dir/" files: "../f.txt" } The file path would end up as "/build-dir/dir/../f.txt" after calling FileInfo::resolvePath(), when we expect a clean absolute path. Change-Id: I9a7edb94cdf0fd99ce2d61f362a57ff4b9a8d060 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix error message about incompatible import versionJoerg Bornemann2014-08-061-1/+1
| | | | | | | This is the language version, not the qbs version. Change-Id: Id5b439d9d0076cf454ae2bb0a9e9a6041d1d7330 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Deprecate Artifact.condition.Christian Kandeler2014-08-052-2/+8
| | | | | | | | This never really worked. We have the outputArtifacts script for that now. Change-Id: I4c80ec1bcfcfe5a7e93edff1dfbd9a2139da3682 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Be smarter about storing property maps.Christian Kandeler2014-08-042-6/+6
| | | | | | | | | | | 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>
* add getter/setters for Artifact::fileTagsJoerg Bornemann2014-07-311-3/+3
| | | | | | | | | 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>
* Avoid contractions in user-visible messages.Christian Kandeler2014-07-312-3/+3
| | | | | Change-Id: I68685166bfaa873f1e5995c7d507afef45b03055 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add missing comma to error message.Christian Kandeler2014-07-312-2/+2
| | | | | Change-Id: I90b1b4dd35c6b2c625d11137e0f7d76d92641f72 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Clean up module item caches.Christian Kandeler2014-07-292-24/+16
| | | | | | | | | | The product- and project-specific ones were left-overs from earlier concepts, so get rid of them. Everything goes into the same "global" cache now. Also make sure that we cache disabled modules too; the respective files were always re-read from disk so far. Change-Id: Ib1dee08dbbfe61b0369772df96122e8eab19741b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove pointless assignmentJoerg Bornemann2014-07-281-2/+1
| | | | | Change-Id: Ifc9a1b3797a82587ffe92fdc431d9c91591bd31e Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix speed regressionJoerg Bornemann2014-07-282-5/+10
| | | | | | | | Commit 9297ea217284e2279f2d4471b3f8fc754dc5fe71 introduced a speed penalty. This is a quasi-revert of said commit. Change-Id: Ia0b0741cf818a9867f127a25830630fb3ea352ff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* API: Be smarter about adding files already matched by wildcards.Christian Kandeler2014-07-232-6/+7
| | | | | | | | | | | The project file does not need an update in this case. Actually, that would even lead to an error on the next project resolving, as the file would then be listed twice (once explicitly and once matched by a pattern). Task-number: QBS-653 Change-Id: If56969c36d1bba3f9194621690c2e1f25229ee9e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* introduce Project.minimumQbsVersionJoerg Bornemann2014-07-226-0/+51
| | | | | | | | | This property can be used to specify the minimum required QBS version of a project. Change-Id: I564f4298c060c3acf2f6221fb1d6978eda1dd1a5 Task-number: QBS-453 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* add a simple Version classJoerg Bornemann2014-07-215-142/+25
| | | | | | | | This class replaces the Version struct in setup-qt and the ImportVersion class of the loader. Change-Id: Ic65eaf62de44ce0c082fe805431463defce1fe3b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix calculation of added/removed artifactsJoerg Bornemann2014-07-172-83/+0
| | | | | | | | | | | We kept lists of added and removed artifacts in ProductBuildData. It was never quite clear when to invalidate those lists, which led to QBS-635. Instead we let the RuleNode decide which artifacts it considers as "added or removed for this rule". Task-number: QBS-635 Change-Id: I390e0ab775c695045c6e91ade3ac7326692cb314 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* speed up ResolvedProduct::lookupArtifactsByFileTagJoerg Bornemann2014-07-171-7/+1
| | | | | Change-Id: Id2f55d64dcbaf6c1b80009a13d48ed823ee213cd Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* deprecate Artifact.fileName in favor of Artifact.filePathJoerg Bornemann2014-07-165-12/+53
| | | | | | | | This property is actually a file path, not a mere name. Task-number: QBS-579 Change-Id: I04e8f03eac97b5f86fe743a4923888a3d2a82c5d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Put a system-wide lock on the build directory.Joerg Bornemann2014-07-162-2/+7
| | | | | | | | | | | | | So that two qbs instances can't overwrite each other's build graphs. In practice, this is probably most relevant for IDEs, as these hold a build graph for potentially long periods of time. Facilitates QLockFile that was introduced in Qt 5.1. For older Qt versions, no locking happens. Task-number: QBS-162 Change-Id: Ib598617fb1742eb57b6a017f40b9631d1d54e627 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove deprecated Product.additionalFileTagsJoerg Bornemann2014-07-151-11/+0
| | | | | Change-Id: I98b4ddc32266eaa83ece5ed4ba814d183206671e Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>