[nem-en] Assembly Version from SVN

Kamil Skalski kamil.skalski at gmail.com
Tue Jan 16 12:45:40 CET 2007


2007/1/16, vc <vc at rsdn.ru>:
> Hi,
>
> > I've just implemented the simple version of our new
> > AssemblyVersionFromSVN macro/attribute. What does it do?
>
> Unfortunately the Nemerle.MSBuild.Tasks.nproj where you use this attribute
> does not build. Error message:
> nemerle\tools\msbuild-task\MSBuildTask.n(42,12,42,48): error :
> the custom attribute `AssemblyVersionFromSVN ("0.9.3.SVN")'
> could not be found or is invalid
>

It's probably because different dependencies in this context. To build
new MBuild task you need a freshly built compiler...

>
> > It simply
> > executes the 'svn info' shell command and if it succeeds it replaces
> > the "SVN" string from given assembly version string with the read
> > value of svn revision, otherwise (command does not succeed it uses *)
> > Note that - the command is executed in directory from which compiler
> > was executed, so it might be some crazy path in IDE.. :(
>
> It's bad way.
>
> In svn://rsdn.ru/Janus/trunk/SvnRevision you can find simple implementation
> same logic on C#. It's implementation simply scan SVN's files and retrieve
> version.
>

Thanks for the reference, I will use it. Though this approach has its
own disadvantages - if svn changes its (internal!) format for storing
revision number we will need to adapt (and actually check for all
possible formats)


Also, I guess that attribute should be assemblyVersionFromSVNorDate
and fallback to date if svn is impossible to get. Otherwise we would
break builds for sources without svn metadata.

-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list