jastrachan | 26 Mar 11:14 2004
Picon

Re: GroovyMarkup with Ant and JUnit

A few other thoughts while we're chatting about this - maybe we could 
have a Grant/Gravy Maven base class capable of parsing Maven's POM into 
a tree of Nodes...

pom = new XmlParser().parse("project.xml")

Then we could easily write Ant build processes that reuse existing 
Maven POMs.

Then we can use expressions like

pom.build.sourceDirectory

to reference the stuff in the POM. (There are lots of Maven-built 
projects now, so being able to reuse the POM would be cool).

Another idea could then be to have reusable base classes. e.g.

class GrantBuild {
     Node pom
     ant = new AntBuilder()

     Node getPom() {
	if (pom == null) {
	    pom = new XmlParser().parse("project.xml")
	}
	return pom
     }
}

class JavaBuild extends GrantBuild {

     compile() {... }
     compileTest() { .. }
     test()  { ... }
}

Then, rather like Maven tries to do - we can all share the same common 
stuff for compiling/testing from a POM (which we could turn into 
GroovyMarkup if we really wanted to get away from angle brackets :) and 
then overload tasks adding pre/post conditions or replacing a task 
completely - which was one of the main aims of Maven.

i.e. for a specific project we can inherit all the useful targets from 
the domain we want (Java, WepApp, EJB, .NET, whatever) and then add our 
own custom stuff or overload stuff as/when we need.

Crikey, did we just come up with Ant/Maven 2? :)

James
-------
http://radio.weblogs.com/0112098/

Gmane