aboutsummaryrefslogtreecommitdiff
path: root/src/build.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-09-12 00:22:33 +0000
committerMike Buland <eichlan@xagasoft.com>2006-09-12 00:22:33 +0000
commitd19ada0aa88aba1c7b439035c0028440ac860ec3 (patch)
treefb8cde98650aa66fcdb736b045f541eac1b8b93a /src/build.cpp
parent97d529fac68105f0d3d34c699a4ac10489c705e8 (diff)
downloadbuild-d19ada0aa88aba1c7b439035c0028440ac860ec3.tar.gz
build-d19ada0aa88aba1c7b439035c0028440ac860ec3.tar.bz2
build-d19ada0aa88aba1c7b439035c0028440ac860ec3.tar.xz
build-d19ada0aa88aba1c7b439035c0028440ac860ec3.zip
Build now builds, it has viewers, and dependancy checking, and everything works.
Now we have to add cleaning, caching, and more viewer hooks / viewers.
Diffstat (limited to 'src/build.cpp')
-rw-r--r--src/build.cpp39
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
3subExceptionDef( BuildException ); 5subExceptionDef( BuildException );
4 6
5Build::Build() : 7Build::Build() :
6 pStrProc( NULL ) 8 pStrProc( NULL ),
9 pView( NULL )
7{ 10{
11 pView = ViewerFactory::getInstance().instantiate("plain");
8} 12}
9 13
10Build::~Build() 14Build::~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
243RuleList 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
269StringList &Build::getRequires( std::string sName )
270{
271 return mRequires[sName];
272}
273