diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-28 21:33:29 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-28 21:33:29 -0800 |
commit | 1ca88627f679962809d7908a185f4561dd39b61f (patch) | |
tree | b6e7d665b28edb0d6a87928b3f2037de6f111ae3 /tools/DotNetOpenAuth.Versioning.targets | |
parent | 0dae9278469fa1511df1d73ffa6d03d92fad0973 (diff) | |
parent | 3f37385b653be0c753d61819b6ce8e50b8d06ec4 (diff) | |
download | DotNetOpenAuth-1ca88627f679962809d7908a185f4561dd39b61f.zip DotNetOpenAuth-1ca88627f679962809d7908a185f4561dd39b61f.tar.gz DotNetOpenAuth-1ca88627f679962809d7908a185f4561dd39b61f.tar.bz2 |
Merge branch 'master' into mvcProjTemplate
Diffstat (limited to 'tools/DotNetOpenAuth.Versioning.targets')
-rw-r--r-- | tools/DotNetOpenAuth.Versioning.targets | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/DotNetOpenAuth.Versioning.targets b/tools/DotNetOpenAuth.Versioning.targets index 6a4b95a..5047f3a 100644 --- a/tools/DotNetOpenAuth.Versioning.targets +++ b/tools/DotNetOpenAuth.Versioning.targets @@ -5,6 +5,7 @@ <PropertyGroup> <ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..\</ProjectRoot> <VersionCsFile>$(ProjectRoot)obj\$(Configuration)\$(AssemblyName).Version.cs</VersionCsFile> + <NoWarn>$(NoWarn);1607</NoWarn> </PropertyGroup> <PropertyGroup Condition="'$(SignAssembly)' == 'true'"> @@ -18,10 +19,19 @@ <UsingTask AssemblyFile="$(ProjectRoot)lib\MSBuild.Community.Tasks.dll" TaskName="AssemblyInfo"/> <Target Name="GetBuildVersion"> - <GetBuildVersion VersionFile="$(ProjectRoot)src\version.txt" Condition=" '$(BuildVersion)' == '' "> + <GetBuildVersion Condition=" '$(BuildVersion)' == '' " + VersionFile="$(ProjectRoot)src\version.txt" + GitRepoRoot="$(ProjectRoot)"> <Output TaskParameter="Version" PropertyName="BuildVersion" /> + <Output TaskParameter="GitCommitId" PropertyName="AssemblyInformationalVersion" /> </GetBuildVersion> - <Message Text="Building version $(BuildVersion)"/> + <PropertyGroup> + <!-- In TeamCity, the build agent doesn't get the .git directory, but the commit id is available by other means. --> + <AssemblyInformationalVersion Condition=" '$(AssemblyInformationalVersion)' == '' ">$(BUILD_VCS_NUMBER)</AssemblyInformationalVersion> + </PropertyGroup> + <Warning Condition=" '$(AssemblyInformationalVersion)' == '' " Text="Unable to determine the git HEAD commit ID to use for informational version number." /> + <Message Condition=" '$(AssemblyInformationalVersion)' != '' " Text="Building version $(BuildVersion) from commit $(AssemblyInformationalVersion)"/> + <Message Condition=" '$(AssemblyInformationalVersion)' == '' " Text="Building version $(BuildVersion)"/> </Target> <Target Name="BeforeBuild" DependsOnTargets="GetBuildVersion"> @@ -29,7 +39,9 @@ <NewVersionCsFile>$(VersionCsFile).new</NewVersionCsFile> </PropertyGroup> <MakeDir Directories="$(ProjectRoot)obj\$(Configuration)"/> - <AssemblyInfo OutputFile="$(NewVersionCsFile)" CodeLanguage="C#" AssemblyVersion="$(BuildVersion)" /> + <AssemblyInfo OutputFile="$(NewVersionCsFile)" CodeLanguage="C#" + AssemblyVersion="$(BuildVersion)" + AssemblyInformationalVersion="$(AssemblyInformationalVersion)" /> <!-- 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)"> |