aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cmakeprojectmanager/cmakebuildstep.h
Commit message (Collapse)AuthorAgeFilesLines
* Cmake: Fix compile output glitchChristian Kandeler2020-07-311-7/+0
| | | | | | | | | | | Using a dedicated OutputLineParser ensures that we only ever see complete lines and thus prevents "partially red" lines in the compile output pane. Fixes: QTCREATORBUG-24209 Change-Id: I12b3de70b81789afe727b66e366facdcc81f8ab8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Core/Utils: Migrate further to Utils::Idhjk2020-07-061-1/+1
| | | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 (cherry picked from commit 430a33dcd9ac80ddb848e41f8f059102857c88aa) Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Support building several targets with cmake --buildTobias Hunger2020-06-031-5/+5
| | | | | | | | | | | CMake supports this for a while now. As a side effect this fixes QTCREATORBUG-23738, which was caused by the radio button hack used to show that only one item could be selected at a time. Change-Id: I18cbe6c5ee3872edaf74b9d828bde1ac5bf63563 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Add a way to provide options to CMake --buildTobias Hunger2020-06-031-0/+3
| | | | | | | | | | | | | Add a way to provide options to cmake --build in addition to the already existing option to the build tool (separated by -- from the cmake arguments). I decided to have these two separate to ease upgrading from older Creator versions. Task-number: QTCREATORBUG-24088 Change-Id: If989f9942498055312ba0e11e7d80c2b5ece269d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Split build output into lines before parsingChristian Kandeler2020-05-261-1/+1
| | | | | | | | | | This amends commit b15d1951a2, where we moved the line splitting into the output parsers, but overlooked that the CMakeBuildStep does additional line-based parsing. As a result, the stdout -> stderr redirection for ninja output was broken. Change-Id: Iafbbce9a3f9c0383812a9e4c129c1d94fa907b73 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge output formatters and output parsersChristian Kandeler2020-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Now only one piece of code needs to be written to both linkify output in an output pane and create tasks for it in the issues pane. The calling sites are also simplified. For instance, until now, build steps had to feed their output parsers manually and then push the created tasks up the signal stack in parallel with the actual output, which the build manager relied upon for cross-linking the output pane content. Afterwards, the output would get forwarded to the formatter (and parsed for ANSI escape codes a second time). In contrast, a build step now just forwards the process output, and task parsing as well as output formatting is done centrally further up the stack. Concrete user-visible improvements so far: - File paths in compiler/linker messages are clickable links now. - QtTest applications now create clickable links also when run as part of a build step, not just in the app output pane. Task-number: QTCREATORBUG-22665 Change-Id: Ic9fb95b2d97f2520ab3ec653315e9219466ec08d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CMake: Move CMakeBuildStepConfigWidget definition to .cpphjk2020-02-211-35/+2
| | | | | | | Slimmer interface. Change-Id: I34b8c172864456f67216efce7a09967c0ffec8be Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Pass Id to BuildStep constructorhjk2020-01-091-1/+1
| | | | | | | | Allows to use constants in fewer places, similar to what e.g. RunConfiguration does. Change-Id: I9d049128206c4acf0ce14b06b66d6c090a7c5242 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Cmake: Remove unused codehjk2019-12-041-3/+0
| | | | | Change-Id: I7305ad6f853c6645cc34ca66fc602f0b58982f60 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CMake: Use radio buttons to select build targetsTobias Hunger2019-10-181-1/+4
| | | | | | | | | | | | Use radio buttons to select build targets in CMakeBuildStep. CMake only allows for one target to be built at one time, so checkboxes are confusing. Task-number: QTCREATORBUG-20764 Change-Id: I1171abd1753817595562526456c3ce613a22667c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Remove clearBuildTarget from CMakeBuildStepTobias Hunger2019-10-161-1/+0
| | | | | | | | | That method makes little sense, considering that there can only ever be one build target. Change-Id: I53d555fa7d713dd8c05b4a9f5944908afeee859f Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io>
* CMake: Remove CMakeProject::buildTargetTitlesTobias Hunger2019-08-121-0/+2
| | | | | | | | The only user can also get this information from the relevant CMakeBuildConfiguration. Change-Id: I80e176ef0a8bc427f6adbf75b20e29f38d7b949f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Unification of desktop run configurations, step 1hjk2019-08-071-4/+5
| | | | | | | | | | | | First step, move {DesktopQt,Qbs,CMake}RunConfiguration{,Factory} into the same new files. This only moves down to QtSupport, not ProjectExplorer, as there are in all three cases direct dependencies on QtSupport. Long term I would expect them to move further down. Change-Id: Ib16b19df7f3f642ed7f7db89a1f6904601d976ba Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CMake: Add helper method to find the default build target for a BuildStepTobias Hunger2019-07-241-0/+2
| | | | | | | | | Add a helper method to find the default build target for a CMakeBuildStep based on the BuildStepList the step is part of. Use all/install/clean targets as appropriate. Change-Id: Idc0c5fae7dfd255039b87ace77c02688cdd76e8f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Use Utils::CommandLine for CMakeBuildStephjk2019-06-031-4/+5
| | | | | | Change-Id: I0490b1edf073c680f24ad7de10b544443ae62c5e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-1/+1
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Use Utils::FileName in ProcessParametershjk2019-05-151-1/+1
| | | | | | | For the command and the working directory. Change-Id: Ia69dc7100aeb57bb6e1b35f4dd4f3cf3763d8cda Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Rework the build step run interfaceChristian Kandeler2019-01-311-7/+7
| | | | | | | | | | | | | | | | | | | | | Originally, the build manager used to run all build steps in a dedicated thread. Communication between the step and the manager happened via a QFutureInterface that was passed into the step's run() function. Later, new steps were added that operated asynchronously, so the build manager had to differentiate between the different kinds of steps for starting and stopping. These days, almost all build and deploy steps work asynchronously, which made the QFuture-based interface look increasingly odd. With this patch, all build steps are expected to work asynchronously, so the build manager no longer needs to differentiate. Steps are started and requested to stop via the run() and cancel() functions, respectively, and emit the finished() signal when they are done. Build step implementors no longer have to deal with a QFutureInterface. For steps whose implementation is inherently synchronous, the BuildStep base class offers a runInThread() function. Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803 Reviewed-by: hjk <hjk@qt.io>
* CMake: Don't change targets when parsing failsAaron Barany2019-01-251-1/+1
| | | | | | | | | | | | When first loading a CMake project, if parsing fails all targets get reset to the "all" target. Most commonly users will notice this when the "clean" target gets reset to "all", and can often go unnoticed for a while. This can become especially annoying when custom target configurations are used. With this change the previous targets will be preserved upon failure. Fixes: QTCREATORBUG-21617 Change-Id: I52a3a2c472c7b8d98bc016b1e55a202147fc091c Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Simplify BuildStep::init() signaturehjk2019-01-181-1/+1
| | | | | | | | The extra parameter was always computed but used only in one place, and that use got removed lately. Change-Id: Ie10c0107ca70ee97ce03f83294992aab8d1a3ffe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Make BuildStep::immutable use a data memberhjk2018-10-231-1/+0
| | | | | | | | | Default to false, remove all no-op reimplementations. And rename the getter to isImmutable according to the rules. Change-Id: I8cce79d88fb59badfa1cffcf30a46f7ff3b09e8b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Change BuildStepConfigWidget::summaryWidget()hjk2018-10-171-2/+0
| | | | | | | | | | From a virtual function to a normal one backed by a real data member. That's essentially what several re-implementations did, the other ones used a fixed value instead. Change-Id: I61e45f1d4f7f0f80fe2eb1f2729785f37e7bb803 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Make BuildStepConfigWidget::displayName a valuehjk2018-10-151-1/+0
| | | | | | | | | | | Use BuildStep::displayName() as default. This probably could be the only possibility, but currently there are some discrepancies that are kept in this patch to make the patch mechanical. Change-Id: I2a1e5c2ff37ad95e25309eb16e07099e42191f60 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Simplify BuildStepFactoryhjk2018-05-311-2/+0
| | | | | | | | | | | | | | | De-QObject-ify class, tr contexts are now the product's context, which was the case in some BuildStepFactories already, and is current state in {Run,DeployConfiguration}Factory. One spurious object name removed. De-virtualize canHandle(), it was never overloaded and is not intended to be overloaded anymore. Remove unused clone() function. Change-Id: Iff7fba5f707505f868f94458084a18650535fa23 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Centralize retrieving the "parent" build configurationEike Ziller2018-05-221-1/+0
| | | | | | | | | | | | | If a step is part of a build configuration, that is used, but many steps can be used as part of a deploy configuration. In that case the active build configuration of the step's target must be used, and that logic was duplicated many times. Instead, let BuildStep::buildConfiguration take care of that logic. For steps that are not offered for deploy configurations there is no semantic difference, and for the others this removes code duplication. Change-Id: I02f3bb50226590092cedcec02fce6fde9c7c6e63 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setuphjk2017-12-081-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follow the rough pattern of recent *RunConfigurationFactory changes for build and deploy configurations. - Collapse the two lines of constructors similar to what 890c1906e6fb2ec did for RunConfigurations * Deploy* was purely mechanical * Build* ctors are split in connects() in the ctor body to create "empty shell for clone" etc and build step additions in initialize() functions which are only used in the create() case. -- Allows to collapse the shared 'ctor()' functions, too. - Move FooBuildConfigurationFactory::create() implementations to FooBuildConfiguration() constructor. That was a strange and unneeded ping-pong between factories and objects, and furthermore allows one level less of indirection (and for a later, left out here, some reduction of the FooBuildConfiguration interfaces that were only used to accommodate the *Factory::create() functions. - Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(), but there wasn't one in the base classses. Have one there. - Most canHandle() functions were checking simple restrictions on e.g. project or target types, specify those by setters in the constructors instead and check them in the base canHandle() - clone() is generally replaced by a creation of a "shell object" and a fromMap(source->toMap()), implemented in the base, there are two cases left for Android and Qbs that needed(?) some extra polish - generally use canHandle() in base implementation, instead of doing that in all Derived::canFoo() - as a result, canCreate/create/canClone/clone reimplementations are not needed anymore, keep the base implementation for now (could be inlined into their only users later), but de-virtualize them. - Combine Ios{Preset,DSym}BuildStepFactory. There was only one 'dsym' build step they could create. - Split the 'mangled' id into the ProjectConfiguration subtype specific constant identifier, and a QString extraId() bit. Only maintain the mangled id in saved settings. - Make ProjectConfiguration::m_id a constant member, adapt all constructors of derived classe. Not done in this patch: - Finish possible cosmetic changes on top - Add a way to specify restrictions to supported Qt versions (used in Android/Ios), as the base implementation does not depend on the qtsupport plugin - Combine the QList<X> availableFoo() + createFoo(X) function pairs to somthing like a direct QList<struct { X; std::function<X()>; }> fooCreators() to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base) pingpong - Remove the *Factories from the global object pool - Do something about priority(). Falling back to plain qmake in android+qmake setup is not helpful. Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Simplify signalingTobias Hunger2017-07-261-3/+1
| | | | | Change-Id: I50fdaed0d813b5004c1756e9c5a6efd3ce7a3318 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* CMake: Do not react to builds in the backgroundClaus Steuer2017-06-201-0/+2
| | | | | | | | | | | | | | | | If an error occurs while persisting or updating the cmake state, the build might continue for a while in the background. CMakeBuildStep does not disconnect the Error/Run-Trigger when an error is signaled by the CMakeBuildConfiguration. Instead it reports the build as finished (with error). The BuildManager then disconnects the output and runs the next item in the build queue (if any). However the cmake step might still be alive and emits the dataAvailable signal which then triggers the build process. Task-number: QTCREATORBUG-18382 Change-Id: I956133fe8c6f7de58b9f842b231c70d24778b1e0 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* CMake: Add "test" target to cmake buildsTobias Hunger2017-06-131-0/+1
| | | | | | | | | | | | | Always show a test target for cmake projects. This will show even if there are no tests in the project. But I think it is more annoying *not* to be able to run tests via the locator when tests are available than getting an error message when attempting that with a project that does not have tests. Task-number: QTCREATORBUG-18323 Change-Id: Iba85aa868cb9bfe6c3f44a7ffff620d081d3082f Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Define an "install" targetTobias Hunger2017-04-271-0/+2
| | | | | Change-Id: I036ddc3bfb91fc3a5a9e8923db2befbf60e89a77 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QRegExp include cleanupSamuel Gaist2017-03-131-0/+2
| | | | | | | This patch adds the missing include statements for QRegExp. Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* ProjectExplorer: De-duplicate code in IBuildStepFactory derived classeshjk2016-06-101-7/+3
| | | | | | | | | | | | | | This removes 900 lines of duplicated code, some duplicated checks at runtime and some (minor) quadratic behavior when gathering display names. canClone(), canRestore() and canCreate() and restore() use the same pattern. Handle that on the core side once. Leave retore() virtual to let the ios code unmodified (which is likely not needed, later...). Introduce 'Unclonable' and 'Uncreatable' flags to keep Android package installation and WinRT deployment (non-)functionality unchanged. Change-Id: I0325479aff818a4038b2f241ca733b8d8cd66f2f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Only allow one target in cmake build stepTobias Hunger2016-03-301-9/+5
| | | | | | | | | CMake will silently ignore all but the last target (or fail to build anything). This allows to simplify our code. Change-Id: Ieee3931aca0788307107e2021d507073ef42a21f Task-number: QTCREATORBUG-15928 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* CMake: Keep cmake state in a temporary directory till first buildTobias Hunger2016-02-261-0/+6
| | | | | | | | This avoids creating lots of build directories as the user types in something into the builddirectory line of the build settings. Change-Id: Ib08a0f65e08bce104e4baf9e19fb01730d2f5f08 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CMake: Move BuildDirManager from the project into the buildconfigurationTobias Hunger2016-02-261-2/+3
| | | | | Change-Id: I90126ff22dd394eba4145db142b3914d211af476 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CMake: Cleanup filesTobias Hunger2016-02-121-1/+0
| | | | | Change-Id: I22a20e598389bf27417bcb230dd469f8f9dfce0e Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CMake: Use pragma once consistentlyTobias Hunger2016-01-271-3/+1
| | | | | Change-Id: Id164dea5e7047b87c3d11c53ebd044d567129e9c Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CMake: Semi-automatic cleanupsTobias Hunger2016-01-081-18/+16
| | | | | | | | | | | * Shorten header guards * Use override and auto where possible * Remove useless destructors, etc. * Remove private slots sections, unify private: sections * Use member initialization where it makes sense Change-Id: I00eaf6d706adc16859176d1b68c631d3336bb39f Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* CMake: Use "cmake --build" to buildTobias Hunger2016-01-081-19/+10
| | | | | | | This removes the need to know about ninja and make in the cmakebuildstep. Change-Id: Id3a15c34f4a8003c3cbf9d62f246bd08f0ada264 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* CMake: Move MakeStep to CMakeBuildStepTobias Hunger2016-01-081-0/+173
Change-Id: I2a3432acd90cc27fb444ab30c3239497a51e01df Reviewed-by: Cristian Adam <cristian.adam@gmail.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>