Added HTTP cache control to Channel, with a default to ignore cache for direct requests.
[dotnetoauth.git] / tools / DotNetOpenAuth.Versioning.targets
blob20ede90888650f43c10ae283f8183e2d35c6db30
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
3         <!-- Import this .targets file to automaticaly generate AssemblyVersion 
4              attribute according to DotNetOpenAuth convention. -->
5         <PropertyGroup>
6                 <ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..</ProjectRoot>
7                 <VersionCsFile>$(ProjectRoot)\obj\$(Configuration)\$(AssemblyName).Version.cs</VersionCsFile>
8         </PropertyGroup>
10         <Import Project="$(ProjectRoot)\lib\DotNetOpenId.BuildTasks.targets" />
11         <UsingTask AssemblyFile="$(ProjectRoot)\lib\MSBuild.Community.Tasks.dll" TaskName="AssemblyInfo"/>
13         <Target Name="GetBuildVersion">
14                 <GetBuildVersion VersionFile="$(ProjectRoot)\src\version.txt" Condition=" '$(BuildVersion)' == '' ">
15                         <Output TaskParameter="Version" PropertyName="BuildVersion" />
16                 </GetBuildVersion>
17                 <Message Text="Building version $(BuildVersion)"/>
18         </Target>
19         
20         <Target Name="BeforeBuild" DependsOnTargets="GetBuildVersion">
21                 <PropertyGroup>
22                         <NewVersionCsFile>$(VersionCsFile).new</NewVersionCsFile>
23                 </PropertyGroup>
24                 <MakeDir Directories="$(ProjectRoot)\obj\$(Configuration)"/>
25                 <AssemblyInfo OutputFile="$(NewVersionCsFile)" CodeLanguage="C#" AssemblyVersion="$(BuildVersion)" />
26                 <!-- Avoid applying the newly generated AssemblyInfo.cs file to the build 
27                      unless it has changed in order to allow for incremental building. -->
28                 <CompareFiles OriginalItems="$(VersionCsFile)" NewItems="$(NewVersionCsFile)">
29                         <Output TaskParameter="AreChanged" PropertyName="AssemblyInfoChanged" />
30                 </CompareFiles>
31                 <Copy Condition=" '$(AssemblyInfoChanged)' == 'true' " SourceFiles="$(NewVersionCsFile)" DestinationFiles="$(VersionCsFile)" />
32                 <ItemGroup>
33                         <Compile Include="$(VersionCsFile)" />
34                 </ItemGroup>
35         </Target>
36 </Project>