Community
Participate
Working Groups
Ant has a very nice feature that allows dynamic replacement of text. It would be nice if there was support for this in Eclipse (for .java's and possibly other files as well). This would happen before the resource is built. For example: class VersionManager { public static final MAJOR = "@major@"; public static final MINOR = "@minor@"; ... } The @@'s would be dynamically replaced; in other words the @@'s would stay that way in the source, but the compiler would be sent something meaningful. In addition, it would be extremely useful to add in support to manage build version numbers. Being able to increment the major, minor ... etc. in the example above would be very useful. Thanks, Marcus
What about making an ant targer for it and calling out to that target in an ant builder in the external tools builder? Would that be enough (for the first part)? Or are you looking for something that would obviate the need for a build script for this? mike
Well the problem with just relying on ANT to do this, gets us on a slippery slope pretty quick. For ANT to really handle this, it would need to take over compiling the .java, because simply allowing ANT to do the replace in the .java isn't what I'm looking for (because these @@'s should stay in the source and not cause a compile error). So if ANT is doing this, a developer has to, 1) maintain that build script, 2) manually add it to run this ANT script before Eclipse. If this is done, then how does the ANT script work? Well, it would have to look through all the source trees and find any .java w/ @@ ... it would then need to compile these ... but what about dependencies? So now you'd have to compile not only these files but also a good portion of the source tree (in the average case). Seems rather expensive and highly prone to "I just can?t be bothered" syndrome. I still think it is warranted to provide support for this. -- Marcus
Since you want to keep the variables/tags (@@) in the source this looks like asking for preprocessor support. It's not just JDT Text. The compiler would have to know about the variables/tags without any (text) editor knowledge. There are no plans to add this (at least in 3.0 stream).
Get rid of deprecated state.