Link to home
Start Free TrialLog in
Avatar of hung2003
hung2003

asked on

using ant to modify java file

I use ant - build.xml to compile java files and archive ear files.
Are there any ways that I can use the build.xml to modify a java file (add/delete one line at the end of a java file) b4 I use ant to build all the .class files?

It's a long story to explain why I wanna do this. So, in short, I just HAVE to do it.

Thank you very much!!
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi hung2003,

I would suggest that you write a simple Ant task to accomplish this. All you need to do is extend the org.apache.tools.ant.Task class, and override the execute() method. See the Ant docs for more information and examples with code: http://ant.apache.org/manual/index.html

Cheers!

\tt
filter task may also help
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial