Commit Graph

41 Commits

Author SHA1 Message Date
Jarek Kobus
d278923dd4 CMakeParser: Ensure the details list isn't empty
Amends bda5c6a228

Fixes: QTCREATORBUG-29732
Change-Id: Iac518227df42c4d22b808028958210485a9c02ff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-09 12:15:22 +00:00
Cristian Adam
9ab9c88e0a CMakePM: Include the last error/warning line from call stack
This was the first one reported by CMake, and we need to make sure it's
also included.

Change-Id: I5becfffc1afb35a4f69fd26d8563aa1ea6eaea60
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-05 16:23:41 +00:00
Cristian Adam
edf4280bd9 CMakePM: Support errors with call stack
This is usually the case when using a custom CMake API e.g.
qt_add_executable.

The topmost function is highlighting the error now, presenting the
callstack in the tooltip.

Change-Id: Ic8b8f60e8fe94d88dfa0b384639172370382a421
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-05 15:15:20 +00:00
Cristian Adam
bda5c6a228 CMakePM: Preserve newlines in multi-line error messages
This way the popup message is not spanning the whole screen.
Testable with find_package(Qt7 REQUIRED).

Change-Id: I3f1943b603baa02c55f2f8f63c75908468e69d9a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-05 09:59:39 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
hjk
3b84a408df CMake: Allow parser to run remotely
Change-Id: I3953d459177790fd652ab69c083b0dd0f1d29031
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-04 10:46:51 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Christian Kandeler
56e838da70 CMakeProjectManager: Check for generic ninja error message
... in the output parser.
This improves the user experience for the edge case that the failing
tool did not emit a (known) error message, and does not hurt otherwise.

Fixes: QTCREATORBUG-27606
Change-Id: I74cd327b1daff80ea2f46620e9d169a3db73578e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-15 08:42:35 +00:00
Cristian Adam
a2c70d1a12 CMakePM: Add CMake warning parsing support
Previously the CMake warnings weren't displayed in Qt Creator's
issues pane.

Fixes: QTCREATORBUG-26231
Change-Id: I3e8e3dbfaed3649e99bbbc8f006093d7c81d2b8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-08 08:31:42 +00:00
Alessandro Portale
38a38cd0ed Utils: Fix output formatter "new searchDir found" signalling
Change-Id: Id9bc5cb0641dbac902b7d5af8ee3d00e0308478e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 12:55:34 +00:00
Christian Stenger
d8b1fcb9d3 CMakePM: Replace some QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: Ib40d97cf2b39105e7db9f886c125a2430119d14d
Reviewed-by: hjk <hjk@qt.io>
2020-06-16 12:09:21 +00:00
Christian Kandeler
b02f6b5d30 ProjectExplorer: Give the Task class an explicit summary
We'd like to create more useful tasks from compiler output, that is, try
harder to identify consecutive lines that refer to the same issue and
create one task for them, rather than one for each line. In such
"aggregate" tasks, the first line will not necessarily carry the main
information. Therefore, we make it explicit what this main information
is by introducing a dedicated summary member.
Also streamline the font handling for compile tasks.

Change-Id: I933f2643a13c710dab1ab548c56669b129026eb5
Reviewed-by: hjk <hjk@qt.io>
2020-05-14 08:23:59 +00:00
Christian Kandeler
1c6e4fbd32 Merge output formatters and output parsers
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>
2020-04-23 08:47:08 +00:00
Christian Kandeler
6f32538c5d ProjectExplorer: Split up the IOutputParser class
For symmetry with Utils::OutputFormatter.

Task-number: QTCREATORBUG-22665
Change-Id: I148fed69dba042ad3ef26e080829c31cd3f357fd
Reviewed-by: hjk <hjk@qt.io>
2020-04-16 10:40:33 +00:00
Orgad Shaneh
d3ebd70ab2 CMake: Fix GCC warning
cmakeparser.cpp: In member function ‘virtual ProjectExplorer::IOutputParser::Status CMakeProjectManager::CMakeParser::doHandleLine(const QString&, Utils::OutputFormat)’:
cmakeparser.cpp:143:1: warning: control reaches end of non-void function [-Wreturn-type]
  143 | }
      | ^

Change-Id: I876e096d965444b9b72ef0dddcbc52e7a201eb02
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-14 10:32:36 +00:00
Christian Kandeler
45ba9fcd53 Output parsers: Replace the chaining approach
Use "flat" aggregation instead.
This is another step towards the formatter/parser merger.
Along the way, also fix some some subclasses (mostly in BareMetal) that
erroneously forwarded handled output to other parsers.

Task-number: QTCREATORBUG-22665
Change-Id: I12947349ca663d2e6bbfc99efd069d69e2b54969
Reviewed-by: hjk <hjk@qt.io>
2020-04-09 14:49:32 +00:00
Christian Kandeler
98fb412e6e IOutputParser: Replace std{Out,Err} with a single parameterized function
Another step towards parser/formatter unification.

