ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimitriy Trifonov" <>
Subject is there an API to get a build file from an instance of Project
Date Thu, 28 Feb 2002 09:06:10 GMT
Hi all.
I'm trying to use the ANT API to automatically generate or modify a build.xml 
I load the file in a Project, then add some Targets. Is the a way to get the new buld file
without writing an iterator over the Project?
Suppose that I have the following code :


public class TestANTProject {
  private static String buildFile = "D:\\TestFiles\\aa\\build.xml";

  public static void main(String[] arg) {
    File file = new File(buildFile);
    Project project = new Project();
    ProjectHelper.configureProject(project, file);
    Target targ = new Target();
    //add some tasks to targ


Can I get the modified xml, or I have to add the new targets into the xml? 
Thanks in advance.

Best Regards, 

Why do you necessarily have to be wrong just because a few million people think you are?
ProSyst Bulgaria LTD      Dimitriy Trifonov, 
48 "Vladajska" Str.,         Project Manager 
1606 Sofia, Bulgaria        Phone (+359 2) 952 35 82\123
Leading Software Technology for Open Service Gateways

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message