S
Simon Brooke
For serialisation to work properly as an object changes through versions we
are advised to provide a serialVersionUID which is a static final long.
I'd like to automate the generation of serialVersionUIDs at compile time.
The value could be based either (preferably) on an ant variable called
PROJECT_VERSION or (less preferred) on the time/date of compilation.
I'm certain someone has done this; I've a nasty feeling that it is (or
should be) a FAQ.
The only solution that springs obviously to mind is for ant to copy the
source files from the source directory to an intermediate temporary
directory, making the substitutions as it does so; and then compile from
the intermediate temporary directory to the build directory. This would
work but is clunky.
Does anyone have a better solution?
are advised to provide a serialVersionUID which is a static final long.
I'd like to automate the generation of serialVersionUIDs at compile time.
The value could be based either (preferably) on an ant variable called
PROJECT_VERSION or (less preferred) on the time/date of compilation.
I'm certain someone has done this; I've a nasty feeling that it is (or
should be) a FAQ.
The only solution that springs obviously to mind is for ant to copy the
source files from the source directory to an intermediate temporary
directory, making the substitutions as it does so; and then compile from
the intermediate temporary directory to the build directory. This would
work but is clunky.
Does anyone have a better solution?