diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-15 22:17:20 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-15 22:17:20 -0800 |
commit | e12782c1a6727390b2107ff2e39d4ac6173d86fc (patch) | |
tree | 3be0ccda0a9425927263f5b6b9616ef8ba11ac08 /tools/DotNetOpenId.Versioning.targets | |
parent | 078b1f350eb40ceee7423c25b1d833dd1f242da4 (diff) | |
parent | a545f7be2693596fa14540c359e43150a6a7cf88 (diff) | |
download | DotNetOpenAuth-origin/mono.zip DotNetOpenAuth-origin/mono.tar.gz DotNetOpenAuth-origin/mono.tar.bz2 |
Merge branch 'v2.5' into monoorigin/mono
Conflicts:
src/DotNetOpenId/Properties/AssemblyInfo.cs
src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
Diffstat (limited to 'tools/DotNetOpenId.Versioning.targets')
-rw-r--r-- | tools/DotNetOpenId.Versioning.targets | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/DotNetOpenId.Versioning.targets b/tools/DotNetOpenId.Versioning.targets new file mode 100644 index 0000000..87c606f --- /dev/null +++ b/tools/DotNetOpenId.Versioning.targets @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <!-- Import this .targets file to automaticaly generate AssemblyVersion
+ attribute according to DotNetOpenId convention. -->
+ <PropertyGroup>
+ <ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..</ProjectRoot>
+ <VersionCsFile>$(ProjectRoot)\obj\$(Configuration)\$(AssemblyName).Version.cs</VersionCsFile>
+ </PropertyGroup>
+
+ <Import Project="$(ProjectRoot)\tools\DotNetOpenId.BuildTasks.targets" />
+ <UsingTask AssemblyFile="$(ProjectRoot)\lib\MSBuild.Community.Tasks.dll" TaskName="AssemblyInfo"/>
+
+ <Target Name="GetBuildVersion" DependsOnTargets="BuildCustomTasks">
+ <GetBuildVersion VersionFile="$(ProjectRoot)\src\version.txt" Condition=" '$(BuildVersion)' == '' ">
+ <Output TaskParameter="Version" PropertyName="BuildVersion" />
+ </GetBuildVersion>
+ <Message Text="Building version $(BuildVersion)"/>
+ </Target>
+
+ <Target Name="BeforeBuild" DependsOnTargets="GetBuildVersion">
+ <PropertyGroup>
+ <NewVersionCsFile>$(VersionCsFile).new</NewVersionCsFile>
+ </PropertyGroup>
+ <MakeDir Directories="$(ProjectRoot)\obj\$(Configuration)"/>
+ <AssemblyInfo OutputFile="$(NewVersionCsFile)" CodeLanguage="C#" AssemblyVersion="$(BuildVersion)" />
+ <!-- Avoid applying the newly generated AssemblyInfo.cs file to the build
+ unless it has changed in order to allow for incremental building. -->
+ <CompareFiles OriginalItems="$(VersionCsFile)" NewItems="$(NewVersionCsFile)">
+ <Output TaskParameter="AreChanged" PropertyName="AssemblyInfoChanged" />
+ </CompareFiles>
+ <Copy Condition=" '$(AssemblyInfoChanged)' == 'true' " SourceFiles="$(NewVersionCsFile)" DestinationFiles="$(VersionCsFile)" />
+ <ItemGroup>
+ <Compile Include="$(VersionCsFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
\ No newline at end of file |