Starting with Lyons (and Dream Fire) we're changing our assembly versioning to reduce breaking code compiled against our Dlls and to convey more meaningful meta-data about what code the assemblies represent to aid in debugging and support.
Major.Minor.Release.SvnRevision
Major.Minor is 9.2 for Lyons and 1.6 for Dream Fire.
Release is used to denote backward compatible fixes and minor improvements
SvnRevision is the revision number of the code used to compile the assembly
The assumption is that at the very least an assembly with the same Major.Minor and higher Release and SvnRevision can be used by any assembly compiled against one with a lower Release and SvnRevision.
Part of our strong name build script, we will update the AssemblyVersion attributes to reflect this data. In addition SvnRevision and SvnBranch attributes will also be updated on build. The reason SvnRevision exists as part of the AssemblyVersion and a separate attribute is to allow us to hot-patch an assembly (i.e. same version number) and still know what code revision it represents.
By default .NET (although not Mono) will throw exceptions if two assemblies with mismatching Assembly versions are attempted to be used in conjunction. In order to be able to use the above numbering scheme, we will have to update App.Config and Web.Config files with Assembly mapping information that tells .NET what range of version numbers are acceptable substitutes. This example of the this mapping xml:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="mindtouch.dream"
publicKeyToken="3002ceb045a46d6b"
culture="neutral" />
<bindingRedirect oldVersion="1.6.0.0-1.6.0.13456"
newVersion="1.6.0.13456"/>
</dependentAssembly>
</assemblyBinding>
...
</runtime>
...
</configuration>
To accomplish these modifications, build scripts should call mindtouch.build.exe. The configuration files for the build pre-processor need to be located at the root of each project (dream, dekiwiki, sgmlreader). The configuration has the following format
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<assemblies major="..."
minor="..."
release="...">
<!-- assembly build from the current source tree -->
<assembly name="mindtouch.dream"
publicKeyToken="3002ceb045a46d6b"
culture="neutral"
assemblyinfo-path="{path to AssemblyInfo.cs relative to this}"
remap="(true|false)"
/>
<!-- assembly referenced as binary -->
<assembly file="{path to assebmly relative to this}" />
...
</assemblies>
<configfiles>
<path>{path to config file to rewrite with mappings relative to this}</path>
...
</configfiles>
</configuration>
This will rewrite AssemblyInfo.cs with the new AssemblyVersion number, as well as update the SvnRevision and SvnBranch attributes should they exist. AssemblyFileVersion attributes are required in assemblies that are to be remapped (i.e. have remap=true if generated from source or if the assembly is a binary dependency) and is used as the start or the OldVersion range in the remap declaration.
mindtouch.build.exe is located in buildtools/universal/mindtouch.build/ and takes the following arguments (all options can either be prefixed with - or / ):
Builds must be done against a source tree without code modifications (i.e. all code changes must be checked in before the build, rather than along with the build) and svn up must have been run on the root of the tree being built. If this is not observed, the revision number of the assemblies will not match the code referenced, diminishing its use for tracking code changes to assemblies in production.
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by