Re: Forth digit in version number

2011-09-12 Thread Dominik Guder

Am 09.09.2011 05:52, schrieb Stefan Bodewig:

On 2011-09-08, Dominik Guder wrote:


using nant for retreiving svn revision to property svn.revision:
use svn log (repository access)



exec program=svn.exe workingdir=${svnroot} verbose=false
   output=_svnrevision.xml failonerror=true
 arg value=log /
 arg line=${svnroot} --xml --limit 1 -q /
 arg line=--username=foo --password=bar --no-auth-cache /
/exec
sleep milliseconds=500 /
xmlpeek file=_svnrevision.xml
  xpath=/log/logentry/@revision
  property=svn.revision
  failonerror=true/


It is likely fair to assume that whoever uses NAnt also has a svn
command line client around - or I need to provide some sort of fallback
if it isn't.

Thanks.

Stefan



Hi Stefan, since we are using CC.Net as CI and build tool svn.exe is 
required on our buildserver. The only point we need assembly versioning. 
Another solution could be tortoisesvn.net subwcrev.exe. See

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-subwcrev.html
Using #svn and create a svn nant task is possible, but currently out of 
scope for me.


A minor change for this usecase I could think is to be able to use a 
Xml-String for xmlpeek instead of requiring a file. So the timeout could 
be removed and no additional file system access is needed.


So far Dominik

--
The answer to the great question of life,
the universe and everything is 42 (Douglas Adams)


Re: Forth digit in version number

2011-09-08 Thread Dominik Guder

Am 08.09.2011 17:01, schrieb Michael Schall:

We set the forth digit to 0 for the AssemblyVersion attribute and SVN
revision number for the AssemblyFileVersion attribute.  This way you can
slipstream fixes without breaking compatibility with other's code, but
you still have the revision number if you want it.



+1 so do we in office.

using nant for retreiving svn revision to property svn.revision:
use svn log (repository access)

exec program=svn.exe workingdir=${svnroot} verbose=false
  output=_svnrevision.xml failonerror=true 
arg value=log /
arg line=${svnroot} --xml --limit 1 -q /
arg line=--username=foo --password=bar --no-auth-cache /
/exec
sleep milliseconds=500 /
xmlpeek file=_svnrevision.xml
 xpath=/log/logentry/@revision
 property=svn.revision
 failonerror=true/


or using svn info (without repository access, but should be updated before:

exec program=svn.exe workingdir=${svnroot} verbose=false
  output=_svnrevision.xml failonerror=true 
arg value=info /
arg line=${svnroot} --xml /
/exec
sleep milliseconds=500 /
xmlpeek file=_svnrevision.xml
 xpath=/info/entry/commit/@revision
 property=svn.revision
 failonerror=true/

hth

Dominik

--
The answer to the great question of life,
the universe and everything is 42 (Douglas Adams)