From f88e5c349ff0107ac4a13ae00180f767741f88d1 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 24 Apr 2007 15:43:35 +0000 Subject: Build groups are finished, there may be more we could do with them, but they work just fine for what I want. They're cute though, you can put each target in as many groups as you'd like. --- src/build.cpp | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'src/build.cpp') diff --git a/src/build.cpp b/src/build.cpp index db14750..a7421de 100644 --- a/src/build.cpp +++ b/src/build.cpp @@ -78,17 +78,36 @@ void Build::execAction( const std::string &sWhat ) for( pAct->begin(); !pAct->isEnded(); pAct->next() ) { - if( mTarget.find( pAct->getWhat() ) == mTarget.end() ) - throw BuildException( - "No target matches %s in action %s.", - pAct->getWhat().c_str(), - sWhat.c_str() - ); - Target *pTarget = mTarget[pAct->getWhat()]; - //pView->beginCommand( pAct->getAct(), pAct->getWhat() ); - if( !pTarget->wasRun() ) - pTarget->run( pAct->getAct(), *this ); - //pView->endCommand(); + if( pAct->isGroup() ) + { + if( mGroup.find( pAct->getWhat() ) == mGroup.end() ) + throw BuildException( + "No group matches %s in action %s.", + pAct->getWhat().c_str(), + sWhat.c_str() + ); + TargetList &sl = mGroup[pAct->getWhat()]; + for( TargetList::iterator i = sl.begin(); i != sl.end(); i++ ) + { + Target *pTarget = *i; + if( !pTarget->wasRun() ) + pTarget->run( pAct->getAct(), *this ); + } + } + else + { + if( mTarget.find( pAct->getWhat() ) == mTarget.end() ) + throw BuildException( + "No target matches %s in action %s.", + pAct->getWhat().c_str(), + sWhat.c_str() + ); + Target *pTarget = mTarget[pAct->getWhat()]; + //pView->beginCommand( pAct->getAct(), pAct->getWhat() ); + if( !pTarget->wasRun() ) + pTarget->run( pAct->getAct(), *this ); + //pView->endCommand(); + } } pView->endAction(); -- cgit v1.2.3