gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1766234 - in /gump/live/python/gump/core: build/ant.py model/builder.py
Date Sat, 22 Oct 2016 20:30:22 GMT
Author: bodewig
Date: Sat Oct 22 20:30:22 2016
New Revision: 1766234

URL: http://svn.apache.org/viewvc?rev=1766234&view=rev
Log:
add configurable timeout to ant builder - patch by Dominik Stadler

Modified:
    gump/live/python/gump/core/build/ant.py
    gump/live/python/gump/core/model/builder.py

Modified: gump/live/python/gump/core/build/ant.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/ant.py?rev=1766234&r1=1766233&r2=1766234&view=diff
==============================================================================
--- gump/live/python/gump/core/build/ant.py (original)
+++ gump/live/python/gump/core/build/ant.py Sat Oct 22 20:30:22 2016
@@ -101,6 +101,12 @@ class AntBuilder(gump.core.run.gumprun.R
         # The ant build file (or none == build.xml)
         buildfile = ant.getBuildFile()
     
+        # Optional 'timeout'
+        if ant.hasTimeout():
+            timeout = ant.getTimeout()
+        else:
+            timeout = setting.TIMEOUT
+
         # Optional 'verbose' or 'debug'
         verbose=ant.isVerbose()
         debug=ant.isDebug()
@@ -119,7 +125,7 @@ class AntBuilder(gump.core.run.gumprun.R
    
         # Run java on apache Ant...
         cmd=Cmd(javaCommand,'build_'+project.getModule().getName()+'_'+project.getName(),
-            basedir,{'CLASSPATH':classpath})
+            basedir,{'CLASSPATH':classpath}, timeout)
             
         # These are workspace + project system properties
         cmd.addNamedParameters(sysproperties)

Modified: gump/live/python/gump/core/model/builder.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/model/builder.py?rev=1766234&r1=1766233&r2=1766234&view=diff
==============================================================================
--- gump/live/python/gump/core/model/builder.py (original)
+++ gump/live/python/gump/core/model/builder.py Sat Oct 22 20:30:22 2016
@@ -236,6 +236,10 @@ class BaseAnt(Builder):
         self.target = self.getDomAttributeValue('target')
         # Import the buildfile
         self.buildfile = self.getDomAttributeValue('buildfile')
+        # Import the timeout
+        self.timeout = self.getDomAttributeValue('timeout')
+        if self.timeout is not None:
+            self.timeout = float(self.timeout)
 
     def hasTarget(self):
         if self.target:
@@ -253,6 +257,14 @@ class BaseAnt(Builder):
     def getBuildFile(self):
         return self.buildfile
 
+    def hasTimeout(self):
+        if self.timeout:
+            return True
+        return False
+
+    def getTimeout(self):
+        return self.timeout
+
     def dump(self, indent = 0, output = sys.stdout):
         """ Display the contents of this object """
         Builder.dump(self, indent, output)
@@ -261,6 +273,8 @@ class BaseAnt(Builder):
             output.write(i+'Target: ' + self.getTarget() + '\n')
         if self.hasBuildFile():
             output.write(i+'BuildFile: ' + self.getBuildFile() + '\n')
+        if self.timeout():
+            output.write(i+'Timeout: ' + self.getTimeout() + '\n')
 
 class Ant(BaseAnt): 
     """ An Ant command (within a project) """



Mime
View raw message