user405458
user405458

Reputation: 1137

Is it possible to create ant build file programmatically?

Is it possible to create ant build file from java code using ant API?

Upvotes: 3

Views: 732

Answers (2)

Skarab
Skarab

Reputation: 7141

If you do not need to stick to Java, the easiest way is to use groovy and groovy ant buillder (see here). Groovy is compiled into Java VM code and can be easily integrated into a Java program.

Upvotes: 3

Manuel Selva
Manuel Selva

Reputation: 19050

No ANT api doesn't provide such feature. You'll have to use one of the following solution to "manually" write your build.xml file:

  1. Serialization to file output stream
  2. DOM + Xerces serialization to file output stream
  3. SAX + Xerces serialization to file output stream

Upvotes: 3

Related Questions