You can use my trick:
The technique consists of:
1. A plain text file that holds nothing but a version number
AA.BB.CC.DD (version.txt)
2. A small C# utility that increments one of the components in
the file (NewBuild.exe)
3. A small C# utility that replaces AssemblyVersion(...)
in all AssemblyInfo.cs files in your project (ReplaceVersion.exe)
4. A few NAnt targets to automate the above
(sample.build)
I keep binaries of NewBuild.exe and ReplaceVersion.exe in CVS
as they are ultra-small (4KB each). Plus, they are portable because they are CLI
executables.
You can invoke the targets:
nant updateversion
which update all AssemblyInfo.cs files according to
"version.txt" contents.
nant newbuild
which will increase the fourth component of "version.txt" and
update all AssemblyInfo.cs files
nant newrevision
which will increase the third and fourth component of
"version.txt" and update all AssemblyInfo.cs files
nant newminor
which will increase the second and fourth component of
"version.txt", zero the third one and update all AssemblyInfo.cs
files
nant newmajor
which will increase the first and fourth component of
"version.txt", zero the second and third one and update all AssemblyInfo.cs
files
Jarek
P.S. Because I keep my "version.txt" as plain as
possible, I am even able to parse individual components from my nant buildfile.
I can simply use <foreach> with the delimiter set to a dot and because
there's only one line - foreach iterates just one time.
|
sample.build
Description: Binary data
NewBuild.cs
Description: Binary data
ReplaceVersion.cs
Description: Binary data