aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unification of desktop run configurations, step 1hjk2019-08-071-170/+0
| | | | | | | | | | | | 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>
* QbsProjectManager: Ensure run config display name after restoringChristian Kandeler2019-08-021-0/+1
| | | | | | | Amends 1d7f6fe298. Change-Id: Ie2b37eb5c83d662e51fa9fc68f878c3d42765985 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Propagate build environment changes more directlyhjk2019-07-261-2/+2
| | | | | | | | | | | | | | | To check this still works I used a CustomRunConfiguration with a executable name $AAA, the tooltip there tries to expand that (and complains that $AAA is not an executable). By inserting a AAA=/bin/ls in the build environment, the tool tip on the run config exectable path chooser changes appropriately, same for changing the AAA value. The connection seems also needed, dropping it destroys that updating. Change-Id: I28965cbd3ce530a83d98808ca7624a6799cd9800 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-5/+5
| | | | | | | | 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 the new way for dependent aspectshjk2019-05-281-1/+1
| | | | | | | ... for WorkingDirectory aspects. Change-Id: Idf64f1daeb74a70637bb983db1b45f0132cfc299 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Qbs: Move environment cache from runconfiguration to projecthjk2019-05-241-14/+1
| | | | | Change-Id: I2a987e55cde133931bb4578506bb26666eece601 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-05-171-1/+8
|\ | | | | | | | | | | | | Conflicts: src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp Change-Id: I473084232ab99c18e2316154656de0035af02628
| * QbsProjectManager: Skip run environment retrieval if project is parsingChristian Kandeler2019-05-091-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ...or building. We must not access the internal state of qbs::Project while a parse or build is going on, as that could lead to race conditions. This can potentially leave the run configuration with an incomplete environment temporarily, but eventually we'll get the correct one once the project has finished parsing. Fixes: QTCREATORBUG-22386 Change-Id: Iee3c36aadae9e3a6070993436890eb1ee89354e6 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | ProjectExplorer: Introduce a SimpleRunWorkerFactory templatehjk2019-03-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and use in as replacement for RunConfiguration::addRunWorkerFactory. It is still convenient to have a simple way to set up run worker factories for the typical "just run for this configuration" case, but it's even better if it follows the nowadays predominant pattern of keeping factories in the plugin's pimpl. Also, it turned out there were two copies of QmlProjectRunconfigurationFactory code, one is enough. Change-Id: I0b28c4ea18d0f52165a49f6133dc8687a3b9c7cf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Let user provide default for "run in terminal"Christian Kandeler2019-03-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | We enable the "Run in terminal" checkbox for all applications that declare themselves console apps, but that's not necessarily what the user wants. So let them opt out of this mechanism via a global setting. [ChangeLog] There now is a global setting for "Run in terminal". Change-Id: Ieeed72fdd01144d9aec0a7c7d4a12b9e5a94cd1d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | ProjectExplorer: Move RunControl related classes to separate file pairhjk2019-03-131-0/+1
| | | | | | | | | | Change-Id: I5da56f80336673d595907abcc797f628be680cd5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Split EnvironmentAspecthjk2019-03-111-22/+19
| | | | | | | | | | | | | | | | | | | | | | ... at least logically a bit more into hunks responsible for one of the possible choices of base environments. This makes it possible to move code that modifies individual cases closer to the only place that uses it. Change-Id: I1c87bb869e04e44b92ff097b0bf25274f93808be Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Remove RunConfiguration::canRunForNode()hjk2019-02-261-8/+0
|/ | | | | | | | | | | | | All implementations that were returning true effectively did that in case of node->buildKey() == rc->buildKey(), either directly or in disguise of qmake's projectPath, so this is the check that is used now in the two places where this is used. The new global has the theoretical potential of return true in cases where it did not before. Change-Id: Ic5829de5fef0f9a04d516a3d9207685055823775 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Reduce qmake specific logichjk2018-12-041-4/+2
| | | | | | | | | | | | | | | | | | - add a QString FileNode::buildKey(), returning the build key for a build represented by that node, if any. * for QmakeProFileNodes the build key is traditionally equal to the file name, so use that. * for QbsProductNode use the uniqueProductName() - add a Project::findNodeForBuildKey(QString buildKey) convenience function searching a Project(!)Node matching that build key. That's the only use case there is right now, and I see no reason yet to travers all files (yet). Change-Id: I388c0e06c03111e12d630899d762448e974a5737 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Rename 'extraAspect' to 'aspect'hjk2018-10-021-5/+5
| | | | | | | | | Using aspects is the standard pattern nowadays, there's nothing 'extra' to them anymore. Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* ProjectExplorer: Remove IRunConfigurationAspect::runConfigurationhjk2018-09-131-1/+1
| | | | | | | | ... and adapt constructors to not take the now-unneeded RunConfiguration pointer. Change-Id: I53ff338f51334ff7b0c22d4bed92bfcfc8225ea7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Make WorkingDirectoryAspect less dependent on runconfighjk2018-09-101-1/+1
| | | | | | | | | | This was one of the genuine users of the run config pointer in the aspect base class. Instead of using that stored pointer to retrieve the relevant environment aspect pointer later, pass and store this env aspect pointer at construction time. Change-Id: Icbdeb9ad0fe341e4003fb544c542064801aa170f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Simplify LocalEnvspect's BaseEnvironmentModifierhjk2018-09-061-3/+1
| | | | | | | The run configuration is known at setup time, and fixed. Change-Id: Iad7837bf39fb5eeed49bd71b7f14b9692014ea9d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Compactify runconfiguration aspect creationhjk2018-09-041-10/+7
| | | | | Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Unify key names for various fields in stored RunConfigurationshjk2018-08-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This replaces various versions of the key name of the arguments, working directory, use terminal and use dyld image suffix fields by unified versions ("RunConfiguration.Arguments", "RunConfiguration.WorkingDirectory", "RunConfiguration.UseTerminal", "RunConfiguration.UseDyldImageSuffix"). The different names for the fields are technically not needed (as proven by several cases that already now used the same key), partially outdated ("Qt4ProjectManager.MaemoRunConfiguration.Arguments") make RunConfiguration constructors less uniform and more complex than needed. The "RunConfiguration." prefix in the new names is not needed, but used by several other settings, so having it there looks more uniform now. In (the unexpected case) that different keys would ever be necessary, the default key name could still be overridden by using setSettingsKey from user code. Change-Id: Ifb74ad74e0a9c724c8bf5e71e1bb2424d5d1831b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* QbsProjectManager: Add run config checkbox for using debug frameworksChristian Kandeler2018-07-301-0/+10
| | | | | | | | As it already exists in the qmake project manager. Task-number: QTCREATORBUG-20411 Change-Id: I8673e091b3f5772fdc1ddcac0e567f690960f1dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QbsProjectManager: ModernizeAlessandro Portale2018-07-271-1/+1
| | | | | | | | | modernize-use-auto modernize-use-nullptr modernize-use-override Change-Id: I8a67b87e614f54554f9ca50c9f5e3f3297458ec1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Tie SimpleTargetRunner desktop usages to individual RunConfigurationshjk2018-05-311-0/+2
| | | | | | | | | | This avoids the "catch all" that leads to conflicts with more specific setups like the AppManagerRunConfig, and consequently lets us remove the priorities in the RunWorkerFactories. Change-Id: I382f00ca7f759eef995ac6fe749bb371ab027020 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* QbsProjectManager: Fix the paths of non-installed executablesChristian Kandeler2018-05-071-0/+2
| | | | | | | | ... in run configurations. One check was missing. This amends c6cd9e8fbe9ed. Change-Id: If398a719adbb5a5c2a527b70d274751ada91abe4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Introduce a RunConfiguration::buildTargetInfo() functionhjk2018-04-271-2/+2
| | | | | | | As convenience function, and use it in some places. Change-Id: I02e49f2cdc301bbf1261836032d3fa3a5b188446 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Pass id to RunConfiguration constructorhjk2018-04-251-5/+3
| | | | | | | | | | | It's what the base class requires, and opens the possibility to have several factories creating the same type of run configuration. Also move ios, winrt and android factories closer to their products, it's the predominant pattern nowadays. Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Factor out some common code in runconfigurationshjk2018-04-241-41/+0
| | | | | | | | | | | | | | DesktopQmake, CMake, Qbs, Nim, RemoteLinux and Qnx now have a common understanding what should be in a runnable and how their configuration widget should be set up. So move them over to using shared code, too. Several others runconfigs only lack a one or two more aspects to follow suit in later patches. Change-Id: Ia862c95c97d63bd0a0f2dc303435775a2fc530d3 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Qbs run config: Run executable from installed location, if possibleChristian Kandeler2018-04-171-2/+14
| | | | | | | | | It's been like that for a long time, but the behavior was inadvertantly changed in a recent refactoring. Change-Id: I2f301c995c1f9bb235718e02326c4c64dea91694 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Qbs: Re-add a connection that was lost on mergeOrgad Shaneh2018-04-161-0/+2
| | | | | Change-Id: I74484fef775da269f7444e2ebb22435d32da9a26 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Qbs: Use project from input targetOrgad Shaneh2018-04-161-1/+1
| | | | | | | Changed in recent merge. Change-Id: I06457929072c1a8937ba702e093a3dff1ce7f2ff Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ProjectExplorer: Introduce runconfig aspects for some bool valueshjk2018-04-131-27/+12
| | | | | | | | | | And use it to handle adding extra library path for qbs and qmake and and the DYLD debug suffix for qmake. Could possibly be used more uniformly at some stage e.g. for CMake. Change-Id: I0c4581b4e36960fc76d056c65c487d7c43a1be08 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Streamline OutputFormatter creation a bithjk2018-04-131-5/+2
| | | | | | | | | | Note that the concept of a single monolithic OutputFormatter per RunConfiguration (and why RunConfiguration, not RunControl to start with?) is unchanged and suboptimal as one cannot easily combine existing use cases, e.g. Python_and_Qt. Change-Id: Ibeb8191020387324f22ed313230293597f96e36a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-04-131-2/+9
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/settingsaccessor.cpp src/plugins/autotest/autotestplugin.cpp src/plugins/git/gitclient.cpp src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp src/plugins/qbsprojectmanager/qbsrunconfiguration.h Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
| * QbsProjectManager: Cache run environmentChristian Kandeler2018-04-061-0/+8
| | | | | | | | | | | | | | | | | | Setting up the qbs run environment is not free, and the respective code gets triggered from other plugins much more often than expected. Task-number: QTCREATORBUG-20175 Change-Id: I6529718d20738140963486caef103d6d17958d50 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * RunConfigurationFactories: Fix crash opening non-qmake based projectsTobias Hunger2018-03-071-1/+1
| | | | | | | | | | | | | | | | | | Make sure the Qnx RCs only get triggered for qmake-based projects and defend against broken set-ups using QTC_ASSERT. Task-number: QTCREATORBUG-19755 Change-Id: If64b73de49b0199308f767151d68909dc8b1bc53 Reviewed-by: hjk <hjk@qt.io>
* | ProjectExplorer: Consolidate RunConfiguration identificationshjk2018-04-121-35/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previously per-Project/RunConfiguration changing meanings of BuildTargetInfo::buildTarget have by now been split into separate values in BuildTargetInfo: - buildKey a handle to one item in Target::applicationTargetList - displayName a user-visible string in the run settings page The buildKey was tweaked to coincide with the previous 'extraId', i.e. the non-RunConfiguration-type part of the project configuration id that (still) use id mangling. This allows replacing the cases of locally stored seven different versions of buildKey(-ish) data by one RunConfiguration::m_buildKey, and do all remaining extraId handling in RC::{from,to}Map only, i.e. remove the base ProjectConfiguration::extraId() virtual and remove the "re-try fromMap with mangled id" hack entirely. The id mangling is still used to temporarily maintain .user file compatibility in some cases for now, but should be replaced by storing the build key and the RunConfiguration type soon. Qbs already changes in here to only use the uniqueProductName as buildKey, without the previously added display name which is stored as part of the ProjectConfiguration already. It turns out that RunConfiguration::buildSystemTarget was intended and used to retrieve an item from the Target::applicationTargetList for some configurations, coinciding with what buildKey does always. So use that insteand and drop RunConfiguration::buildSystemTarget. There is clearly is further consolidation potential left. handling of (default)displayNames is still a per-runconfiguration mess and there is further consolidation potential left. Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Let users set a global default for whether to amend the run environmentChristian Kandeler2018-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | ... with the paths of libraries used at link time. The value can still be set per run config. Task-number: QTCREATORBUG-20240 Change-Id: Ibe2425e95d791f93af2fba85a64be8bde6b31f5a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | ProjectExplorer: Start unifing visual appearance of run config widgetshjk2018-04-101-2/+0
| | | | | | | | | | | | | | | | Margins and layout style widely differ so far. Start moving everything to a QFormLayout with the same margin and growth policy. Change-Id: I0bd1d8b2ec9830be56354be1376a2a24eebb8845 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Qbs: Rework RunConfigurationhjk2018-04-051-110/+44
| | | | | | | | | | | | | | | | Use new ExecutableAspect, simplify working directory and 'use terminal' access. Change-Id: I1daca3a30a4a46f3e1ad0019a49d28279cbc885f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Qbs: Split mangled build key only when neededhjk2018-04-041-21/+10
| | | | | | | | | | | | | | | | | | Easier to keep one variable in sync than three, and moves the code closer towards a unified pattern in the local runconfigurations. Change-Id: I2df09127d476be4ddab466f8a709a2b383a76b97 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Consolidate some run configuration widget boilerplatehjk2018-03-221-12/+2
| | | | | | | | | | | | | | | | | | | | | | This removes the outermost layer of widget-vbox and moves some common code into a helper function. The pattern repeats (with variations) a few more times, that's left for later patches. Change-Id: I8c98229cf41d03d5330c896ec9fa0965bfc65602 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | ProjectExplorer: Let RunConfiguration declare what nodes it belongs tohjk2018-03-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature in question is the availability of the "Run" button in the context menu of certain project nodes in the project tree to run something presumably related to/build from that (sub)project. Previously, the decision was made for certain qmake based projects (those targeting Desktop, iOS and VxWorks) by some indirection through the corresponding RunConfigurationFactories. The patch lets the RunConfigurations decide themselves directly and removes the indirection, potentially opening the feature for other qmake based RCs, as well as other combinations (e.g. PythonRunConfiguration could be associated with its .py file, without the need to have a dummy project) Change-Id: Ic489bd1dfa25fcd9102ffa4fa30125565dd2e40e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | QbsProjectManager: Move QbsRunConfigurationWidget to .cpphjk2018-03-121-68/+68
| | | | | | | | | | Change-Id: I4fd99a2e0a82911bd849879f50ebff24bb4d8be8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | QbsRunConfiguration: Re-model based on RemoteLinux precedencehjk2018-03-121-192/+91
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-19985 Change-Id: Ifd95187b72fed3565552ecd14f3353b7e7df0069 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | Rename IRunConfigurationFactory to RunConfigurationFactoryhjk2018-03-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | It's not an *I*nterface anymore Also, remove the in-all-but-one case unused QObject parent and the object name that was only there for debugging purposes. The class type serves the same purpose in the debugger. Change-Id: I0dafb01e6b4fd7c7df04a63aaa3ef3e4bd693f6f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Introduce and use IRunConfiguration::addSupportedTargetDeviceTypehjk2018-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | In line with addSupportedProjectType, saves a few cycles due to the non-use of the temporary list, and in theory more flexible than the existing set...(QList<Id>) as it potentially allows dependent plugin to declare support for already existing configurations instead of re-implementing their own. Change-Id: I2b83e90de49daa9bfce6f780c5f51c2e971eb7d1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Simplify collection of RunConfigurationCreationInfoshjk2018-02-151-11/+15
| | | | | | | | | | | | | | | | | | Instead of calling twice for AutoCreated and UserCreated, call once and record to which case it belongs. Only the 'both' and 'user only' combination are ever used. Change-Id: I9c15085bcbb4bf6584a6156135f2084dbfc51c1c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-02-131-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp Change-Id: I2445882a270731b866b04f28ff87d161224c539a
| * QbsProjectManager: Fix uniqueProductName() and productDisplayName()Christian Kandeler2018-02-091-1/+1
| | | | | | | | | | | | | | These still assumed we can only multiplex on profiles. Change-Id: Ice3dfe06c1be732ecae42db75155e930b0554b6f Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | IRunConfiguration: Remove BuildTargetInfo from the RC factory APIsTobias Hunger2018-02-061-7/+6
|/ | | | | | Change-Id: I1d77d22a1c1ce1cbcfca8af7855ae7b935ac1c2c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>