gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1766267 - in /gump/live/python/gump/core/build: configure.py gradle.py make.py maven.py msbuild.py mvn.py nant.py nuget.py script.py
Date Sun, 23 Oct 2016 12:41:18 GMT
Author: bodewig
Date: Sun Oct 23 12:41:17 2016
New Revision: 1766267

URL: http://svn.apache.org/viewvc?rev=1766267&view=rev
Log:
make all builders support a configurable timeout

Modified:
    gump/live/python/gump/core/build/configure.py
    gump/live/python/gump/core/build/gradle.py
    gump/live/python/gump/core/build/make.py
    gump/live/python/gump/core/build/maven.py
    gump/live/python/gump/core/build/msbuild.py
    gump/live/python/gump/core/build/mvn.py
    gump/live/python/gump/core/build/nant.py
    gump/live/python/gump/core/build/nuget.py
    gump/live/python/gump/core/build/script.py

Modified: gump/live/python/gump/core/build/configure.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/configure.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/configure.py (original)
+++ gump/live/python/gump/core/build/configure.py Sun Oct 23 12:41:17 2016
@@ -29,7 +29,7 @@ import os.path
 
 from gump import log
 from gump.core.build.script import getArgs
-#from gump.core.config import setting
+from gump.core.config import setting
 from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, STATE_FAILED,\
     STATE_SUCCESS
 from gump.core.run.gumprun import RunSpecific
@@ -96,8 +96,14 @@ class ConfigureBuilder(RunSpecific):
         # The script
         scriptfile = os.path.abspath(os.path.join(basedir, 'configure'))
 
+        # Optional 'timeout'
+        if configure.hasTimeout():
+            timeout = configure.getTimeout()
+        else:
+            timeout = setting.TIMEOUT
+
         cmd = Cmd(scriptfile, 'buildscript_'+project.getModule().getName()+'_'+project.getName(),
-                  basedir)
+                  basedir, timeout)
         cmd.addParameters(getArgs(configure))
 
         return cmd

Modified: gump/live/python/gump/core/build/gradle.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/gradle.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/gradle.py (original)
+++ gump/live/python/gump/core/build/gradle.py Sun Oct 23 12:41:17 2016
@@ -22,6 +22,7 @@ import os.path
 from gump import log
 from gump.actor.mvnrepoproxy.proxycontrol import SNAPSHOT_PROXIES
 from gump.core.build.mvn import local_mvn_repo
+from gump.core.config import setting
 from gump.core.model.workspace import CommandWorkItem, \
     REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, REASON_PREBUILD_FAILED, \
     STATE_FAILED, STATE_SUCCESS, WORK_TYPE_BUILD
@@ -91,9 +92,15 @@ def getGradleCommand(project, executable
     #
     basedir = gradle.getBaseDirectory() or project.getBaseDirectory()
 
+    # Optional 'timeout'
+    if gradle.hasTimeout():
+        timeout = gradle.getTimeout()
+    else:
+        timeout = setting.TIMEOUT
+
     # Run Gradle...
     cmd = Cmd(executable, 'build_' + project.getModule().getName() + '_' + \
-                project.getName(), basedir)
+                project.getName(), basedir, timeout)
 
     #
     # Allow gradle-level debugging...

Modified: gump/live/python/gump/core/build/make.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/make.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/make.py (original)
+++ gump/live/python/gump/core/build/make.py Sun Oct 23 12:41:17 2016
@@ -28,10 +28,9 @@ __license__   = "http://www.apache.org/l
 from gump import log
 from gump.core.run.gumprun import RunSpecific
 from gump.core.build.script import getArgs
-#from gump.core.config import setting
+from gump.core.config import setting
 from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, STATE_FAILED,\
     STATE_SUCCESS
-
 from gump.util.process.command import CMD_STATE_SUCCESS, CMD_STATE_TIMED_OUT, Cmd
 from gump.util.process.launcher import execute
 from gump.util.work import CommandWorkItem, WORK_TYPE_BUILD
@@ -100,8 +99,14 @@ class MakeBuilder(RunSpecific):
         # The make command, defaults to "make"
         makeCommand = project.getWorkspace().getMakeCommand()
 
+        # Optional 'timeout'
+        if make.hasTimeout():
+            timeout = make.getTimeout()
+        else:
+            timeout = setting.TIMEOUT
+
         cmd = Cmd(makeCommand, 'build_'+project.getModule().getName()+'_'+project.getName(),
-                  basedir)
+                  basedir, timeout)
 
         # Pass the makefile
         if makefile:

