# HG changeset patch # User John Kern # Date 1252020690 25200 # Node ID 6894bf2709c0e3e8db4e7fc10b8181e12dab40ca # Parent 8e9c5760ce6fa5bcab5805ade735528374b9a33b add some regex to parse status information. diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/AtAGlance.cpp --- a/BuildLogViewer/AtAGlance.cpp Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/AtAGlance.cpp Thu Sep 03 16:31:30 2009 -0700 @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -52,6 +53,7 @@ { this->traveAndPopulate(m_log->documentElement()); } + void AtAGlance::traveAndPopulate(QDomElement e) { QString name = e.tagName(); @@ -67,25 +69,58 @@ { // example // System Definition file sf/app/organizer/package_definition.xml - QRegExp re("^System Definition file .*package_definition.*$"); + QRegExp re("System*package_definition.xml"); re.setPatternSyntax(QRegExp::Wildcard); - string blah = e.text().toStdString(); - if (re.exactMatch( e.text() ) ) { - std::cout << "info: " << e.text().toStdString()<< std::endl; + QRegExp reToken("*package_definition.xml"); + // Which regex syntax should be used? Wildcard is ... + reToken.setPatternSyntax(QRegExp::Wildcard); + + QStringList tokens = e.text().split(" "); + QStringList::const_iterator constIterator; + for (constIterator = tokens.constBegin(); + constIterator != tokens.constEnd(); + ++constIterator) + { + if (reToken.exactMatch(*constIterator)) + { + m_buildStatus->setName((*constIterator).toLocal8Bit().constData()); + } + } } } // if this is a status tag and the exit attribute is failed, the build failed. if (name.compare("status",Qt::CaseInsensitive)== 0 ) { - m_buildStatus->setStatus(false); + QString rc = e.attribute("exit"); + if (!rc.isEmpty() && (rc.compare("failed", Qt::CaseInsensitive) == 0)) + { + m_buildStatus->setStatus(false); + } + } + + // unforunately, the build log isn't valid xml. The recipe tag often contains + // trace output from a shell program in addition to the status tag. Sigh. + // So this condition looks for the status tag in the body for the recipe tag. + // here is what the status tag should look like: + // + if (name.compare("recipe",Qt::CaseInsensitive)== 0 ) + { + QRegExp re("*status exit*fail*"); + re.setPatternSyntax(QRegExp::Wildcard); + if (re.exactMatch(e.text())) + { + m_buildStatus->setStatus(false); + } } QString text_debug; QDomElement e1 = e.firstChild().toElement(); + name = e1.tagName(); + text_debug = e1.text(); while(!e1.isNull()) { this->traveAndPopulate(e1); @@ -100,6 +135,9 @@ QGridLayout *layout = new QGridLayout(this); layout->addWidget(new QLabel("What: "), 1, 1); + layout->addWidget(new QLabel(*m_buildStatus->name()),1,2); layout->addWidget(new QLabel("When: "), 2, 1); + layout->addWidget(new QLabel(m_buildStatus->time()) ,2,2); layout->addWidget(new QLabel("Status: "), 3, 1); + layout->addWidget(new QLabel(*m_buildStatus->status()),3,2); } diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/BuildStatus.cpp --- a/BuildLogViewer/BuildStatus.cpp Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/BuildStatus.cpp Thu Sep 03 16:31:30 2009 -0700 @@ -3,15 +3,17 @@ BuildStatus::BuildStatus(QObject *parent) { setParent(parent); + this->m_packageName = new QString(""); + this->m_PresentStatus = new QString("Pass"); + this->m_status = true; } void BuildStatus::setTime(QDateTime w) { this->m_when = w; - this->m_status = true; } -QString BuildStatus::Time() +QString BuildStatus::time() { return this->m_when.toString(); } @@ -26,7 +28,22 @@ m_packageName = new QString(n); } -QString BuildStatus::name() +const QString *BuildStatus::name() +{ + return m_packageName; +} + +void BuildStatus::setStatus (bool n ) { - return *m_packageName; + m_status = n ; + if (!m_status) + { + this->m_PresentStatus = new QString("Failed"); + } } + + +const QString *BuildStatus::status() +{ + return this->m_PresentStatus; +} diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/BuildStatus.h --- a/BuildLogViewer/BuildStatus.h Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/BuildStatus.h Thu Sep 03 16:31:30 2009 -0700 @@ -10,15 +10,15 @@ BuildStatus(QObject *parent = 0); void setName(QString n); - QString name(); + const QString *name(); void setTime(QDateTime w); - QString Time(); + QString time(); - void setStatus (bool n ) { m_status = n ; } ; + void setStatus (bool n ); + const QString *status(); - - +private: // What was the name of the package? QString *m_packageName; // At this time, the symbain build log doesn't have a timestamp in it. @@ -26,6 +26,7 @@ QDateTime m_when; // Did the build succeed? bool m_status; + QString *m_PresentStatus; }; #endif // BUILDSTATUS_H diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/Makefile --- a/BuildLogViewer/Makefile Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/Makefile Thu Sep 03 16:31:30 2009 -0700 @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: BuildLogViewer -# Generated by qmake (2.01a) (Qt 4.5.2) on: Wed Sep 2 11:10:47 2009 +# Generated by qmake (2.01a) (Qt 4.5.2) on: Thu Sep 3 07:51:16 2009 # Project: BuildLogViewer.pro # Template: app # Command: c:\Qt\2009.03\qt\bin\qmake.exe -spec ..\..\..\Qt\2009.03\qt\mkspecs\win32-g++ -win32 -o Makefile BuildLogViewer.pro diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/Makefile.Debug --- a/BuildLogViewer/Makefile.Debug Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/Makefile.Debug Thu Sep 03 16:31:30 2009 -0700 @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: BuildLogViewer -# Generated by qmake (2.01a) (Qt 4.5.2) on: Wed Sep 2 11:10:46 2009 +# Generated by qmake (2.01a) (Qt 4.5.2) on: Thu Sep 3 07:51:16 2009 # Project: BuildLogViewer.pro # Template: app ############################################################################# diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/Makefile.Release --- a/BuildLogViewer/Makefile.Release Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/Makefile.Release Thu Sep 03 16:31:30 2009 -0700 @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: BuildLogViewer -# Generated by qmake (2.01a) (Qt 4.5.2) on: Wed Sep 2 11:10:47 2009 +# Generated by qmake (2.01a) (Qt 4.5.2) on: Thu Sep 3 07:51:16 2009 # Project: BuildLogViewer.pro # Template: app ############################################################################# diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/readme.txt --- a/BuildLogViewer/readme.txt Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/readme.txt Thu Sep 03 16:31:30 2009 -0700 @@ -2,17 +2,4 @@ To test it out. build it with Qt Creator. Launch it and open one of the xml files in the test_data directory. -$ hg push -pushing to http://developer.symbian.org/oss/FCL/interim/contrib/QtExamples -searching for changes -http authorization required -realm: Symbian Foundation -user: johnk -password: -abort: HTTP Error 502: Bad Gateway - -JohnK@PC213502752220 /cygdrive/c/workspace/QtExamples -$ hg push -pushing to http://developer.symbian.org/oss/FCL/interim/contrib/QtExamples -searching for changes -no changes found \ No newline at end of file +Build output, in general, isn't valid xml as it must record all output to be useful. You may find trace output from scripts \ No newline at end of file diff -r 8e9c5760ce6f -r 6894bf2709c0 BuildLogViewer/test_data/build_log_232.xml --- a/BuildLogViewer/test_data/build_log_232.xml Wed Sep 02 19:04:26 2009 -0700 +++ b/BuildLogViewer/test_data/build_log_232.xml Thu Sep 03 16:31:30 2009 -0700 @@ -1,6 +1,41 @@ -System Definition file sf/app/organizer/package_definition.xml + + + sbs: version 2.5.2 [2009-03-06 release] SBS_HOME C:/Symbian/Tools/PDT_1.0/raptor @@ -52,6 +87,7 @@ updating configuration make with variant last Buildable configuration 'winscw_udeb' Buildable configuration 'winscw_urel' +System Definition file sf/app/organizer/package_definition.xml Found 6 bld.inf references in sf/app/organizer/package_definition.xml within 1 layers: app Found 6 bld.inf references in layer "app" @@ -622,41 +658,6 @@ NOT generating CLEAN targets as no CLEAN target was requested NOT generating WHAT targets as WHAT target not requested Unfrozen Exports in build for winscw/udeb - -