Task-number: QTCREATORBUG-22665
Change-Id: I6de86b3aee2c54585cdd4b06d21b0ea67300aeac
Reviewed-by: hjk <hjk@qt.io>
2020-04-08 09:31:33 +00:00
Christian Kandeler
7745eacc7a Output parsers: Generalize the search directory concept
All parsers can now have search directories, not just the GnuMakeParser.
This allows us to get rid of the "task mangling", removing another
instance where the order of parsers in the chain mattered.

Task-number: QTCREATORBUG-22665
Change-Id: Id0d55522ae6800afd9f50ff36546224b0d8bb382
Reviewed-by: hjk <hjk@qt.io>
2020-04-07 15:20:22 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +00:00
Tobias Hunger
2c82422932 CMake: Do not pass on normal CMake output to other parsers
This should avoid false positives with lines like this:

-- Qt5 install prefix: /usr/lib

which the toolchain may misinterpret otherwise.

Task-number: QTCREATORBUG-22837
Change-Id: I30a6fef6771edf37a9737366ae717d149cccfab6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-10-09 14:32:56 +00:00
Tobias Hunger
35bb768f4a CMake: Make CMakeParser work again
The CMakeParser used to set relative paths in the Tasks it creates.
Since is problematic: Task tries to match that relative file name to
one of the files that exist in the session.

At the time cmake runs only the top-level CMakeLists.txt file is known,
so this logic will map all the relative file paths to that file.

Make sure to write absolute file paths into tasks so that this mapping
is not attempted.

Change-Id: I4ab72df21f18d2eff27ca9a502d605e00df2ad85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-25 09:13:39 +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
Tobias Hunger
bee61b0fec CMake: Improve parsing of "CMake Error at" messages
Handle more "CMake error at" messages. This includes the generic
"Parsing failed" message from cmake.

Change-Id: Ie036c606bd7a8ad9cafbc32a34a77f8b95c3defa
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-21 08:06:08 +00:00
Tobias Hunger
021ea165dd CMake: Export CMakeParser
Task-number: QTCREATORBUG-17731
Change-Id: Iae2fdb0fd06489c558a58c698553edeaec9924ce
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-23 12:00:16 +00:00
Tobias Hunger
e872966494 CMake: Better error parsing
Change-Id: I9065851f6c2b994d4819e202e6ce1571a3f53308
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-27 11:42:06 +00:00
Tobias Hunger
335b9644b6 CMake: Remove debug output
Change-Id: I69e1fd6462f5b03bad8721b236529a12b48a2fc8
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-12 13:13:24 +00:00
Tobias Hunger
c7d906214b CMakeParser: Remove sub-parser setup from CMakeParser
This makes the class more applicable for later re-use.

Change-Id: Ic717dd63962b254fce639061f16b1ca8e12d8098
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-12 12:37:18 +00:00
Tobias Hunger
c3aac7624c CMake: Parse cmake syntax errors
Improve the CMakeParser so that it picks up the most common
errors/warnings that cmake throws when running into errors while
parsing its CMakeLists.txt files.

Change-Id: Ie3774695418f13aa3869d78802c1a552e6fd384e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-12 10:56:54 +00:00
Tobias Hunger
babb93a682 CMake: Fix WS issue
Change-Id: Ic3f59f4c9a5337c1189696fde8fe49ba711265f3
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-08 11:14:38 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
b2b6d3c526 CMake: Semi-automatic cleanups
* 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>
2016-01-08 12:17:41 +00:00
Daniel Teske
4f383f77b4 Tasks: Make the linking of compile output to Tasks more robust
Clicking on error messages is supposed to jump to the editor.
And "Show Output" on the task is supposed to select the error
in the output.

The old code just registered the task for the last line of
output. This broke for every parser that allowed for
error messages that spanned multiple lines. And was obviously
also incorrect for tasks that weren't generated due to
compile output.

Fix both of those issues by giving the IOutputParsers more
control on which lines are linked to a task.

Task-number: QTCREATORBUG-14136
Change-Id: I095922c9875620dabfb7d406f6b152c8a9b25b62
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-04-21 13:42:03 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Orgad Shaneh
4442a92729 Braces cleanup
Change-Id: I8413252c90a1487d291f15d92837c30ab697b245
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-11-14 08:13:52 +01:00
hjk
f17d9f01dc Use the canonical version of defining string literals
Change-Id: If36658de6f68f552f93830ba4f1cfa9994a2e44c
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-27 14:36:10 +02:00
Tobias Hunger
d468f072cf CMake: Put cmake errors into category "Build system"
Change-Id: Ic331ddf90e7d3c74f18dbe65be2dcc458777bc3a
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-08-20 12:19:54 +02:00
Orgad Shaneh
9744c54580 Add soft assertions for regexp patterns
Change-Id: If0072f8f9761bdc34b35d01aac4d00c5391b8a20
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-19 13:01:20 +02:00
Nikita Baryshnikov
ee266048f6 Cmake: Added cmake errors parser
Added cmake errors parser

Change-Id: I137f62111861c7e72d84e44b5ab631b9f60c2834
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-17 11:49:09 +02:00