Skip to content

Commit

Permalink
Add Version to BuildEngineInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
ladipro committed May 28, 2021
1 parent 1a68df6 commit 4d65efb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ namespace Microsoft.Build.Framework
public delegate void AnyEventHandler(object sender, Microsoft.Build.Framework.BuildEventArgs e);
public abstract partial class BuildEngineInterface
{
public const int Version1 = 1;
protected BuildEngineInterface() { }
public virtual int Version { get { throw null; } }
public virtual bool LogsMessagesOfImportance(Microsoft.Build.Framework.MessageImportance importance) { throw null; }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ namespace Microsoft.Build.Framework
public delegate void AnyEventHandler(object sender, Microsoft.Build.Framework.BuildEventArgs e);
public abstract partial class BuildEngineInterface
{
public const int Version1 = 1;
protected BuildEngineInterface() { }
public virtual int Version { get { throw null; } }
public virtual bool LogsMessagesOfImportance(Microsoft.Build.Framework.MessageImportance importance) { throw null; }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
Expand Down
11 changes: 11 additions & 0 deletions src/Framework/BuildEngineInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ namespace Microsoft.Build.Framework
[Serializable]
public abstract class BuildEngineInterface
{
/// <summary>
/// Initial version with LogsMessagesOfImportance() as the only exposed member.
/// </summary>
public const int Version1 = 1;

/// <summary>
/// An explicit version of this class. Must be incremented whenever new members are added. Derived classes should override
/// the property to return the version actually being implemented.
/// </summary>
public virtual int Version => Version1;

/// <summary>
/// Returns <see langword="true"/> if the given message importance is not guaranteed to be ignored by registered loggers.
/// </summary>
Expand Down

0 comments on commit 4d65efb

Please sign in to comment.