Surely that is what a jars manifest is for?
- Original Message -
From: Wayne Cannon
To: Ant Users List
Sent: Thursday, December 13, 2007 1:11 AM
Subject: Re: Setting final strings at compile time
Eric,
We create an almost-Java source file, e.g., Version.txt, containing
Eric,
We create an almost-Java source file, e.g., Version.txt, containing
replacement targets. We extract version information from Subversion (or
ClearCase, etc.) into a property with Ant, which we then in an
Ant from Version.txt to Version.java. The advantages of this
approach are (1) th
Frederich, Eric P21322 wrote:
Thanks for the reply and a possible solution but this seems more like a
hack.
Yeah, right now I have something like
Public static final String programName = "Java Program XYZ";
I'd like to be able to make one where that string is "Java Program XYZ -
Development Versi
I do not think you want to set this information into a java class, but
into your final jar file using manifest file.
http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html
Hope it helps,
Dmitri.
Frederich, Eric P21322 wrote:
Hello,
Is there an easy way to set final Java Strings at compile tim
Sorry that's not completely right...
I mean
Scot P. Floess wrote:
Eric:
Unfortunately, you are compiling a static final String :(
Perhaps a properties file distributed with your app could hold the
String instead?
I wasn't proposing copying, replacing and then copying back... What I
mea
Eric:
Unfortunately, you are compiling a static final String :(
Perhaps a properties file distributed with your app could hold the
String instead?
I wasn't proposing copying, replacing and then copying back... What I
meant was this:
I assume your source code is checked into some source co
Thanks for the reply and a possible solution but this seems more like a
hack.
Yeah, right now I have something like
Public static final String programName = "Java Program XYZ";
I'd like to be able to make one where that string is "Java Program XYZ -
Development Version" automagically using ant.
If
Eric:
You mention "final Java Strings at compile time"...
Are you referring to actual Java as in:
public static final String FOO = "some text";
If so, you may want to look into the task...
You could do something as simple as:
public class Main
{
public static final String FOO = "%PROJE
Hello,
Is there an easy way to set final Java Strings at compile time?
I know you can set properties at runtime with -Dproperty=value but could
I do this at compile time?
What I want to do is have one target which makes a program called "Java
Program XYZ - production" and another which is called "