gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r161906 - in gump/branches/Gump3: ./ gump pygump/main.py pygump/python/gump/config.py pygump/python/gump/plugins/builder.py
Date Tue, 19 Apr 2005 15:42:16 GMT
Author: ajack
Date: Tue Apr 19 08:42:14 2005
New Revision: 161906

URL: http://svn.apache.org/viewcvs?view=rev&rev=161906
Log:
Getting familiar with Gump3, and getting it more
familiar w/ me.

Modified:
    gump/branches/Gump3/   (props changed)
    gump/branches/Gump3/gump
    gump/branches/Gump3/pygump/main.py
    gump/branches/Gump3/pygump/python/gump/config.py
    gump/branches/Gump3/pygump/python/gump/plugins/builder.py

Propchange: gump/branches/Gump3/
            ('svn:ignore' removed)

Modified: gump/branches/Gump3/gump
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/gump?view=diff&r1=161905&r2=161906
==============================================================================
--- gump/branches/Gump3/gump (original)
+++ gump/branches/Gump3/gump Tue Apr 19 08:42:14 2005
@@ -459,7 +459,9 @@
   #check_command "pkill" "http://sourceforge.net/projects/proctools"
   check_command "mysql" "http://www.mysql.com/"
   check_command "mysqladmin" "http://www.mysql.com/"
-  check_command "ssh" "http://www.openssh.org/"
+  #Temporary, until folks like AJ install the thing, or make it
+  # work w/ PuTTY.
+  #check_command "ssh" "http://www.openssh.org/"
 
   check_env_var "JAVA_HOME" "the location of the java jdk"
   

Modified: gump/branches/Gump3/pygump/main.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/main.py?view=diff&r1=161905&r2=161906
==============================================================================
--- gump/branches/Gump3/pygump/main.py (original)
+++ gump/branches/Gump3/pygump/main.py Tue Apr 19 08:42:14 2005
@@ -105,8 +105,8 @@
     parser.add_option("--no-updates",
                       action="store_true",
                       dest="no_updates",
-                      default=False,
-                      help="skip cvs and svn updates")
+                      default=True, # Default to NOT. At least during initial development...
+                      help="skip svn updates")
     parser.add_option("--databaseserver",
                       action="store",
                       default=_databaseserver,
@@ -145,7 +145,7 @@
     by one of those.
     """
     
-    def __init__(self, logdir, level=DEBUG, console_level=INFO):
+    def __init__(self, logdir, level=DEBUG, console_level=DEBUG): # Both DEBUG for dev...
         self.level = level
         self.console_level = console_level
         

Modified: gump/branches/Gump3/pygump/python/gump/config.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/config.py?view=diff&r1=161905&r2=161906
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/config.py (original)
+++ gump/branches/Gump3/pygump/python/gump/config.py Tue Apr 19 08:42:14 2005
@@ -105,8 +105,8 @@
     
     if config.do_update:
         from gump.plugins.updater import CvsUpdater, SvnUpdater
-        pre_process_plugins.append(CvsUpdater(config.paths_work))
-        pre_process_plugins.append(SvnUpdater(config.paths_work))
+        #pre_process_plugins.append(CvsUpdater(config.paths_work))
+        #pre_process_plugins.append(SvnUpdater(config.paths_work))
     
     plugins = []
     # TODO: append more plugins here...
@@ -136,6 +136,10 @@
         reportlog = get_logger(config, "plugin.logger")
         from gump.plugins.logreporter import LogReporterPlugin
         post_process_plugins.append(LogReporterPlugin(reportlog))
+
+    for plugin in pre_process_plugins: log.debug("Pre : %s " % plugin)
+    for plugin in plugins: log.debug("Proc: %s " % plugin)
+    for plugin in post_process_plugins: log.debug("Post: %s " % plugin)
 
     return (pre_process_plugins, plugins, post_process_plugins)
 

Modified: gump/branches/Gump3/pygump/python/gump/plugins/builder.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/builder.py?view=diff&r1=161905&r2=161906
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/builder.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/builder.py Tue Apr 19 08:42:14 2005
@@ -26,24 +26,42 @@
 from gump.plugins import AbstractPlugin
 from gump.util.executor import Popen, PIPE, STDOUT
 
-class ScriptBuilderPlugin(AbstractPlugin):
+
+class BuilderPlugin(AbstractPlugin):
+    """Execute all commands for all projects."""
+    def __init__(self, workdir, cmd_clazz, method):
+        self.workdir = workdir
+        self.cmd_clazz = cmd_clazz
+        self.method = method             
+
+    def visit_project(self, project):
+        """ Dispatch for each matching command (matching by class type) """
+        for command in [command for command in project.commands if isinstance(command,self.cmd_clazz)]:
+            try:
+                self.method(project, command)
+            except:
+                pass # :TODO: Short term
+
+class ScriptBuilderPlugin(BuilderPlugin):
     """Execute all "script" commands for all projects."""
     def __init__(self, workdir):
-        self.workdir = workdir
+        BuilderPlugin.__init__( self, workdir, Script, self._do_script)  
         
     def _do_script(self, project, script):
         # NOTE: no support for basedir="", an undocumented feature in gump2
         projectpath = get_project_directory(self.workdir,project)
         
         scriptfile = abspath(join(projectpath, script.name))
+        
+        # No extension is ok, otherwise guess at one, platform appropriately
         if not isfile(scriptfile):
             if sys.platform == "win32":
                 scriptfile += ".bat"
             else:
                 scriptfile += ".sh"
             
-            if not isfile(scriptfile):
-                raise Error, "No script '%s' found!" % scriptfile
+        #    if not isfile(scriptfile):
+        #        raise Error, "No script '%s' found!" % scriptfile
         
         args = [scriptfile] + script.args
         cmd = Popen(args,shell=True,cwd=projectpath,stdout=PIPE,stderr=STDOUT)
@@ -51,6 +69,19 @@
         script.build_log = cmd.communicate()[0]
         script.build_exit_status = cmd.wait()
 
-    def visit_project(self, project):
-        for command in [command for command in project.commands if isinstance(command,Script)]:
-            self._do_script(project, command)
+
+class AntBuilderPlugin(BuilderPlugin):
+    """Execute all "ant" commands for all projects."""
+    def __init__(self, workdir):
+        BuilderPlugin.__init__(self, workdir, Ant, self._do_ant)
+        
+    def _do_ant(self, project, ant):
+        # NOTE: no support for basedir="", an undocumented feature in gump2
+        projectpath = get_project_directory(self.workdir,project)
+        
+        buildfile = abspath(join(projectpath, script.name))        
+        
+        # :TODO:
+        import pprint
+        pprint.pprint(project)
+        pprint.pprint(ant)



Mime
View raw message