Modified: gump/live/python/gump/core/build/maven.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/maven.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/maven.py (original)
+++ gump/live/python/gump/core/build/maven.py Sun Oct 23 12:41:17 2016
@@ -27,11 +27,11 @@ import time
 import gump
 
 from gump import log
+from gump.core.config import setting
 from gump.core.model.workspace import CommandWorkItem, \
     REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, REASON_PREBUILD_FAILED, \
-    STATE_FAILED, STATE_SUCCESS,  WORK_TYPE_BUILD
+    STATE_FAILED, STATE_SUCCESS, WORK_TYPE_BUILD
 from gump.core.run.gumprun import RunSpecific
-
 from gump.util.file import FILE_TYPE_CONFIG
 from gump.util.process.command import Cmd, CMD_STATE_SUCCESS, \
     CMD_STATE_TIMED_OUT
@@ -56,9 +56,15 @@ def getMavenCommand(project):
     #
     basedir = maven.getBaseDirectory() or project.getBaseDirectory()
 
+    # Optional 'timeout'
+    if maven.hasTimeout():
+        timeout = maven.getTimeout()
+    else:
+        timeout = setting.TIMEOUT
+
     # Run Maven...
     cmd = Cmd('maven', 'build_' + project.getModule().getName() + '_' + \
-                  project.getName(), basedir)
+                  project.getName(), basedir, timeout)
 
     #
     # Allow maven-level debugging...
@@ -256,7 +262,7 @@ class Maven1Builder(RunSpecific):
 
             except Exception, details:
                 message = 'Generate Maven Properties Failed:' + str(details)
-                log.error(message, exc_info = 1)
+                log.error(message, exc_info=1)
                 project.addError(message)
                 project.changeState(STATE_FAILED, REASON_PREBUILD_FAILED)
 

Modified: gump/live/python/gump/core/build/msbuild.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/msbuild.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/msbuild.py (original)
+++ gump/live/python/gump/core/build/msbuild.py Sun Oct 23 12:41:17 2016
@@ -16,16 +16,15 @@
 # limitations under the License.
 
 from gump import log
+from gump.core.config import setting
+from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, \
+    REASON_PREBUILD_FAILED, STATE_FAILED, STATE_SUCCESS
 from gump.core.run.gumprun import RunSpecific
-
 from gump.util.process.command import CMD_STATE_SUCCESS, CMD_STATE_TIMED_OUT, \
     Cmd, Parameters
 from gump.util.process.launcher import execute
 from gump.util.work import CommandWorkItem, WORK_TYPE_BUILD
 
-from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, \
-    REASON_PREBUILD_FAILED, STATE_FAILED, STATE_SUCCESS
-
 def getMSBuildProperties(project):
     """ Get properties for a project """
     properties = Parameters()
@@ -114,11 +113,17 @@ class MSBuildBuilder(RunSpecific):
         # Get properties
         properties = getMSBuildProperties(project)
 
+        # Optional 'timeout'
+        if msbuild.hasTimeout():
+            timeout = msbuild.getTimeout()
+        else:
+            timeout = setting.TIMEOUT
+
         # Run MSBuild...
         cmd = Cmd(self.run.env.get_msbuild_command(),
                   'build_' + project.getModule().getName() + '_' + \
-                    project.getName(),
-                  basedir)
+                  project.getName(),
+                  basedir, timeout)
 
         # Allow MSBuild-level debugging...
         if project.getWorkspace().isDebug() or project.isDebug() or debug:

Modified: gump/live/python/gump/core/build/mvn.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/mvn.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/mvn.py (original)
+++ gump/live/python/gump/core/build/mvn.py Sun Oct 23 12:41:17 2016
@@ -21,6 +21,7 @@ import os.path
 
 from gump import log
 from gump.actor.mvnrepoproxy.proxycontrol import PROXY_CONFIG
+from gump.core.config import setting
 from gump.core.model.builder import MVN_VERSION2, MVN_VERSION3
 from gump.core.model.workspace import CommandWorkItem, \
     REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, REASON_PREBUILD_FAILED, \
@@ -81,9 +82,15 @@ def getMavenCommand(project, executable=
     #
     basedir = maven.getBaseDirectory() or project.getBaseDirectory()
 
+    # Optional 'timeout'
+    if maven.hasTimeout():
+        timeout = maven.getTimeout()
+    else:
+        timeout = setting.TIMEOUT
+
     # Run Maven...
     cmd = Cmd(executable, 'build_' + project.getModule().getName() + '_' + \
-                project.getName(), basedir)
+                project.getName(), basedir, timeout)
 
     cmd.addParameter('--batch-mode')
 

