Commit Graph

322 Commits

Author SHA1 Message Date
Tobias Hunger
e4738904d9 TargetSetupPage: Improve reporting on invalid kits
Give the reason for a kit being disabled in the tooltip.

E.g. for a CMake project you will now get

"Kit is invalid: No CMake tool set."

instead of a generic error message about the kit being invalid.

Change-Id: Ic776dc24149d65ebf27163b605ec2e52a3a504a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 13:50:57 +00:00
Christian Kandeler
38cd7b1aa0 ProjectExplorer: Use different build dir when copying build config
...into another target.
Using the same build directory in two different targets will likely lead
to errors.

Fixes: QTCREATORBUG-23462
Change-Id: I7daa510b3128a344adb51772d44a79415419acc3
Reviewed-by: hjk <hjk@qt.io>
2020-01-16 13:32:52 +00:00
hjk
82265d51a7 ClangTools: Attach ClangToolsProjectSettings data to project itself
Easier to reason about life time.

Change-Id: I2c61527532f6faa344fc59d858921e66daaf0b7e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-14 14:04:36 +00:00
hjk
b4ee6eb3c0 ProjectExplorer: Move some of the BuildInfo setup code to central places
Change-Id: I8893366acb187ea1a94a8ca272ded2c46cb521d1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-14 13:56:10 +00:00
hjk
e109b731ad Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here.

Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-18 08:43:18 +00:00
Christian Kandeler
6e0d44b0ff ProjectExplorer: Let users provide project-specific environment
Add a new project panel where users can set environment variables for
the current project in all configurations.

Fixes: QTCREATORBUG-21862
Change-Id: Id98c7f1cf579927a8004a63172f193f943556f44
Reviewed-by: hjk <hjk@qt.io>
2019-12-12 16:34:22 +00:00
hjk
3c41b91d44 ProjectExplorer: Settle on fixed set of build step lists
Even if the implementation allowed different lists than 'build'
and 'clean', that's the only set that has been used, ever.

If really needed, this could be re-instated, but for now having
them fixed removes part of the neeed for a two-phase construction
and helps to simplify user code.

Change-Id: I3df09a1829a7d020ef8963d358ea80f8d199ba13
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-06 14:49:59 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
hjk
6a878c7293 ProjectExplorer: Use a functor for BuildSystem creation
... instead of creating the BuildSystem direct. This will help the
shift of BuildSystem owner ship as a Project will have potentially
multiple BuildSystem instances (one per BuildConfiguration), but
still be responsible for creating them with the Targets.

Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 09:01:52 +00:00
hjk
67c74fbe29 ProjectExplorer: Do not return early on parsingFinished assert
This is a hack, not a proper solution. In theory, this here should
serve as a lock.

We currently get start - start - finish - finish sequences when
switching qmake targets quickly, keeping the run button disabled.

The whole setup here is unfortunate. Parsing inherently depend on
more than the project alone, it's roughly per-Target. So keeping
track of it in the Project complicates it.

Change-Id: I57d361ce21088d8e1ec53ce75f83ff3bd04851e1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-22 13:20:38 +00:00
Orgad Shaneh
d26140e7f1 Qmake: Show real effective make call on Make step - take 2
Include custom Makefile.

Change-Id: Ibc6a341590f8b1ff0da2fa87f5e5bcd75182b6a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-08 08:33:25 +00:00
Tobias Hunger
b7e4046a17 ProjectExplorer: Add BuildSystem class
Add a class to abstract out the BuildSystem from the Project.

Thie idea is to make a Project have-a BuildSystem, so that
it can stop being one.

The Projects in the different ProjectManagers will get much
simpler that way (and many will only consist of a constructor
with some setter calls) and handles all the interactions
between the rest of Qt Creator and the project.

The complex code to interact with the build systems is then
separate from that.

Change-Id: I3bbb000bb1aed91f0b547ac493f743ede8afb8cd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 07:28:04 +00:00
Tobias Hunger
a699a0c92e Project: Improve activeParseEnvironment
Not all Projects have build configurations. Handle those better.

Change-Id: I72e63798f034a2a497978a2844c4158dfd09ef0f
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 07:28:34 +00:00
Tobias Hunger
3eea938a04 Project: Rename Project::activeBuildEnvironment to Project::activeParseEnvironment
This is used for parsing the project only, so reflect that in the name. Not all
projects have build configurations, so the old name did not make too much sense
for what this has been used for.

Eventually this code should move into the BuildSystem.

Change-Id: Iff766150b5fe370f2912b0b3b15348b1c1fad5b5
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 07:28:18 +00:00
Tobias Hunger
14b1b3137b ProjectExplorer: Assert that the filter passed to Project::files is valid
QTC_ASSERT that the filter passed to Project::files is valid before
calling it.

Change-Id: I17776fa4ab3e2aa21ac34db015fdbbb382439669
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-26 11:10:15 +00:00
Tobias Hunger
d272a64eab Project: Remove Project::document() method
The document is used to do file watching, which may or may not be
ideal. So make sure we do not leak the information how we watch
files into the API and its users.

