Commit 826c43a3 authored by Fawzi Mohamed's avatar Fawzi Mohamed
Browse files

xcodeparser: detect replacing signature warning



The “replacing signature” warning of codesign is interpreted by the
LdParser as an error. Handle it in the xcodeparser.

Change-Id: Ic7e654d7d60a5030be309509d27080ab7cb3bd4f
Task-number: QTCREATORBUG-13256
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 75987e1b
......@@ -41,6 +41,7 @@ namespace ProjectExplorer {
static const char failureRe[] = "\\*\\* BUILD FAILED \\*\\*$";
static const char successRe[] = "\\*\\* BUILD SUCCEEDED \\*\\*$";
static const char buildRe[] = "=== BUILD (AGGREGATE )?TARGET (.*) OF PROJECT (.*) WITH .* ===$";
static const char signatureChangeRe[] = "(.+): replacing existing signature$";
XcodebuildParser::XcodebuildParser() :
m_fatalErrorCount(0),
......@@ -53,6 +54,8 @@ XcodebuildParser::XcodebuildParser() :
QTC_CHECK(m_successRe.isValid());
m_buildRe.setPattern(QLatin1String(buildRe));
QTC_CHECK(m_buildRe.isValid());
m_replacingSignatureRe.setPattern(QLatin1String(signatureChangeRe));
QTC_CHECK(m_replacingSignatureRe.isValid());
}
bool XcodebuildParser::hasFatalErrors() const
......@@ -74,6 +77,16 @@ void XcodebuildParser::stdOutput(const QString &line)
m_xcodeBuildParserState = OutsideXcodebuild;
return;
}
if (m_replacingSignatureRe.indexIn(lne) > -1) {
Task task(Task::Warning,
QCoreApplication::translate("ProjectExplorer::XcodebuildParser",
"Replacing signature"),
Utils::FileName::fromString(m_replacingSignatureRe.cap(1)), /* filename */
-1, /* line */
Constants::TASK_CATEGORY_COMPILE);
taskAdded(task);
return;
}
IOutputParser::stdError(line);
} else {
IOutputParser::stdOutput(line);
......@@ -241,6 +254,26 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
Constants::TASK_CATEGORY_COMPILE))
<< QString()
<< XcodebuildParser::UnknownXcodebuildState;
QTest::newRow("inside catch codesign replace signature")
<< XcodebuildParser::InXcodebuild
<< QString::fromLatin1("/somepath/somefile.app: replacing existing signature") << OutputParserTester::STDOUT
<< QString() << QString()
<< (QList<Task>()
<< Task(Task::Warning,
QCoreApplication::translate("ProjectExplorer::XcodebuildParser",
"Replacing signature"),
Utils::FileName::fromString(QLatin1String("/somepath/somefile.app")), /* filename */
-1, /* line */
Constants::TASK_CATEGORY_COMPILE))
<< QString()
<< XcodebuildParser::InXcodebuild;
QTest::newRow("outside forward codesign replace signature")
<< XcodebuildParser::OutsideXcodebuild
<< QString::fromLatin1("/somepath/somefile.app: replacing existing signature") << OutputParserTester::STDOUT
<< QString::fromLatin1("/somepath/somefile.app: replacing existing signature\n") << QString()
<< QList<Task>()
<< QString()
<< XcodebuildParser::OutsideXcodebuild;
}
void ProjectExplorerPlugin::testXcodebuildParserParsing()
......
......@@ -59,6 +59,7 @@ private:
QRegExp m_failureRe;
QRegExp m_successRe;
QRegExp m_buildRe;
QRegExp m_replacingSignatureRe;
XcodebuildStatus m_xcodeBuildParserState;
QString m_lastTarget;
QString m_lastProject;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment