Dynamic Code Generation During Compile Time

F

Frank

Hi, I was wondering if it were possible in java to have the compiler
generate time-dependent code. The reason is that I want to have a
build or version number for my application based on the current date.
So if I compile on August 28, my version number would be 8-28, but if
I compile on August 30, then the version number would be 8-30.

Thanks for any help,
Frank
 
R

Roedy Green

The reason is that I want to have a
build or version number for my application based on the current date.
So if I compile on August 28, my version number would be 8-28, but if
I compile on August 30, then the version number would be 8-30.

Your simplest way to do it is to run a little utitily that generates a
tiny bit of Java source that gets compiled in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top