gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: gump/python/gump engine.py build.py
Date Fri, 12 Mar 2004 14:21:00 GMT
ajack       2004/03/12 06:21:00

  Modified:    python/gump engine.py build.py
  Log:
  Allow build to run standalone w/o loading stats
  
  Revision  Changes    Path
  1.82      +41 -11    gump/python/gump/engine.py
  
  Index: engine.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/engine.py,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- engine.py	11 Mar 2004 16:13:50 -0000	1.81
  +++ engine.py	12 Mar 2004 14:21:00 -0000	1.82
  @@ -391,6 +391,33 @@
           ******************************************************************
       
       """
  +    def build(self,run,all=1):
  +            
  +        #
  +        # Load the statistics (so we can use them during
  +        # other operations).
  +        #
  +        #logResourceUtilization('Before load statistics')
  +        #self.loadStatistics(run)        
  +          
  +        #
  +        # Run the build commands
  +        #
  +        logResourceUtilization('Before build')
  +        if all:
  +            self.buildAll(run)
  +        else:
  +            self.buildProjects(run)
  +  
  +        # Return an exit code based off success
  +        # :TODO: Move onto run
  +        if run.getWorkspace().isSuccess():
  +            result = SUCCESS 
  +        else: 
  +            result = FAILED
  +        
  +        return result
  +        
       
       def buildAll(self,run):
           """ Build a GumpRun's Full Project Stack """
  @@ -426,28 +453,31 @@
           
               
               # Extract stats (in case we want to do conditional processing)            
  -            stats=project.getStats()
  +            stats=None
  +            if project.hasStats():
  +                stats=project.getStats()
               
               if project.isPackaged():             
  -                self.performPackageProcessing( run, project, stats)
  +                self.performPackageProcessing(run, project, stats)
                   continue
                   
               # Do this even if not ok
  -            self.performPreBuild( run, project, stats )
  +            self.performPreBuild(run, project, stats)
   
               wasBuilt=0
               if project.okToPerformWork():        
                   log.debug(' ------ Building: [' + `projectNo` + '] ' + project.getName())
   
                   # Turn on --verbose or --debug if failing ...
  -                if (not STATE_SUCCESS == stats.currentState) and \
  -                        not project.isVerboseOrDebug():
  -                    if stats.sequenceInState > 5:
  -                        project.addInfo('Enable "debug" output, due to error.')
  -                        project.setDebug(1)
  -                    else:
  -                        project.addInfo('Enable "verbose" output, due to error.')    
  -                        project.setVerbose(1)
  +                if stats:
  +                    if (not STATE_SUCCESS == stats.currentState) and \
  +                            not project.isVerboseOrDebug():
  +                        if stats.sequenceInState > 5:
  +                            project.addInfo('Enable "debug" output, due to error.')
  +                            project.setDebug(1)
  +                        else:
  +                            project.addInfo('Enable "verbose" output, due to error.') 
  
  +                            project.setVerbose(1)
   
                   #
                   # Get the appropriate build command...
  
  
  
  1.42      +2 -5      gump/python/gump/build.py
  
  Index: build.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build.py,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- build.py	8 Mar 2004 22:28:08 -0000	1.41
  +++ build.py	12 Mar 2004 14:21:00 -0000	1.42
  @@ -65,11 +65,8 @@
       #
       #    Perform this integration run...
       #
  -    if '*' in args:
  -        result = engine.buildAll(run)
  -    else:
  -        result = engine.buildProjects(run)
  -
  +    result = engine.build(run, '*' in args)
  +    
       #
       log.info('Gump Build complete. Exit code:' + str(result))
             
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Mime
View raw message