Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Extended args api back to be compatible with 17.8 #9522

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<VersionPrefix>17.9.0</VersionPrefix>
<VersionPrefix>17.9.1</VersionPrefix>
<PackageValidationBaselineVersion>17.8.3</PackageValidationBaselineVersion>
<AssemblyVersion>15.1.0.0</AssemblyVersion>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
Expand Down
8 changes: 4 additions & 4 deletions src/Build/Logging/BinaryLogger/BuildEventArgsReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ private BuildEventArgs ReadBuildErrorEventArgs()
fields.Arguments)
{
ProjectFile = fields.ProjectFile,
ExtendedMetadata = fields.Extended.ExtendedMetadata,
ExtendedMetadata = fields.Extended.ExtendedMetadataAsDictionary,
ExtendedData = fields.Extended.ExtendedData,
};
}
Expand Down Expand Up @@ -694,7 +694,7 @@ private BuildEventArgs ReadBuildWarningEventArgs()
fields.Arguments)
{
ProjectFile = fields.ProjectFile,
ExtendedMetadata = fields.Extended.ExtendedMetadata,
ExtendedMetadata = fields.Extended.ExtendedMetadataAsDictionary,
ExtendedData = fields.Extended.ExtendedData,
};
}
Expand Down Expand Up @@ -747,7 +747,7 @@ private BuildEventArgs ReadBuildMessageEventArgs()
fields.Arguments)
{
ProjectFile = fields.ProjectFile,
ExtendedMetadata = fields.Extended?.ExtendedMetadata,
ExtendedMetadata = fields.Extended?.ExtendedMetadataAsDictionary,
ExtendedData = fields.Extended?.ExtendedData,
};
}
Expand Down Expand Up @@ -836,7 +836,7 @@ private BuildEventArgs ReadCriticalBuildMessageEventArgs()
fields.Arguments)
{
ProjectFile = fields.ProjectFile,
ExtendedMetadata = fields.Extended?.ExtendedMetadata,
ExtendedMetadata = fields.Extended?.ExtendedMetadataAsDictionary,
ExtendedData = fields.Extended?.ExtendedData,
};
}
Expand Down
10 changes: 10 additions & 0 deletions src/Build/Logging/BinaryLogger/ExtendedDataFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,14 @@ public ExtendedDataFields(string extendedType, IDictionary<string, string?>? ext
public string ExtendedType { get; }
public IDictionary<string, string?>? ExtendedMetadata { get; }
public string? ExtendedData { get; }

/// <summary>
/// We need to this for Extended event args have Dictionary as ExtendedMetadata.
/// </summary>
public Dictionary<string, string?>? ExtendedMetadataAsDictionary =>
ExtendedMetadata == null ?
null :
ExtendedMetadata is Dictionary<string, string?> asDictionary ?
asDictionary :
new Dictionary<string, string?>(ExtendedMetadata);
}
2 changes: 1 addition & 1 deletion src/Framework/ExtendedBuildErrorEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class ExtendedBuildErrorEventArgs : BuildErrorEventArgs, IExtended
public string ExtendedType { get; set; }

/// <inheritdoc />
public IDictionary<string, string?>? ExtendedMetadata { get; set; }
public Dictionary<string, string?>? ExtendedMetadata { get; set; }

/// <inheritdoc />
public string? ExtendedData { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/ExtendedBuildMessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class ExtendedBuildMessageEventArgs : BuildMessageEventArgs, IExte
public string ExtendedType { get; set; }

/// <inheritdoc />
public IDictionary<string, string?>? ExtendedMetadata { get; set; }
public Dictionary<string, string?>? ExtendedMetadata { get; set; }

/// <inheritdoc />
public string? ExtendedData { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/ExtendedBuildWarningEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class ExtendedBuildWarningEventArgs : BuildWarningEventArgs, IExte
public string ExtendedType { get; set; }

/// <inheritdoc />
public IDictionary<string, string?>? ExtendedMetadata { get; set; }
public Dictionary<string, string?>? ExtendedMetadata { get; set; }

/// <inheritdoc />
public string? ExtendedData { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/ExtendedCriticalBuildMessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class ExtendedCriticalBuildMessageEventArgs : CriticalBuildMessage
public string ExtendedType { get; set; }

/// <inheritdoc />
public IDictionary<string, string?>? ExtendedMetadata { get; set; }
public Dictionary<string, string?>? ExtendedMetadata { get; set; }

/// <inheritdoc />
public string? ExtendedData { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/ExtendedCustomBuildEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class ExtendedCustomBuildEventArgs : CustomBuildEventArgs, IExtend
public string ExtendedType { get; set; }

/// <inheritdoc />
public IDictionary<string, string?>? ExtendedMetadata { get; set; }
public Dictionary<string, string?>? ExtendedMetadata { get; set; }

/// <inheritdoc />
public string? ExtendedData { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/IExtendedBuildEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface IExtendedBuildEventArgs
/// - data which needed in custom code to properly routing this message without interpreting/deserializing <see cref="ExtendedData"/>.
/// - simple extended data can be transferred in form of dictionary key-value per one extended property.
/// </summary>
IDictionary<string, string?>? ExtendedMetadata { get; set; }
Dictionary<string, string?>? ExtendedMetadata { get; set; }

/// <summary>
/// Transparent data as string.
Expand Down
Loading