On 19-05-2005 01:26, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Author: ajack
> Date: Wed May 18 16:26:26 2005
> New Revision: 170842
> 
> URL: http://svn.apache.org/viewcvs?rev=170842&view=rev
> Log:
> 1) Removed Homedir, since <home> isn't an output.

Yes it is! Just think JAVA_HOME, ANT_HOME, JIKES_HOME, etc. A lot of native
code projects find each other via a "prefix" directory. Step out of the
confines of the java world :-)

> 2) Added WorkItem and ResolvablePath.
> 3) Added project.homedir - a ResolvablePath.
> 4) Resolve outputs relative to the homedir.
> 5) Zapped some tests.

WHAT?!? Without reading on and knowing what this about (I see it has to do
with removing Homedir), you really scared me :). We need more tests not
less, and test removal really should be motivated well :-)

> Modified: gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
...
>  from gump.model import *
> +from gump.model.util import *

We need to get rid of '*' imports. I just wish there was a tool in python to
automate "clean up imports".

> +def _extract_relative_item(project, element):
> +    """ Extract directory relative to module or project, based
> +        upon which attribute  (parent or nested) is present."""

IMHO this is a piece of logic that doesn't belong in the "objectifier". I
guess that I believe the current gump object model has thoroughly messed up
directory management. I want to rethink it. I mean,

> +    parent=element.getAttribute("parent")
> +    nested=element.getAttribute("nested")
> +        
> +    if parent:
> +        rel_item=RelativePath(project.module,parent)
> +    elif nested:
> +        rel_item=RelativePath(project,nested)
> +    else:
> +        raise Error, "Unknown relative path entry (no parent or nested): %s"
> % (element)

That's just ugly, right?

> +    # Work Items
> +    works = project_definition.getElementsByTagName("work")
> +    for work in works:

Similarly, <work/> is harmful and should be superfluous (we have it because
java will barf in the case of nonexistent directories on the classpath or
remove them from the path permanently. The place to fix that is very close
to the code that interfaces us to java, not in the model).

All this has nothing to do with the code you wrote, I'm just clearly
realizing it now :)

> Modified: gump/branches/Gump3/pygump/python/gump/model/__init__.py
...
> +        - homedir      -- None or a ResolvablePath (outputs are relative to
> this)

See how confusing that is? At least it is to me!

...
> +class WorkItem(ModelObject):
> +    """Model a directory containing stuff that can be used by other projects.
...

If its used by other projects then its an Output.

> Modified: gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py
...
> +        # Any internal build artifacts
> +        for work in project.workitems:
> +            self.classpath +=
> ArtifactPath(work.name,output.path.resolve(self.workdir))

It really is a mess. We need to get rid of <work/>, <home/>, etc. What would
make sense is something like

<repository name="ant">
  <module name="ant">
    <project name="ant">
      <ant>
        <classpath>
          <directory="build/classes">
        </classpath>
      </ant>
    </project>
  </module>
</repository>

Or actually, we could probably extract the logic bits (and xml definitions)
that work well from the way ant does all this, ie
http://ant.apache.org/manual/using.html#path.

I understand now why it was so hard to get this right in previous versions
of gump. The design is seriously broken. It probably makes sense when you're
magically transforming xml into a bash script, but otherwise...

- LSD



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to