Dynamic Code Generation During Compile Time

Discussion in 'Java' started by Frank, Aug 28, 2003.

  1. Frank

    Frank Guest

    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
     
    Frank, Aug 28, 2003
    #1
    1. Advertising

  2. Frank

    Roedy Green Guest

    On 28 Aug 2003 10:30:27 -0700, (Frank) wrote or
    quoted :

    >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.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Aug 28, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    645
    Mike Wahler
    May 15, 2005
  2. Nagaraj
    Replies:
    1
    Views:
    900
    Lionel B
    Mar 1, 2007
  3. Carter
    Replies:
    2
    Views:
    519
    Carter
    Mar 4, 2009
  4. Immortal Nephi
    Replies:
    3
    Views:
    685
    James Kanze
    Dec 23, 2009
  5. John W. Long

    HTML Generation (Next Generation CGI)

    John W. Long, Nov 22, 2003, in forum: Ruby
    Replies:
    4
    Views:
    376
    John W. Long
    Nov 24, 2003
Loading...

Share This Page