ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Replacing build.xml with - Doing Ant builds directly from Java
Date Fri, 12 Jun 2009 10:38:22 GMT
Michael Ludwig wrote:
> Ashley Williams schrieb am 11.06.2009 um 17:51:45 (+0100):
>> 		// create the ant parent project
>> 		Project project = new Project();
>> 		project.setName("project");
>> 		project.init();
>> 		// create the child target
>> 		Target target = new Target();
>> 		target.setName("target");
>> 		project.addTarget(target);
>> 		project.addBuildListener(new Log4jListener());
> The Ant XML isn't exactly compact and doesn't flow like, say, Python
> or Perl; but painstakingly recreating the XML structure from the API
> is even harder for the eyeball.
> But of course, this usage may have its places and applications.

Ant's API-mode is a bit more brittle than the XML level, and there are a 
few steps to setting it up. when I run it embedded, we have a special 
logger that checks for an interrupted flag -if it is set it throws a 
special subclass of BuildException

All the rest of our embedding code is there to see, even though it has 
an LGPL license, we're going to move to the ASF license, so ask nicely 
and we'll edit the header on whichever file you want to cut and paste from.

My most recent work in this area was using the unzip code, where it 
turned out to be easier to take bits of the unzip task and call its 
underlying code directly, bypassing the task (though using it as the 
foundation for my own code)

Remember, this is the other right that open source software gives you.

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

View raw message