gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Simons <>
Subject Re: Getting project file name from module
Date Fri, 08 Jul 2005 19:21:19 GMT
Hi Justin!

Justin Merz wrote:
> Since gump3 does not recoginze maven project descriptor files I am
> trying to access the file name from the module descriptor file (/tag if
> in same file). 

Actually, I think that gump, in the form of the Loader component,
manages to load the descriptor just fine. Eg it if you have

    <project href="somemavendescriptor.xml">

then the Loader will get hold of somemavendescriptor.xml, and replace
said <project/> with the contents of that descriptor. But my memory is a
bit sketchy, and that's probably not tested. Might be a good idea ;)

> I believe the project descriptor tag is removed from the
> module file and placed into a dropped_tags list.

Hmm. I don't think so. I think after the "loading" stage is complete the
descriptors are still in the workspace.

> Is there anyway to
> access this list ie functions already written

Not really, but Engine._write_merge_files() does iterate over that list
and writes a new xml file. You might find it helpful. And the other bits
of gump.engine do a lot of xml manipulation to spy on. But no doubt
you're still going to have to figure out loads of DOM stuff :-)


> or does anyone have a
> better idea how to access all of module's data by the time normalizer
> gets ahold of it?

In the example above, maybe we could have

    <project type="maven" href="somemavendescriptor.xml">

And then you could build a Mavenizer component that does something like this

  projects = w.getElementsByTagName("project")
  for p in [p for p projects if p.getAttribute("type") == "maven"]:

Or maybe there's a good way to detect that we're dealing with a maven
definition (eg if all maven xml files always have a pomVersion or
something). I dunno. If you do an 'svn log' on and/or look
through the mailing list archives you might find ideas some of us had at
some point. But I'd just do the thinking myself if I were you ;)

> PS. please let me know if you think i am going in the wrong direction on
> this!

Nope, just keep going :-). Once you've got your first patch together
I'll try and give you more feedback to shake a stick at :-)



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message