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!!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
filter task may also help
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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