I'm working on a build process for a
Java project which is part of a larger project containing Java and C++ code. I want the Java code to have access to a global version number. If I were doing this in C++ I'd compile it as "g++ -DVERSION=...", but that capability doesn't seem to exist in Java.
Instead, I'm implementing an
Ant task as below. Is this the "correct" way of doing things? I haven't seen the <filter> task used this way in any of the documentation I've consulted so I'm a little concerned. I've also noticed that this won't remake the file if the version number changes. How do I get around this? Should I add a task that removes the generated file, that gets called from the scripts that build the full release?
My task is:
Thanks!