You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by le...@apache.org on 2005/07/08 22:53:40 UTC

svn commit: r209888 - in /gump/branches/Gump3: metadata/vmgump.xml pygump/python/gump/config.py pygump/python/gump/engine/modeller.py pygump/python/gump/engine/objectifier.py pygump/python/gump/model/__init__.py pygump/python/gump/plugins/java/builder.py

Author: leosimons
Date: Fri Jul  8 13:53:38 2005
New Revision: 209888

URL: http://svn.apache.org/viewcvs?rev=209888&view=rev
Log:
Support <ant/> basedir attribute, fix a bug or two in the Ant plugin, make the ClasspathPlugin command-agnostic, and fix up the vmgump profile until it actually builds

Modified:
    gump/branches/Gump3/metadata/vmgump.xml
    gump/branches/Gump3/pygump/python/gump/config.py
    gump/branches/Gump3/pygump/python/gump/engine/modeller.py
    gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
    gump/branches/Gump3/pygump/python/gump/model/__init__.py
    gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py

Modified: gump/branches/Gump3/metadata/vmgump.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/metadata/vmgump.xml?rev=209888&r1=209887&r2=209888&view=diff
==============================================================================
--- gump/branches/Gump3/metadata/vmgump.xml (original)
+++ gump/branches/Gump3/metadata/vmgump.xml Fri Jul  8 13:53:38 2005
@@ -124,7 +124,7 @@
         <module name="xml-commons"/>
 
         <!-- commands -->
-        <ant basedir="java/external"/>
+        <ant basedir="java/external" target="jar"/>
 
         <!-- outputs -->
         <home nested="java/external/build"/>

Modified: gump/branches/Gump3/pygump/python/gump/config.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/config.py?rev=209888&r1=209887&r2=209888&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/config.py (original)
+++ gump/branches/Gump3/pygump/python/gump/config.py Fri Jul  8 13:53:38 2005
@@ -116,7 +116,8 @@
         from gump.plugins.builder import ScriptBuilderPlugin
         plugins.append(ScriptBuilderPlugin(config.paths_work,buildlog))
         from gump.plugins.java.builder import ClasspathPlugin
-        plugins.append(ClasspathPlugin(config.paths_work,buildlog))
+        from gump.model import Ant
+        plugins.append(ClasspathPlugin(config.paths_work,buildlog,Ant))
         from gump.plugins.java.builder import AntPlugin
         plugins.append(AntPlugin(config.paths_work,buildlog))
      

Modified: gump/branches/Gump3/pygump/python/gump/engine/modeller.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/modeller.py?rev=209888&r1=209887&r2=209888&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/modeller.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/modeller.py Fri Jul  8 13:53:38 2005
@@ -56,7 +56,6 @@
 def _find_ancestor_by_tag(node, tagName):
     """Walk up the DOM hierarchy to locate an element of the specified tag."""
     parent = node 
-    print "Find %s starting with %s " % (tagName, node)
     while parent.nodeType == dom.Node.ELEMENT_NODE:
         if parent.tagName == tagName:
             return parent

Modified: gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/objectifier.py?rev=209888&r1=209887&r2=209888&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/objectifier.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/objectifier.py Fri Jul  8 13:53:38 2005
@@ -214,8 +214,9 @@
     for cmd in ants:
         buildfile = cmd.getAttribute("buildfile")
         target = cmd.getAttribute("target")
+        basedir = cmd.getAttribute("basedir")
             
-        project.add_command(Ant(project, target, buildfile))
+        project.add_command(Ant(project, target, buildfile, basedir=basedir))
 
 def _create_outputs(project, project_definition, workdir):    
     # Working directories for this project (containing java classes)

Modified: gump/branches/Gump3/pygump/python/gump/model/__init__.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/model/__init__.py?rev=209888&r1=209887&r2=209888&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/model/__init__.py (original)
+++ gump/branches/Gump3/pygump/python/gump/model/__init__.py Fri Jul  8 13:53:38 2005
@@ -556,12 +556,16 @@
         - target -- the Ant target
         - buildfile -- the Ant build file
     """
-    def __init__(self, project, target, buildfile="build.xml"):
+    def __init__(self, project, target, buildfile="build.xml",basedir=None):
         assert isinstance(target, basestring)
         assert isinstance(buildfile, basestring)
+        if basedir != None:
+            assert isinstance(basedir, basestring)
+            
         Command.__init__(self, project)
         self.target = target
         self.buildfile = buildfile
+        self.basedir = basedir
 
     def __str__(self):
         return "<Ant:target=%s,buildfile=%s>" % (self.target, self.buildfile)
@@ -615,7 +619,7 @@
         - add_to_bootclass_path -- flag specifying if this jar should be
                 added to the bootclasspath
     """
-    def __init__(self, project, name, id = None, add_to_bootclass_path = False):
+    def __init__(self, project, name, id=None, add_to_bootclass_path=False):
         assert isinstance(name, basestring)
         Output.__init__(self, project, id)
         self.name = name

Modified: gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py?rev=209888&r1=209887&r2=209888&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py Fri Jul  8 13:53:38 2005
@@ -31,9 +31,9 @@
 
 
 class ClasspathPlugin(BuilderPlugin):
-    """Generate the java build attributes (e.g. CLASSPATH) for the Ant command."""
-    def __init__(self, workdir, log):
-        BuilderPlugin.__init__(self, workdir, log, Ant, self.set_classpath)
+    """Generate the java build attributes (e.g. CLASSPATH) for the specified command."""
+    def __init__(self, workdir, log, CommandClazz):
+        BuilderPlugin.__init__(self, workdir, log, CommandClazz, self.set_classpath)
         
     def set_classpath(self, project, command):
         (classpath, bootclasspath) = calculate_classpath(self.workdir, project)
@@ -49,6 +49,8 @@
         
     def _do_ant(self, project, ant):                
         projectpath = get_project_directory(self.workdir,project)
+        if ant.basedir:
+            projectpath = os.path.join(projectpath, ant.basedir)
         
         self.log.debug('CLASSPATH %s' % ant.classpath)
         self.log.debug('BOOTCLASSPATH %s' % ant.boot_classpath)
@@ -65,7 +67,7 @@
         
         # Allow bootclasspath
         if ant.boot_classpath:
-            args += ['-X','bootclasspath/p',ant.boot_classpath.join(':')]
+            args += ['-X','bootclasspath/p',':'.join(ant.boot_classpath)]
 
         # Ant's entry point, and main options.
         args += ["org.apache.tools.ant.Main"]