summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-12-28 08:41:17 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-12-28 08:41:17 -0800
commit3d1f8affe066a360aea95c9c98470f41be99aa12 (patch)
treeb2f2ae6d0024230f80253928431e28d3233ea0fa
parentd1885bf686ab8814f35a2d79a34692cf18ca477e (diff)
downloadDotNetOpenAuth-3d1f8affe066a360aea95c9c98470f41be99aa12.zip
DotNetOpenAuth-3d1f8affe066a360aea95c9c98470f41be99aa12.tar.gz
DotNetOpenAuth-3d1f8affe066a360aea95c9c98470f41be99aa12.tar.bz2
Fixed build break that appears when the .git directory is not found.
-rw-r--r--lib/DotNetOpenAuth.BuildTasks.dllbin57856 -> 57856 bytes
-rw-r--r--lib/DotNetOpenAuth.BuildTasks.pdbbin144896 -> 144896 bytes
-rw-r--r--src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs4
-rw-r--r--tools/DotNetOpenAuth.Versioning.targets4
4 files changed, 7 insertions, 1 deletions
diff --git a/lib/DotNetOpenAuth.BuildTasks.dll b/lib/DotNetOpenAuth.BuildTasks.dll
index a35c306..ab1454c 100644
--- a/lib/DotNetOpenAuth.BuildTasks.dll
+++ b/lib/DotNetOpenAuth.BuildTasks.dll
Binary files differ
diff --git a/lib/DotNetOpenAuth.BuildTasks.pdb b/lib/DotNetOpenAuth.BuildTasks.pdb
index d818880..8dc1628 100644
--- a/lib/DotNetOpenAuth.BuildTasks.pdb
+++ b/lib/DotNetOpenAuth.BuildTasks.pdb
Binary files differ
diff --git a/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs b/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs
index 3124065..b4de743 100644
--- a/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs
+++ b/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs
@@ -59,7 +59,9 @@ namespace DotNetOpenAuth.BuildTasks {
string refName = headContent.Substring(5).Trim();
headContent = File.ReadAllText(Path.Combine(this.GitRepoRoot, @".git/" + refName)).Trim();
}
- } catch (FileNotFoundException) { }
+ } catch (FileNotFoundException) {
+ } catch (DirectoryNotFoundException) {
+ }
if (string.IsNullOrEmpty(headContent)) {
Log.LogWarning("Unable to determine the git HEAD commit ID to use for informational version number.");
diff --git a/tools/DotNetOpenAuth.Versioning.targets b/tools/DotNetOpenAuth.Versioning.targets
index 57b63de..52149c7 100644
--- a/tools/DotNetOpenAuth.Versioning.targets
+++ b/tools/DotNetOpenAuth.Versioning.targets
@@ -25,6 +25,10 @@
<Output TaskParameter="Version" PropertyName="BuildVersion" />
<Output TaskParameter="GitCommitId" PropertyName="AssemblyInformationalVersion" />
</GetBuildVersion>
+ <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>
<Message Text="Building version $(BuildVersion) from commit $(AssemblyInformationalVersion)"/>
</Target>