Modified: gump/live/python/gump/core/build/nant.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/nant.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/nant.py (original)
+++ gump/live/python/gump/core/build/nant.py Sun Oct 23 12:41:17 2016
@@ -16,16 +16,15 @@
 # limitations under the License.
 
 from gump import log
+from gump.core.config import setting
+from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, \
+    REASON_PREBUILD_FAILED, STATE_FAILED, STATE_SUCCESS
 from gump.core.run.gumprun import RunSpecific
-
 from gump.util.process.command import CMD_STATE_SUCCESS, CMD_STATE_TIMED_OUT, \
     Cmd, Parameters
 from gump.util.process.launcher import execute
 from gump.util.work import CommandWorkItem, WORK_TYPE_BUILD
 
-from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, \
-    REASON_PREBUILD_FAILED, STATE_FAILED, STATE_SUCCESS
-
 def getNAntProperties(project):
     """ Get properties for a project """
     return collect_properties(project.getWorkspace().getProperties() + \
@@ -125,11 +124,17 @@ class NAntBuilder(RunSpecific):
         # Get system properties
         sysproperties = getNAntSysProperties(project)
 
+        # Optional 'timeout'
+        if nant.hasTimeout():
+            timeout = nant.getTimeout()
+        else:
+            timeout = setting.TIMEOUT
+
         # Run NAnt...
         cmd = Cmd(self.run.env.get_nant_command(),
                   'build_' + project.getModule().getName() + '_' + \
                     project.getName(),
-                  basedir)
+                  basedir, timeout)
 
         # Launch with specified framework (e.g. mono-1.0.1) if
         # required.

Modified: gump/live/python/gump/core/build/nuget.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/nuget.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/nuget.py (original)
+++ gump/live/python/gump/core/build/nuget.py Sun Oct 23 12:41:17 2016
@@ -20,10 +20,10 @@ __license__ = "http://www.apache.org/lic
 
 from gump import log
 from gump.core.build.script import getArgs
+from gump.core.config import setting
 from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, \
     STATE_FAILED, STATE_SUCCESS
 from gump.core.run.gumprun import RunSpecific
-
 from gump.util.process.command import CMD_STATE_SUCCESS, CMD_STATE_TIMED_OUT, \
     Cmd
 from gump.util.process.launcher import execute
@@ -86,9 +86,15 @@ class NuGetBuilder(RunSpecific):
         # Where to run this:
         basedir = nuget.getBaseDirectory() or project.getBaseDirectory()
 
+        # Optional 'timeout'
+        if nuget.hasTimeout():
+            timeout = nuget.getTimeout()
+        else:
+            timeout = setting.TIMEOUT
+
         cmd = Cmd(self.run.env.get_nuget_command(),
                   'buildscript_' + project.getModule().getName() + '_' + \
-                  project.getName(), basedir)
+                  project.getName(), basedir, timeout)
         cmd.addParameter(nuget.getCommand())
         cmd.addParameters(getArgs(nuget))
         if nuget.hasSolution():

Modified: gump/live/python/gump/core/build/script.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/script.py?rev=1766267&r1=1766266&r2=1766267&view=diff
==============================================================================
--- gump/live/python/gump/core/build/script.py (original)
+++ gump/live/python/gump/core/build/script.py Sun Oct 23 12:41:17 2016
@@ -30,10 +30,9 @@ import os.path
 
 from gump import log
 from gump.core.run.gumprun import RunSpecific
-#from gump.core.config import setting
+from gump.core.config import setting
 from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, STATE_FAILED,\
     STATE_SUCCESS
-
 from gump.util.process.command import CMD_STATE_SUCCESS, CMD_STATE_TIMED_OUT, Cmd, Parameters
 from gump.util.process.launcher import execute
 from gump.util.work import CommandWorkItem, WORK_TYPE_BUILD
@@ -131,10 +130,15 @@ class ScriptBuilder(RunSpecific):
         # Needed for (at least) a compiler...
         (classpath, bootclasspath) = languageHelper.getClasspaths(project)
 
+        # Optional 'timeout'
+        if script.hasTimeout():
+            timeout = script.getTimeout()
+        else:
+            timeout = setting.TIMEOUT
+
         cmd = Cmd(scriptfile,
                   'buildscript_'+project.getModule().getName()+'_'+project.getName(),
-                  basedir,
-                  {'CLASSPATH':classpath})
+                  basedir, {'CLASSPATH':classpath}, timeout)
 
         cmd.addParameters(getArgs(script))
 



Mime
View raw message