diff options
Diffstat (limited to 'src/build.cpp')
| -rw-r--r-- | src/build.cpp | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/src/build.cpp b/src/build.cpp index 255cbd3..5c0b721 100644 --- a/src/build.cpp +++ b/src/build.cpp | |||
| @@ -1,10 +1,14 @@ | |||
| 1 | #include "build.h" | 1 | #include "build.h" |
| 2 | #include "function.h" | ||
| 3 | #include "viewerfactory.h" | ||
| 2 | 4 | ||
| 3 | subExceptionDef( BuildException ); | 5 | subExceptionDef( BuildException ); |
| 4 | 6 | ||
| 5 | Build::Build() : | 7 | Build::Build() : |
| 6 | pStrProc( NULL ) | 8 | pStrProc( NULL ), |
| 9 | pView( NULL ) | ||
| 7 | { | 10 | { |
| 11 | pView = ViewerFactory::getInstance().instantiate("plain"); | ||
| 8 | } | 12 | } |
| 9 | 13 | ||
| 10 | Build::~Build() | 14 | Build::~Build() |
| @@ -46,6 +50,7 @@ void Build::execAction( const std::string &sWhat ) | |||
| 46 | sWhat.c_str() | 50 | sWhat.c_str() |
| 47 | ); | 51 | ); |
| 48 | Target *pTarget = mTarget[pAct->getWhat()]; | 52 | Target *pTarget = mTarget[pAct->getWhat()]; |
| 53 | pView->beginCommand( pAct->getAct(), pAct->getWhat(), 0 ); | ||
| 49 | switch( pAct->getAct() ) | 54 | switch( pAct->getAct() ) |
| 50 | { | 55 | { |
| 51 | case Action::actCheck: | 56 | case Action::actCheck: |
| @@ -56,6 +61,7 @@ void Build::execAction( const std::string &sWhat ) | |||
| 56 | pTarget->clean( *this ); | 61 | pTarget->clean( *this ); |
| 57 | break; | 62 | break; |
| 58 | } | 63 | } |
| 64 | pView->endCommand(); | ||
| 59 | } | 65 | } |
| 60 | 66 | ||
| 61 | return; | 67 | return; |
| @@ -234,3 +240,34 @@ void Build::debugDump() | |||
| 234 | } | 240 | } |
| 235 | } | 241 | } |
| 236 | 242 | ||
| 243 | RuleList Build::findChainRules( Rule *pHead ) | ||
| 244 | { | ||
| 245 | RuleList lOut; | ||
| 246 | FunctionList &lMatches = pHead->getMatchesList(); | ||
| 247 | |||
| 248 | for( RuleMap::iterator i = mRule.begin(); i != mRule.end(); i++ ) | ||
| 249 | { | ||
| 250 | if( (*i).second == pHead ) | ||
| 251 | continue; | ||
| 252 | |||
| 253 | for( FunctionList::iterator j = lMatches.begin(); | ||
| 254 | j != lMatches.end(); j++ ) | ||
| 255 | { | ||
| 256 | StringList lTmp; | ||
| 257 | (*j)->execute( NULL, (*i).second->getProducesList(), lTmp ); | ||
| 258 | if( !lTmp.empty() ) | ||
| 259 | { | ||
| 260 | lOut.push_back( (*i).second ); | ||
| 261 | break; | ||
| 262 | } | ||
| 263 | } | ||
| 264 | } | ||
| 265 | |||
| 266 | return lOut; | ||
| 267 | } | ||
| 268 | |||
| 269 | StringList &Build::getRequires( std::string sName ) | ||
| 270 | { | ||
| 271 | return mRequires[sName]; | ||
| 272 | } | ||
| 273 | |||
