Skip to content

Commit

Permalink
Merge pull request #12 from fraga/adding_build_numbers
Browse files Browse the repository at this point in the history
Implementing automatic build number generation, fixes issue #3
  • Loading branch information
ChrisFulstow committed Jan 12, 2012
2 parents ed2aa0b + 61f77a8 commit 02736f1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
8 changes: 5 additions & 3 deletions NBlog.Lib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyFileVersion("1.0.*")]

19 changes: 19 additions & 0 deletions NBlog.Web/Application/Infrastructure/BuildNumberProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Reflection;

namespace NBlog.Web.Application.Infrastructure
{
/// <summary>
/// Provides current build number
/// </summary>
public static class BuildNumberProvider
{
/// <summary>
/// Returs
/// </summary>
/// <returns>A string containing Major, major rev, minor, minor rev and Revision</returns>
public static string GetBuildNumber()
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
}
4 changes: 2 additions & 2 deletions NBlog.Web/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyFileVersion("1.0.*")]
5 changes: 3 additions & 2 deletions NBlog.Web/Themes/Default/Views/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@model NBlog.Web.Application.Infrastructure.LayoutModel
@using System.Reflection
@model NBlog.Web.Application.Infrastructure.LayoutModel
<!doctype html>
<html lang="en" class="no-js">
<head>
Expand Down Expand Up @@ -68,7 +69,7 @@
</div>

<footer class="text-links">
Powered by <a href="http://chrisfulstow.com/nblog">NBlog</a>
Powered by <a href="http://chrisfulstow.com/nblog">NBlog</a> Build @BuildNumberProvider.GetBuildNumber()
</footer>
</div>

Expand Down

0 comments on commit 02736f1

Please sign in to comment.