summaryrefslogtreecommitdiff
path: root/src/lib/language/language.h
Commit message (Collapse)AuthorAgeFilesLines
* introduce class BuildGraphNodedynablasterJoerg Bornemann2013-11-271-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Lock the build graph while jobs are running.Christian Kandeler2013-11-251-0/+1
| | | | | | | | | | | | | | All jobs except setting up the project are mutually exclusive, and it is also forbidden to change the project internally while they are going on. Currently, ignoring this requirement leads to undefined behavior. Since we can detect such a condition and react in a defined way, we should do it. Note: This is about the API and the in-memory build graph, not about competing accesses to the stored build graph from different processes. That's a different (and more difficult) problem. Change-Id: I2d8a715334b2b73b4f4d32781d0b4f83b1612d40 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2013-11-221-0/+3
|\ | | | | | | | | | | | | | | | | 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-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Add API for adding groups and files.Christian Kandeler2013-11-201-5/+5
| | | | | | | | | | | | | | This is a necessary feature for proper IDE support. Change-Id: I296beb5beae514f70babf3da1b5544726e9df82e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Store information about file tags and prefix in the ResolvedGroup class.Christian Kandeler2013-11-181-0/+3
| | | | | | | | | | | | | | This is needed for adding files at run time. Change-Id: I71b8a28b9dd63fab2162bbc6df6b91b953576e04 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2013-11-141-0/+10
|\ \ | |/ | | | | Change-Id: I7475c4a71c15c83c59400c44ef96d73d15caea58
| * Take rules into account when tracking changes.Christian Kandeler2013-11-111-0/+10
| | | | | | | | | | | | | | | | | | 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>
* | Allow lists of patterns in the FileTagger item.Christian Kandeler2013-11-111-10/+7
|/ | | | | | | | | | | | Rationale: It is not uncommon that the same tag is associated with more than one file pattern; more common, in fact, than the other way around. It therefore seems silly to force module authors to create one FileTagger item per file extension. For semantic consistency, the "pattern" property gets renamed to "patterns". The old name is still supported in this minor version. Change-Id: Ia7f744b0903462517582fcb549e2dab004c81dd5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add missing include statement.Christian Kandeler2013-11-041-0/+1
| | | | | | | | Currently compiles without, but that's a coincidence. Change-Id: Ifc48a2bdef3b71ab49771678ba1c1aa0a152c03a Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix calling of prepare script functionJoerg Bornemann2013-09-241-0/+1
| | | | | | | | | 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 imports/extensions for script propertiesJoerg Bornemann2013-09-191-8/+29
| | | | | | | | | 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/+1
| | | | | Change-Id: If4f695878087f0cd72d85e497d918c4f70e42001 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* ResolvedTransformer::Ptr -> ResolvedTransformerPtrJoerg Bornemann2013-09-181-6/+7
| | | | | | | | Also introduce ResolvedTransformerConstPtr for consistency and use it where appropriate. Change-Id: I4922c71a681e970e57502269d8ee259dcacde39f Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* rename class PrepareScript to ScriptFunctionJoerg Bornemann2013-08-261-6/+6
| | | | | | | | 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>
* Handle changes in transformers when re-using a stored build graph.Christian Kandeler2013-08-141-0/+16
| | | | | | | | 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>
* Serialize more data.Christian Kandeler2013-08-141-1/+4
| | | | | | | | SourceArtifact::overrideFileTags was missing, as well as ResolvedProduct::transformers. Change-Id: I0118b57bcf345c83bba64f2716fac20a91c86a28 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* replace filetagger set with a listJoerg Bornemann2013-08-131-1/+1
| | | | | | | There cannot be duplicates. Change-Id: I8c7a558fe5e7b58e2c7ec9b3d5ee165012829b48 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Add API to retrieve generated files.Tobias Hunger2013-08-091-0/+2
| | | | | | | | | | Add an API to qbs::Project that can be used to retrieve generated files (as known by the build system up to that point). This will be used to e.g. get the name of header files generated from ui files in Qt Creator. Change-Id: I4ef1b99f511bb67f14029c90102630c0d498f1e5 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* introduce Rule.auxiliaryInputsJoerg Bornemann2013-07-311-0/+1
| | | | | | | | | | This eliminates the need of putting "hpp" into Module.additionalProductFileTags to produce ui_XXX.h files. Instead, we're making all hpp producing rules dependent on the compiler rule. Change-Id: I345cb3bee20d8080e40ca678d4db822ccd1af92e Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Use previous results of calls to "File.exists()" in change tracking.Christian Kandeler2013-07-161-0/+1
| | | | | | | | 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>
* Make built-in JavaScript extensions available on demand.Christian Kandeler2013-07-031-0/+3
| | | | | | | | | | | | This entails the following: - Project files can get access to built-in extensions in all contexts via import statements such as "import qbs.TextFile". - In turn, the automatic injection of these extensions in rules and probes no longer happens, i.e. one always has to explicitly import the required extension. Change-Id: Ib1e42c078354c564e417f80dd47897c7f41e7569 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Store list of files that are part of the projectTobias Hunger2013-06-201-0/+2
| | | | | | | | | | | Store a list of all files that are referenced when resolving the project as part of the project. This list is then processed to check whether the project needs to be re-resolved. Change-Id: Iccb8928a5349546c22a9615256a505bebf5de567 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Allow projects to be nested.Christian Kandeler2013-06-171-11/+36
| | | | | | | | | This is nice to have for grouping products and a requirement for aggregating existing projects into a bigger one. Change-Id: I3394642e95ea57dbc6bf1603cfed6902a5906e4c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Pass the environment to be used as part of the setupprojectparametersTobias Hunger2013-06-061-1/+2
| | | | | | | | | | | Pass in the environment to be used when resolving a project via the SetupProjectParameters. Store this environment and use it when building. Remove APIs for passing an environment when building. Change-Id: Icfd345bac27999b3e4191061a31d9df4f24cbd7f Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* make project properties available in rulesJoerg Bornemann2013-05-221-0/+3
| | | | | | | Blackbox autotest codegen enhanced. Change-Id: Ibeda7204477d06973a4e343d57da757c0bf47899 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Deal with environment changes.Christian Kandeler2013-04-161-0/+3
| | | | | | | | | | Track in the build graph which variables have been requested by a project and re-resolve a restored project if they have changed in the meantime. Task-number: QBS-259 Change-Id: I6fd08785e2e2ba97f42d0da983f3ea84859e6d20 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove structural redundancy in project and product classes.Christian Kandeler2013-04-121-1/+14
| | | | | | | | | | | | | | | We had two project classes, each holding a list of products that was structurally identical, except that no BuildProduct object existed for a disabled ResolvedProduct. The same kind of duplication also happened for product dependencies. This patch gets rid of these parallel structures. BuildProject and BuildProduct are largely being demoted to data holders and are aggregated by ResolvedProject and ResolvedProduct, respectively. The resulting project structure should be easier to understand and maintain. Change-Id: I68beef60b9e0d62258f6a8337c9015864e18bd80 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* cache Rule.prepare scripts as function objectsJoerg Bornemann2013-03-271-0/+1
| | | | | | | | | | | | | | | For Rule.prepare a function object is created on demand. This function object is called on every rule application. The QScriptProgram cache turns out to be quite useless. This caching approach saves roughly 5% of time of the whole resolve phase. Magic persistence number changed, because the createCommands method now expects prepare scripts in function form. Change-Id: Ie531dcfb5f21578548a5961ddaa6086ae441a2b0 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* move PropertyMapInternal to its own filesJoerg Bornemann2013-03-181-21/+1
| | | | | Change-Id: Idc6b68aa0b10f6651ce9f80c420f185dbb28708b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix header guard styleJoerg Bornemann2013-02-211-3/+3
| | | | | Change-Id: Ib963a70e7a3be03a967a3cf41c3608d52fef7078 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* remove unused PropertyMapInternal::PtrJoerg Bornemann2013-02-211-5/+2
| | | | | Change-Id: I25a0778183d7fdf8190ac7f649f5dd190ea92c4d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Rename class "PropertyMap" to "PropertyMapInternal".Christian Kandeler2013-02-211-7/+7
| | | | | | | We will soon introduce a new, externally visible class "PropertyMap". Change-Id: I22ab86392439ebde2476be7655803318f77fef7f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Move property look-up into the C++ backend.Christian Kandeler2013-02-201-4/+0
| | | | | | | | | | | Instead of exporting the complete property VariantMap of products and artifacts to JavaScript and finding the property values there, we introduce functions that do this in C++ and just export their functionality. This functionality will also be made available in the API. Change-Id: I6b8631e78b74db563403caa47ae10021ca152fa0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* introduce classes FileTag and FileTagsJoerg Bornemann2013-02-201-13/+14
| | | | | | | | | | | Stop inconsistent usage of QSet<QString> and QList<QString> to hold file tags. This is now unified by using a FileTags container class. The FileTag class is an alias for Id. Task-number: QBS-170 Change-Id: I8917942c4327a45d3d3604f4dc39bdee12801fdb Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Check whether stored build graph is really for our project.Christian Kandeler2013-02-011-1/+1
| | | | | | | | | | | | | | | | | At the moment, we accept build graphs for any project and claim "Build done" if it's newer than the project file. With this patch, we error out in such a case by default. We do not simply discard the existing build, because presumably the user made a mistake and does not want the existing build to be overwritten by one for a completely different project. If a user is sure it's the same project after all (e.g. the sources have moved or the project file was renamed), the "--force" option can be used. If a user really wants to throw away the build for the other project, that must be done manually. Change-Id: I1194fcc4695632a6b96789bc8032f9d3b3a55ce3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* implement PropertyMap::toJSLiteralJoerg Bornemann2013-01-291-0/+1
| | | | | Change-Id: I21a07f25fdc9607215b4659ab847e0dfda0527e7 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* initialize ResolvedGroup::enabledJoerg Bornemann2013-01-281-1/+3
| | | | | Change-Id: Iace86a2166ef4191682e731a124f68dde6c54d5d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Added support of recursive wildcard patternsRuslan Nigmatullin2013-01-281-2/+3
| | | | | | | | Behaviour of bash with globstar option is reproduced Change-Id: Ibedd640084c398c9141d0d91bd37868235eae1e5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* make FileTagger shared pointer forward-declarableJoerg Bornemann2013-01-281-7/+4
| | | | | Change-Id: Iae6f268ddcaa739d54a3b420a2999dfb5da6329b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Introduce the "install" command.Christian Kandeler2013-01-221-0/+1
| | | | | | | | | | | This decouples building and installing, e.g. allowing the latter to be executed by a privileged user to a system-wide directory. In addition, the ability to install build artifacts (typically executables or libraries) has been added. Change-Id: I28e725e4c1168eebe88e12c75e3d3e9f5fe28ca5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix Qt4 QSharedPointer warning.Christian Kandeler2013-01-191-0/+2
| | | | | Change-Id: I42a89a02eed97dd567373f7928f48b8e5e29f643 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* introduce property Group.fileTagsFilterJoerg Bornemann2013-01-181-0/+1
| | | | | | | | | | | | | | | | | | | With fileTagsFilter one can set properties on a certain set of generated artifacts. This property is a list of file tags. All artifacts that have file tags that are in that list will get the properties that are bound in the rest of the item. Example: Group { fileTagsFilter: ["dynamiclibrary"] qbs.installDir: "mylibs" } Group.files and Group.fileTagsFilter are exclusive. Change-Id: I764e0a823f2cda4efe4ac3c985ecde5e178bab7b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Allow for setting the environment to be usedTobias Hunger2013-01-151-2/+2
| | | | | | | | | | | In Creator we define an environment to run our builds in. Allow to pass the initial environment used by qbs. It will then modify this base environment and run JS and Process commands using that environment. Change-Id: If7c606da4fd754ee872b0256226ce90fe424fccf Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* make disabled products available in the project structureJoerg Bornemann2013-01-151-0/+1
| | | | | | | | Whether a product is enabled can be determined by checking ResolvedProduct::enabled. Change-Id: Ibd5ca8cac018ea45240d6b9b4e2775f699c9592d Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* make disabled groups available in the project structureJoerg Bornemann2013-01-151-0/+2
| | | | | | | | | | Whether a group is enabled can be determined by checking ResolvedGroup::enabled. Task-number: QBS-201 Change-Id: I98e16a879c41ffa401fd5c7abe27dab063ce0757 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* Re-do the wildcard implementation.Christian Kandeler2013-01-141-8/+5
| | | | | | | | | | | | | | This feature is in desperate need of simplification, since the current semantics are not clearly defined. The main culprit for that is the ability to use wildcards in directory names, which leads to all sorts of problems, especially in combination with the "recursive" flag. We therefore disallow that now: Wildcards can only be used to match actual files. This results in clear semantics that are easily understood and can actually be documented. Change-Id: If8a950e1c1a362ce9fb57a1c9789a83ea7c8b3ba Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Use class instead of struct whereever possibleTobias Hunger2013-01-101-1/+2
| | | | | | | | | E.g. clang complains about struct/class mismaches, so try to use class as consistently as possible to avoid opportunities for mistakes. Change-Id: I81021336f2dc75a2f5b2b1105491aa50f8ea851d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* update copyright yearJoerg Bornemann2013-01-091-1/+1
| | | | | Change-Id: Ic2962e57ede037b910d7e77b01b0163f0a22cb7d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix semantics of recursive wildcards.Christian Kandeler2012-12-111-2/+1
| | | | | | | | | | | | | | | | | | Consider this: Group { files: "x/*" qbs.installDir: "x" recursive: true fileTags: "install" } Now let's assume there is a file x/y/z.txt. The current implementation expands the whole path and copies the resulting file to the base install dir, so that z.txt ends up in <install root>/x/z.txt. The new implementation does not descend into y, so that the structure in the installation directory is x/y/z.txt, as one would expect. Change-Id: I31062b743e5b4d6938bbc58090f36bb02d2bd094 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>