Skip to content
This repository has been archived by the owner on Jul 7, 2019. It is now read-only.

Release builds

enyim edited this page Sep 26, 2011 · 5 revisions

Prerequisites

The following software is required to build the library:

  • .NET Framework 4.0 (download)
  • PowerShell 2.0 (download)
  • 7-Zip (download, must be installed to the default location)
  • Git (msysgit, recommended install options are Run Git from the Windows Command Prompt and core.autocrlf=true)

Versioning

The build process automatically versions the assemblies based on git tags. Before releasing a new version the repository must be tagged:

git tag -a -m "Membase Major.Minor" mbMajor.Minor
git tag -a -m "Enyim Memcached Major.Minor" emcMajor.Minor

Minor versions start at 0 and must not use leading zeros.

git tag -a -m "Membase 1.0" mb1.0
...
git tag -a -m "Membase 1.24" mb1.24

Tags are not pushed automatically, so the --tags option must be used:

git push origin --tags

The mb/emc prefix is important, this is how the build process finds the version info tags. The prefix/pattern can be changed by editing the Membase.csproj/Enyim.Caching.csproj files:

<GitTagMatch>mb*</GitTagMatch>

The value if the GitTagMatch must be a regular expression which is passed to git tag. It must select tags matching the following pattern: ^([a-zA-Z]*)(?'Major'\d+)\.(?'Minor'\d+)(-(?'Revision'\d+))? This pattern can be adjusted in build\VersionInfo.targets.

The resulting assembly will have its version metadata set to the versions parsed by the build script. This can be verified in the Windows Explorer's Properties window. (Or an IL disassembler tool, like Reflector/ILSpy.)

Note: if the repository head is not set to the latest tag (e.g. two commits later than cb1.2), the commit's short hash will be appended to the AssemblyTitle (and the zip file's name).

Signing

Local builds (from Visual Studio) are signed with the public part of the enyim.com signing key, making the assemblies delay-signed. During development you need to disable the strong name verification by using

sn -Vr *,cec98615db04012e // Enyim.Caching public key

Note: If you're in an x64 environment you need to run both both the x86 and the x64 sn.exe to disable the verification. Their default install path are:

  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\x64\sn.exe
  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\sn.exe

Release builds however, do require that you have physical access to enyim.snk. You can override this and use a custom snk, but keep in mind that the resulting assembly will have a different identity than the official one and you can run into several issues by using it.

Build Process

Open a PowerShell console and navigate to the repository. (We'll assume it's placed at D:\repo.)

PS D:\repo> cd build
PS D:\repo\build> .\build.ps1 -KeyPath path\to\enyim.snk

The output will be a Membase-Major.Minor.zip & Enyim.Caching-Major.Minor.zip file in the build\output folder which can be distributed to the developers. The build script will also create a NuGet package which needs to be uploaded to nuget.org or pushed by nuget.exe.