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

Commit

Permalink
Build process updated.
Browse files Browse the repository at this point in the history
- building from VS will sign the assemblies with the "localbuild.snk" and will assign a fake version number
- building from command line will sign with the proper key and will generate version info bbased on the output of "git describe"
  • Loading branch information
enyim committed Sep 21, 2010
1 parent b230fb9 commit 851a5e1
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 16 deletions.
6 changes: 6 additions & 0 deletions Enyim.Caching/Enyim.Caching.csproj
Expand Up @@ -59,6 +59,12 @@
</CodeAnalysisRules>
<CodeAnalysisRuleSet>Migrated rules for Enyim.Caching (2).ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\localbuild.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
8 changes: 4 additions & 4 deletions Enyim.Caching/Properties/AssemblyInfo.cs
Expand Up @@ -18,10 +18,10 @@
// generated by the build script
//[assembly: AssemblyVersion("2.4.0.0")]
//[assembly: AssemblyFileVersion("2.3.0.0")]

#if SIGN
[assembly: AssemblyKeyName("enyim")]
#endif
//
//#if SIGN
//[assembly: AssemblyKeyName("enyim")]
//#endif

#region [ License information ]
/* ************************************************************
Expand Down
6 changes: 6 additions & 0 deletions Northscale.Store/Northscale.Store.csproj
Expand Up @@ -54,6 +54,12 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\Northscale.Store.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\localbuild.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
6 changes: 3 additions & 3 deletions Northscale.Store/Properties/AssemblyInfo.cs
Expand Up @@ -19,9 +19,9 @@
//[assembly: AssemblyVersion("2.5.0.0")]
//[assembly: AssemblyFileVersion("2.4.0.0")]

#if SIGN
[assembly: AssemblyKeyName("enyim")]
#endif
//#if SIGN
//[assembly: AssemblyKeyName("enyim")]
//#endif

#region [ License information ]
/* ************************************************************
Expand Down
32 changes: 25 additions & 7 deletions VersionInfo.targets
Expand Up @@ -25,9 +25,22 @@
</Code>
</Task>
</UsingTask>

<PropertyGroup>
<ShouldGenerate Condition="$(Configuration) == 'Release' And $(IsReleaseBuild) == 'true'">true</ShouldGenerate>
</PropertyGroup>

<PropertyGroup Condition="$(ShouldGenerate) == 'true'">
<AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile>
</PropertyGroup>

<Target Name="BeforeBuild" Condition=" $(Configuration) == 'Release' And $(TagOutput) == 'true' " DependsOnTargets="CreateAssemblyInfo;IncludeGeneratedAssemblyInfo">

<Target Name="BeforeBuild">
<CallTarget Targets="CreateAssemblyInfoFromGit" Condition="$(ShouldGenerate) == 'true'" />
<CallTarget Targets="CreateStaticAssemblyInfo" Condition=" $(ShouldGenerate) != 'true'" />

<CreateItem Include="$(GeneratedAssemblyInfo)">
<Output TaskParameter="Include" ItemName="Compile"/>
</CreateItem>
</Target>

<PropertyGroup>
Expand All @@ -36,7 +49,7 @@
<GitTagMatch Condition=" '$(GitTagMatch)' == '' ">*</GitTagMatch>
</PropertyGroup>

<Target Name="CreateAssemblyInfo">
<Target Name="CreateAssemblyInfoFromGit">

<MakeDir Directories="obj\$(Configuration)" />

Expand All @@ -51,14 +64,19 @@

<Delete Files="$(GeneratedAssemblyInfo)" />
<WriteLinesToFile File="$(GeneratedAssemblyInfo)" Lines="
[assembly: System.Reflection.AssemblyKeyName(&quot;enyim&quot;)]
[assembly: System.Reflection.AssemblyFileVersion(&quot;$(_Describe)&quot;)]
[assembly: System.Reflection.AssemblyVersion(&quot;$(_AssemblyVersion)&quot;)]" />
</Target>

<Target Name="IncludeGeneratedAssemblyInfo">
<CreateItem Include="$(GeneratedAssemblyInfo)">
<Output TaskParameter="Include" ItemName="Compile"/>
</CreateItem>
<Target Name="CreateStaticAssemblyInfo">

<MakeDir Directories="obj\$(Configuration)" />

<Delete Files="$(GeneratedAssemblyInfo)" />
<WriteLinesToFile File="$(GeneratedAssemblyInfo)" Lines="
[assembly: System.Reflection.AssemblyFileVersion(&quot;2.4.6-custom&quot;)]
[assembly: System.Reflection.AssemblyVersion(&quot;2.4.6.8&quot;)]" />
</Target>

</Project>
4 changes: 2 additions & 2 deletions build-release.msbuild
Expand Up @@ -24,8 +24,8 @@
</Target>

<Target Name="Compile" DependsOnTargets="BeforeBuild">
<MSBuild Projects="Enyim.Caching\Enyim.Caching.csproj" Targets="Rebuild" Properties="Configuration=Release;TagOutput=true;DefineConstants=SIGN=true" />
<MSBuild Projects="NorthScale.Store\NorthScale.Store.csproj" Targets="Rebuild" Properties="Configuration=Release;TagOutput=true;DefineConstants=SIGN=true" />
<MSBuild Projects="Enyim.Caching\Enyim.Caching.csproj" Targets="Rebuild" Properties="Configuration=Release;IsReleaseBuild=true" />
<MSBuild Projects="NorthScale.Store\NorthScale.Store.csproj" Targets="Rebuild" Properties="Configuration=Release;IsReleaseBuild=true" />
</Target>

<Target Name="PrepareFiles">
Expand Down

0 comments on commit 851a5e1

Please sign in to comment.