forked from qt-creator/qt-creator
Stop build on fatal make errors
... ignoring a error code of 0 from Make. This is necessary to detect build failures on symbian Do not show errors when ignoring the return value of a BuildStep either. Task-number: QTCREATORBUG-985 Reviewed-by: dt
This commit is contained in:
@@ -43,7 +43,8 @@ namespace {
|
||||
}
|
||||
|
||||
GnuMakeParser::GnuMakeParser(const QString &dir) :
|
||||
m_suppressIssues(false)
|
||||
m_suppressIssues(false),
|
||||
m_fatalErrorCount(0)
|
||||
{
|
||||
m_makeDir.setPattern(QLatin1String(MAKE_PATTERN) +
|
||||
QLatin1String("(\\w+) directory .(.+).$"));
|
||||
@@ -55,6 +56,11 @@ GnuMakeParser::GnuMakeParser(const QString &dir) :
|
||||
addDirectory(dir);
|
||||
}
|
||||
|
||||
int GnuMakeParser::fatalErrors() const
|
||||
{
|
||||
return m_fatalErrorCount;
|
||||
}
|
||||
|
||||
void GnuMakeParser::stdOutput(const QString &line)
|
||||
{
|
||||
QString lne = line.trimmed();
|
||||
@@ -75,6 +81,7 @@ void GnuMakeParser::stdError(const QString &line)
|
||||
QString lne = line.trimmed();
|
||||
|
||||
if (m_makefileError.indexIn(lne) > -1) {
|
||||
++m_fatalErrorCount;
|
||||
if (!m_suppressIssues) {
|
||||
m_suppressIssues = true;
|
||||
addTask(Task(Task::Error,
|
||||
@@ -86,6 +93,7 @@ void GnuMakeParser::stdError(const QString &line)
|
||||
return;
|
||||
}
|
||||
if (m_makeLine.indexIn(lne) > -1) {
|
||||
++m_fatalErrorCount;
|
||||
if (!m_suppressIssues) {
|
||||
m_suppressIssues = true;
|
||||
addTask(Task(Task::Error,
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
|
||||
QStringList searchDirectories() const;
|
||||
|
||||
int fatalErrors() const;
|
||||
|
||||
public slots:
|
||||
virtual void taskAdded(const ProjectExplorer::Task &task);
|
||||
|
||||
@@ -66,6 +68,8 @@ private:
|
||||
friend class ProjectExplorerPlugin;
|
||||
#endif
|
||||
bool m_suppressIssues;
|
||||
|
||||
int m_fatalErrorCount;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -187,6 +187,16 @@ void MakeStep::run(QFutureInterface<bool> & fi)
|
||||
AbstractProcessStep::run(fi);
|
||||
}
|
||||
|
||||
bool MakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status)
|
||||
{
|
||||
// Symbian does retun 0, even on failed makes! So we check for fatal make errors here.
|
||||
ProjectExplorer::GnuMakeParser *parser = qobject_cast<ProjectExplorer::GnuMakeParser *>(outputParser());
|
||||
if (parser && parser->fatalErrors() != 0)
|
||||
return false;
|
||||
|
||||
return AbstractProcessStep::processSucceeded(exitCode, status);
|
||||
}
|
||||
|
||||
bool MakeStep::immutable() const
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -86,6 +86,8 @@ public:
|
||||
|
||||
virtual bool init();
|
||||
virtual void run(QFutureInterface<bool> &);
|
||||
bool processSucceeded(int exitCode, QProcess::ExitStatus status);
|
||||
|
||||
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
||||
virtual bool immutable() const;
|
||||
QStringList userArguments();
|
||||
|
||||
Reference in New Issue
Block a user