2013-11-05 09:05:41 +01:00
|
|
|
|
using System;
|
2013-01-02 08:57:40 -01:00
|
|
|
|
using System.Reflection;
|
2015-06-24 14:17:24 +02:00
|
|
|
|
using Semver;
|
2012-11-26 11:18:06 -01:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Configuration
|
|
|
|
|
|
{
|
|
|
|
|
|
public class UmbracoVersion
|
|
|
|
|
|
{
|
2016-08-23 09:40:02 +02:00
|
|
|
|
private static readonly Version Version = new Version("7.6.0");
|
2012-11-26 11:18:06 -01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the current version of Umbraco.
|
|
|
|
|
|
/// Version class with the specified major, minor, build (Patch), and revision numbers.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// CURRENT UMBRACO VERSION ID.
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
public static Version Current
|
|
|
|
|
|
{
|
2012-11-27 10:05:26 -01:00
|
|
|
|
get { return Version; }
|
2012-11-26 11:18:06 -01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the version comment (like beta or RC).
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <value>The version comment.</value>
|
2017-01-31 10:33:57 +01:00
|
|
|
|
public static string CurrentComment { get { return "alpha056"; } }
|
2013-01-02 08:57:40 -01:00
|
|
|
|
|
|
|
|
|
|
// Get the version of the umbraco.dll by looking at a class in that dll
|
|
|
|
|
|
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
|
|
|
|
|
|
public static string AssemblyVersion { get { return new AssemblyName(typeof(ActionsResolver).Assembly.FullName).Version.ToString(); } }
|
2015-06-24 14:17:24 +02:00
|
|
|
|
|
|
|
|
|
|
public static SemVersion GetSemanticVersion()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new SemVersion(
|
|
|
|
|
|
Current.Major,
|
|
|
|
|
|
Current.Minor,
|
|
|
|
|
|
Current.Build,
|
|
|
|
|
|
CurrentComment.IsNullOrWhiteSpace() ? null : CurrentComment,
|
|
|
|
|
|
Current.Revision > 0 ? Current.Revision.ToInvariantString() : null);
|
|
|
|
|
|
}
|
2012-11-26 11:18:06 -01:00
|
|
|
|
}
|
|
|
|
|
|
}
|