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>
This commit is contained in:
Christian Kandeler
2020-04-16 13:53:05 +02:00
parent b7851eeb55
commit 1c6e4fbd32
115 changed files with 1124 additions and 1179 deletions

View File

@@ -60,6 +60,7 @@ public:
private:
bool init() final;
void setupOutputFormatter(Utils::OutputFormatter *formatter) override;
void doRun() final;
QStringList m_androidDirsToClean;
@@ -111,10 +112,6 @@ bool AndroidPackageInstallationStep::init()
pp->setEnvironment(env);
pp->setCommandLine(cmd);
setOutputParser(new GnuMakeParser());
appendOutputParsers(target()->kit()->createOutputParsers());
outputParser()->addSearchDir(pp->effectiveWorkingDirectory());
m_androidDirsToClean.clear();
// don't remove gradle's cache, it takes ages to rebuild it.
m_androidDirsToClean << dirPath + "/assets";
@@ -123,6 +120,14 @@ bool AndroidPackageInstallationStep::init()
return AbstractProcessStep::init();
}
void AndroidPackageInstallationStep::setupOutputFormatter(OutputFormatter *formatter)
{
formatter->addLineParser(new GnuMakeParser);
formatter->addLineParsers(target()->kit()->createOutputParsers());
formatter->addSearchDir(processParameters()->effectiveWorkingDirectory());
AbstractProcessStep::setupOutputFormatter(formatter);
}
void AndroidPackageInstallationStep::doRun()
{
QString error;