The method is not used sensibly anywhere in creator, so it seems
safe to remove it entirely.

Change-Id: Ieed755bd5c852875378e4e96665dc906499975b0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:27:06 +00:00
Tobias Hunger
109a8b1829 ProjectExplorer: Clean up Project
Change-Id: I870ef9f57e1a3ae3bc61351322c71d3ce5381d98
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:26:50 +00:00
Tobias Hunger
d13307b5bf Project: Add signal triggered by project files becoming dirty
Add a signal triggered by project files becoming dirty and add
a way to register more project files than just the default with the
project.

This change enables getting rid of filesystemwatchers in derived
classes.

Change-Id: If985b46edf7cb88dd49f1c574f35cf13b5ce82d4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-16 12:43:21 +00:00
hjk
d2a0b13252 AutoTest/ProjectExplorer: Move some unusual function towards only user
Change-Id: I1101a21871c8b1eac5c01afc033e5416850bc794
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-14 11:48:36 +00:00
Tobias Hunger
ae345003aa ProjectExplorer: De-virtualize some more virtual methods
Use setters/getters for the bool flags in
Project::needsBuildConfigurations() and
Project::hasMakeInstallEquivalent.

Change-Id: I5ce937c3a5e8e0db627cda02a9007f8c28ccda0c
Reviewed-by: hjk <hjk@qt.io>
2019-08-13 10:24:30 +00:00
Tobias Hunger
09530d6dcc ProjectExplorer: Use RAII pattern for parsing start/stop signalling
Change-Id: I13de537140f265db3e3d0ab1cd924d6897cd90c8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-09 12:45:29 +00:00
Tobias Hunger
d880f1f771 ProjectExplorer: De-virtualize knowsAllBuildExectuables method on Project
Just use a setter instead.

Change-Id: Id5dff64e9a7fcdf64a245b71432318299a49d9f7
Reviewed-by: hjk <hjk@qt.io>
2019-08-09 12:42:53 +00:00
Tobias Hunger
2fa555bdfd ProjectExplorer: Add another missing activeBuildConfigurationChanged signal
Change-Id: If31157a569f13df6e6dbd09ab8148b325bf6858d
Reviewed-by: hjk <hjk@qt.io>
2019-08-09 10:27:34 +00:00
Tobias Hunger
2d6ec5a287 ProjectExplorer: Fix warning
Change-Id: I091746e494ef2cb92f395a09111c055226827804
Reviewed-by: hjk <hjk@qt.io>
2019-08-09 10:27:25 +00:00
Tobias Hunger
926338f509 ProjectExplorer: Emit activeBuildConfigurationChanged on project restore
Change-Id: Id5f2d8b36d99df1ffc6e4e0d8a680b55e57c336e
Reviewed-by: hjk <hjk@qt.io>
2019-08-06 09:14:09 +00:00
hjk
09e5c167bd ProjectExplorer: Add convenience Project::addTargetFor{Default,}Kit
Less noise on the user side.

Change-Id: I5cdf4af4910a3cc1ee0af1b43fcbc7329a6d59db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 16:16:29 +00:00
hjk
72fe2c706e ProjectExplorer: Inline Project::restoreTarget()
... into its only internal user.

Change-Id: I3f2d1a3af757036cc2194967a71ad0d48ed05d9a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 16:16:02 +00:00
hjk
4c80380478 ProjectExplorer: Remove Target::*ProjectConfiguration(...) signals
The only listener left is the target's project, which is known at each
emitting location and can be called directly.

Change-Id: If07d2c1c43fcf5d2094c0b6d59f773d12b4f6d6b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 15:23:25 +00:00
hjk
7d3091a7b9 ProjectExplorer: Remove ProjectConfiguration base from Target
Targets are different from {Run,Build,Deployment}Configurations,
both regarding the level in the ProjectExplorer hierarchy, and
also by the set of supported operations (e.g. aspects).

Change-Id: Ia8490e2280a9ecc518395c5e48ce2fd5d6d58fd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-31 11:18:16 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Christian Kandeler
f7520b7d99 Make the project managers tell the code model about include paths
... from the environment.

Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-12 09:13:42 +00:00
hjk
b9d6721be8 ProjectExplorer: Reduce ProjectExplorer::configureAsExampleProject()
... to the bits that are actually used.

Change-Id: I39a6ed1f4136d75b776bb89eec6165479097a4ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 10:05:19 +00:00
Eike Ziller
10098b2508 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	CMakeLists.txt
	tests/unit/unittest/unittest.pro

Change-Id: I64296ad31502d9b35012da129a28e9277e9fcf8e
2019-06-28 12:50:03 +02:00
Leena Miettinen
77f1a5963d Project Explorer: Fix UI text
Use book-style capitalization for dialog and button labels.

Change-Id: I2c074d83d6a95ad348daacabd561c758e0a493f8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-25 11:58:23 +00:00
hjk
c7badbd701 Use more Utils::CommandLine in make steps
Change-Id: I72bbc65e0bec19a94418f1cb8bf9ba6fafbbe3bc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-20 12:03:55 +00:00
Christian Kandeler
0c74f6cc21 ProjectExplorer: Add "build for current run config" menu entry
This lets users build the executable corresponding to the currently
active run configuration. It's functionally equivalent to locating the
corresponding node in the project tree and choosing "Build" from the
context menu.

