From 8c23a24f76814ab10006491be0e1cadaefb06fa1 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 4 Jan 2010 23:42:55 +0000 Subject: Ok, now I've cleaned up the output to match the new revised build requires procedure in the default view, it's really much nicer. --- src/viewdefault.cpp | 30 +++++++++++++++++++++++++----- src/viewdefault.h | 2 ++ 2 files changed, 27 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/viewdefault.cpp b/src/viewdefault.cpp index c38c62f..25082ac 100644 --- a/src/viewdefault.cpp +++ b/src/viewdefault.cpp @@ -31,6 +31,8 @@ PluginInterface3( pluginViewDefault, default, ViewDefault, View, ViewDefault::ViewDefault() : bFirst( true ), + bDisped( false ), + bDispedTrg( false ), iDepth( 0 ), iTotal( 0 ), iCurrent( 0 ) @@ -39,6 +41,10 @@ ViewDefault::ViewDefault() : ViewDefault::~ViewDefault() { + if( bDisped == false ) + { + sio << "Nothing to be done." << sio.nl << sio.nl; + } } void ViewDefault::beginAction( const Bu::FString &/*sAction*/ ) @@ -55,11 +61,12 @@ void ViewDefault::skipTarget( const Bu::FString &/*sProfile*/, iCurrent++; } -void ViewDefault::beginTarget( const Bu::FString &sProfile, +void ViewDefault::beginTarget( const Bu::FString &/*sProfile*/, const Target &rTarget ) { if( iDepth == 0 ) { + bDispedTrg = false; iTotal = rTarget.getDepCount(); iCurrent = 0; if( bFirst == false ) @@ -67,16 +74,20 @@ void ViewDefault::beginTarget( const Bu::FString &sProfile, sio << sio.nl; } bFirst = false; - sio << C_BR_WHITE << " --- " << C_BR_CYAN << sProfile << " " - << rTarget.getOutputList().first() << C_BR_WHITE << " --- " - << C_RESET << sio.nl; } iDepth++; } -void ViewDefault::processTarget( const Bu::FString &/*sProfile*/, +void ViewDefault::processTarget( const Bu::FString &sProfile, const Target &rTarget ) { + if( bDispedTrg == false ) + { + bDispedTrg = true; + sio << C_BR_WHITE << " --- " << C_BR_CYAN << sProfile << " " + << rTarget.getOutputList().first() << C_BR_WHITE << " --- " + << C_RESET << sio.nl; + } iCurrent++; int iPct = (iTotal>0)?(iCurrent*100/iTotal):(100); @@ -84,6 +95,8 @@ void ViewDefault::processTarget( const Bu::FString &/*sProfile*/, << "%" << C_BR_WHITE << "] " << C_BR_MAGENTA << Fmt(10) << rTarget.getDisplay() << C_BR_WHITE << ": " << rTarget.getOutputList().first() << C_RESET << sio.nl; + + bDisped = true; } void ViewDefault::endTarget() @@ -98,6 +111,7 @@ void ViewDefault::buildRequires( const Target &rTarget ) << "%" << C_BR_WHITE << "] " << C_BR_MAGENTA << Fmt(10) << "deps" << C_BR_WHITE << ": " << rTarget.getOutputList().first() << C_RESET << sio.nl; + bDisped = true; } void ViewDefault::cmdStarted( const Bu::FString &/*sCmd*/ ) @@ -141,30 +155,36 @@ void ViewDefault::cmdFinished( const Bu::FString &sStdOut, } //sio << C_BR_WHITE << "[" << C_BR_GREEN << sStdOut << C_BR_WHITE << "]" << sio.nl; //sio << C_BR_WHITE << "[" << C_BR_RED << sStdErr << C_BR_WHITE << "]" << sio.nl; + bDisped = true; } void ViewDefault::userError( const Bu::FString &sMsg ) { sio << C_BR_RED << "Error: " << sMsg << C_RESET << sio.nl; + bDisped = true; } void ViewDefault::userWarning( const Bu::FString &sMsg ) { sio << C_BR_YELLOW << "Warning: " << sMsg << C_RESET << sio.nl; + bDisped = true; } void ViewDefault::userNotice( const Bu::FString &sMsg ) { sio << C_BR_GREEN << "Notice: " << sMsg << C_RESET << sio.nl; + bDisped = true; } void ViewDefault::sysError( const Bu::FString &sMsg ) { sio << C_BR_RED << sMsg << C_RESET << sio.nl; + bDisped = true; } void ViewDefault::sysWarning( const Bu::FString &sMsg ) { sio << C_BR_YELLOW << sMsg << C_RESET << sio.nl; + bDisped = true; } diff --git a/src/viewdefault.h b/src/viewdefault.h index c9a554d..b8d65e9 100644 --- a/src/viewdefault.h +++ b/src/viewdefault.h @@ -34,6 +34,8 @@ public: private: bool bFirst; + bool bDisped; + bool bDispedTrg; int iDepth; int iTotal; int iCurrent; -- cgit v1.2.3