summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/automoc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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 artifact leaks in build graph loader and automoc.Christian Kandeler2013-09-091-0/+1
| | | | | Change-Id: I989d88c58586ab9b6fe9f7870432f7266a00b9cc Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* AutoMoc: do not scan files twiceJoerg Bornemann2013-08-271-29/+21
| | | | | | | | 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-271-37/+19
| | | | | | | The scanners already know the file tags they're responsible for. Change-Id: If5ed47bfc011357737df08e3fe834ec8fcf4318b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* remove Artifact::topLevelProjectJoerg Bornemann2013-08-021-2/+3
| | | | | | | | Every artifact has a product now. That product points to its top level project. Artifact::topLevelProject can go. Change-Id: I7a7ec921043b64eec6c704128ae465fd9ef05031 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* move file dependencies to dedicated classJoerg Bornemann2013-08-011-1/+1
| | | | | | | | | File dependencies are a very simple variant of artifact. We save space and structure the code more clearly by introducing the FileDependency class. Change-Id: I36b95794f9d6d3d739ea4836ebc831848a89de98 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Improve handling of changes to restored build graph.Christian Kandeler2013-06-241-2/+2
| | | | | | | | | Instead of painstakingly inserting new product pointers into an existing build graph, do it the other way around and put existing build data into the newly resolved project. This is much more robust. Change-Id: If38e4a5e14c6a5faedb0c590e86aa5efc7844e39 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Some minor improvements to the Error class.Christian Kandeler2013-06-181-1/+1
| | | | | | | | | | | | | - Rename "Error" to "ErrorInfo", to make clear that this class conveys information about errors, including that there might not actually be one. - Rename "ErrorData" to "ErrorItem", to make clear that these are parts of an aggregate structure. - Introduce ErrorInfo::hasError() for quick checking of whether an error occurred. Change-Id: Icea6ed5240d6d14bd30e9cea189c6babd7004792 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Allow projects to be nested.Christian Kandeler2013-06-171-3/+3
| | | | | | | | | 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>
* Remove structural redundancy in project and product classes.Christian Kandeler2013-04-121-11/+10
| | | | | | | | | | | | | | | 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>
* fix warnings on MSVC 64 bitJoerg Bornemann2013-02-221-1/+1
| | | | | Change-Id: I6b96c61df3df3667ea5b4221b03dcfa8720cc807 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* introduce classes FileTag and FileTagsJoerg Bornemann2013-02-201-29/+36
| | | | | | | | | | | 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>
* Remove global log sink.Christian Kandeler2013-02-061-22/+30
| | | | | | | | | | | | | | | Applications may not want to use the same log sink for all builds. The logging facility is also decoupled from the command-line client in other ways: - The LogWriter modifiers for output channel and text color are gone, since this type of decision should not be made by low-level code. Instead, the "highlight" string can be forwarded to the log sink. - The console logger now lives in app/shared, as it must never be used by library code. Change-Id: I8863a554c9b74577320ef23f6f934a74e0f0cbb0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do not write directly into loggerTobias Hunger2013-01-111-3/+7
| | | | | | | | | | | Pass information up to the client instead so that it can decide how to handle it. This allows e.g. creator to parse compile output for build issues. Change-Id: I76be4eaeb289b211b7d2527b555536b556655492 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* update copyright yearJoerg Bornemann2013-01-091-1/+1
| | | | | Change-Id: Ic2962e57ede037b910d7e77b01b0163f0a22cb7d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix warning for forward-declared QSharedPointer.Christian Kandeler2012-12-051-0/+1
| | | | | Change-Id: Ica50112fe9e7c32dd47b5923ffb869071381cd96 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove the BuildGraph class.Christian Kandeler2012-12-051-5/+5
| | | | | | | | Its only contents were static member functions, which now become free functions. Change-Id: If854e6804626beddcc918d0aea155e07fd945577 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Split up buildgraph.h and buildgraph.cpp.Christian Kandeler2012-12-041-5/+31
| | | | | | | Move things to the appropriate places. Change-Id: I2f201ccdf9c465a8c3201e229629b756cc258495 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Move engine-related functionality out of BuildGraph.Christian Kandeler2012-12-031-4/+3
| | | | | Change-Id: I5da16ea99bce3e6f737f37770fb0fe3e2e5c0214 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Slash more heads off the BuildGraph hydra.Christian Kandeler2012-11-291-8/+7
| | | | | | | | | | | This moves almost all state out of the class into more suitable places. The functionality left is: a) An engine wrapper that can be turned into a new dedicated class pretty much as-is. b) Static helper functions that do not naturally fit elsewhere. Change-Id: Ie3d79ecdcd58c02373fb852e9ff39659c0c4f07a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Reduce compile dependencies.Christian Kandeler2012-11-291-1/+4
| | | | | | | | | | | | | | | | | While it seems elegant at first glance to do typedefs in class scope, it has one serious drawback: Forward declarations become impossible unless they use the non-typedef'ed type name, which defeats the purpose. As a result, dozens of headers currently include language.h and buildgraph.h, even though they technically don't have to. Fix this by introducing special forward-declaring headers and doing the typedefs there, outside the class scope. Now changes to header files included in language.h or buildgraph.h don't ripple through half the project anymore. Along the way, also remove unneeded and potentially harmful INCLUDEPATH statements from various pri files. Change-Id: Ib50db850876955216db7f39b6099c32d1239092b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Executor: out-of-date check revisitedJoerg Bornemann2012-11-121-0/+4
| | | | | | | | | | | | | Only for source artifacts and file dependencies the physical timestamp is retrieved. The timestamp of generated artifacts is the last build time of the artifact and is stored in Artifact::timestamp. Much simpler code and less stat'ing. Task-number: QBS-154 Change-Id: I96f23e911f221f1cf3af5a76df01593bb9a19033 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Introduce namespace Internal.Christian Kandeler2012-11-081-0/+2
| | | | | | | | | This makes it obvious at first glance which facilities are for public use and which are not, which should be useful especially for clients of the library. Change-Id: I7f74f13b5c8a4c63a1de57bf607084a3a3852653 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Buildgraph: Factor out rule application.Christian Kandeler2012-10-251-1/+1
| | | | | | | | | | | Applying a rule involves calling a number of functions in the build graph that are not used for any other purpose, so make these member functions of a dedicated class. Reduce the number of arguments of these functions by making the common arguments members of that class. Change-Id: Ic99a0127480366ce518246766b69c3c644d6ca9b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove as much stuff as possible from the evil Qbs namespace.Christian Kandeler2012-10-161-1/+1
| | | | | | | | | | The only thing left now are the classes whose names would clash if they were in the same namespace. During the move, it turned out we have quite a number of logging-related facilities, so introduce subdir "logging". Change-Id: I3b673cd4f75e2ca61605a88886cfcdcac6d6bcd6 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* license and copyright updatedJoerg Bornemann2012-10-081-28/+20
| | | | | | Change-Id: I0c0b3035514ee6b735e85c098029fa2f41edb6ff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix pch dependencies for moc generated C++ filesJoerg Bornemann2012-10-081-0/+12
| | | | | | | | | Automoc needs to take c++_pch files into consideration when applying build rules. Task-number: QBS-141 Change-Id: I6ef25733c62fa0d7768396f8ed9a4abb881b8d98 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* support Qt5 plugin metadata json filesJoerg Bornemann2012-10-081-0/+23
| | | | | | | | | | | | For the metadata .json files of Qt5 plugins, qbs now supports the qt_plugin_metadata filetag. C++ header files are scanned for the Q_PLUGIN_METADATA macro. If it is found, the qt_plugin_metadata file is added to the dependents of the resulting moc_XXX.cpp file. Change-Id: I4b68fd9a99847640f87a40e15819382ead74b0d3 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* automoc refactoredJoerg Bornemann2012-10-081-23/+37
| | | | | | | | | | - clearer function names - simplified logic - preparation for Qt5 plugin metadata support Change-Id: I9d66f7f375d55d6ca390ec3f89a14330f1c8ed36 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* ScanResultCache::Dependency performance fixJoerg Bornemann2012-06-051-1/+1
| | | | | | | Only check the directory part of includes for '.' and "//". Change-Id: I5174f89255496d2841a89eb3f91dc81ad1ca0d60 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
* Try to optimize the critical path.Christian Kandeler2012-06-041-1/+1
| | | | | | | | | | | | Profiling shows that calls to QDir::cleanPath() account to roughly a third of the time spent in qbs during a build, so we try to call that function only if necessary. For a complete build of QtCreator, this patch reduces the number of these calls from ~14 million to ~12 million, speeding up the scanning process (where they almost exclusively appear) by a modest seven per cent. Change-Id: I5aee13e4e54ad4e242d80dc7da557ccb60a232fe Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* artifact lookup revisitedJoerg Bornemann2012-04-181-8/+8
| | | | | | | | | | | | The naive (absolute filepath -> artifact object) hash in BuildProduct and BuildProject has been replaced by a table structure, owned by the project: (file name -> (directory path -> Artifact objects)) This way artifact lookups are much faster. Change-Id: Ib31d3b234ecfc1d2d026aaec388ec16e6fd8f86c Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* ScanResultCache::Result::visited renamed to validJoerg Bornemann2012-04-041-2/+2
| | | | | | | This name better reflects what we use the variable for. Change-Id: I4b7bd99fa72421da264cbfb651404665401de470 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* ScanResultCache performance fixJoerg Bornemann2012-04-041-3/+3
| | | | | | | Pointless QHash replaced by QVector. Change-Id: I767b0d03d2482a5a2335b784de9213977f024ed1 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
* automoc: do not handle generated artifactsJoerg Bornemann2012-03-011-0/+2
| | | | | | | | | | | We have a chicken/egg problem here with the current design, if we're allowing automoc to handle generating artifacts. A code generator must know if its generating mocable cpp/hpp files and add the moc_cpp / moc_hpp file tags accordingly. Change-Id: I29c4bfc3d61a0e6430346c0887bf378ea6eb0e97 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Long live qbs!Joerg Bornemann2012-02-151-0/+273
Change-Id: I412793e868919a9ac99611616f292e7047f1ebcf