Fixes: QTCREATORBUG-22403
Change-Id: Ic2b729c7ce17f1ad944dc06746bb9d6db90b6c61
Reviewed-by: hjk <hjk@qt.io>
2019-06-06 15:05:56 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
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>
2019-05-28 12:23:26 +00:00
hjk
2b1c8aa877 ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 05:51:40 +00:00
hjk
9433b8a7e7 ProjectExplorer: Use Utils::FileName in ProcessParameters
For the command and the working directory.

Change-Id: Ia69dc7100aeb57bb6e1b35f4dd4f3cf3763d8cda
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-15 12:55:22 +00:00
Christian Kandeler
261d7752b0 RemoteLinux: Retrieve deployment info from local install root
This provides correct deployment information as seen by the build system
when Qt Creator cannot retrieve it directly.
It's most useful for autotools and cmake projects, but can also help
with qmake in certain edge cases.

[ChangeLog] It is no longer necessary to provide a
QtCreatorDeployment.txt file when using CMake projects with remote Linux
devices.

Fixes: QTCREATORBUG-21855
Change-Id: I27e07a45dd1565e489f4b573cc3fff8191c57d9b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-23 15:52:05 +00:00
Ivan Donchevskii
2c5808bada CompilationDatabase: Ask for the root path and scan for headers
Let's use the same approach we have for CMake projects by using
the same TreeScanner class.

Compilation database does not have a concept of the root directory
so let's show a file dialog and ask for it the first time the project
is loaded. Next times we open it we take this path from settings.
This root path can later be changed from the project tree context menu.

Fixes: QTCREATORBUG-22031
Change-Id: I151aed8d0504b2e8aa14aa774cad25f8c86d5c17
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-05 15:26:19 +00:00
hjk
4d2981b1f4 ProjectExplorer: Un-protect ProjectNode constructor
Not much protection needed, and not provided either, as seen in
the removed workarounds.

Change-Id: Ib33f6481cdb04481c0324bdeb57eb50143ecb62f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 10:41:50 +00:00
hjk
09372918c1 ProjectExplorer: Remove FileNode's isGenerated constructor bool
Use setter of base class, similar to setListInProject() before.

Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-25 12:23:31 +00:00
Eike Ziller
868160f215 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8fed69168d87afafdb5acf4de4d5d30f9b4ebf5
2019-01-31 08:38:13 +01:00
hjk
9bb936499d ProjectExplorer: Collapse BuildInfo hierarchy
... to pass it around as real values, avoiding, among others,
the need of occasional explicit deletion.

The formerly extra members of the derived stuff are handled via
an extra variant (for data) and via a functor in the build
configuration factory.

The change is mechanical.

Change-Id: I19ca4e0c5f0a5b196fc16dfb98bb005dc679f855
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-30 16:51:05 +00:00
hjk
070e0efdcc ProjectExplorer: Rename IBuildConfigurationFactory
... to BuildConfigurationFactory. It hasn't been an Interface for a
while and the new name matches Run- and DeployConfigurationFactory

Change-Id: I923c6a27e18a99628251b69e0270e910836e7b2a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-29 11:38:31 +00:00
hjk
346ddbaa08 ProjectExplorer: Use DeployConfigurationFactory::clone
... instead of DefaultDeployConfigurationFactory::clone when copying steps.
It's effectively the same function, so functionality is unchanged, but
the Default* class name is misleading.

Change-Id: I004ddcd500498fc5a34f12fea74ddcab3c861e10
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-28 10:02:46 +00:00
hjk
e6a184fe5c ProjectExplorer: Merge Qbs* into DefaultDeployConfigurationFactory
DefaultDeployConfigurationFactory used extra effort to not apply to the
Qbs (Desktop) case, with QbsDeployConfigurationFactory plugging exactly
that hole with essentially the same functionality, which is even the
default of the base class.

The only differences are the display name, which is dropped in this
patch, and the different keys in the .user file, which are updated
with this patch. Note that the display name "Qbs Install" for the
DeployConfiguration stays with this patch whereas a freshly created
one will get the default "Deploy Configuration" name.

Change-Id: I255371d0a0688fbc6303083eb6aa20563e876264
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-25 09:57:08 +00:00
Christian Kandeler
e5a5d38c20 Fix ProjectExplorerPlugin::testProject_setup()
The absolute test paths must be in the right format for the host
platform, i.e. have a drive letter on Windows.

Change-Id: Ibf08a9e8a8b1f9ee1bb19d5307205b53012049b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-24 08:39:56 +00:00
Orgad Shaneh
b46fc4a3b9 ProjectExplorer: Simplify Project::isKnownFile
Use std::binary_search instead of lower_bound. The iterator is not needed.

Change-Id: Ie40441c0780bcf0b912644c4cdfd2d73068fb441
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-21 16:24:25 +00:00