Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ public class CheckForInstrumentationPackages : Microsoft.Build.Utilities.Task
/// Gets or sets the list of instrumentation target items.
/// </summary>
/// <remarks>
/// See the <code>InstrumentationTarget</code>"/> items on the <code>.targets</code> file for a list of the
/// See the <code>InstrumentationTarget</code> items on the <code>.targets</code> file for a list of the
/// required metadata.
/// </remarks>
[Required]
#pragma warning disable CA1819 // Properties should not return arrays. Keeping to avoid breaking changes.
public ITaskItem[]? InstrumentationTargetItems { get; set; }
#pragma warning restore CA1819 // Properties should not return arrays. Keeping to avoid breaking changes.

/// <summary>
/// Gets or sets the list of runtime copy local items.
Expand All @@ -33,7 +35,9 @@ public class CheckForInstrumentationPackages : Microsoft.Build.Utilities.Task
/// This list generated by the standard build target <code>ResolvePackageAssets</code>.
/// </remarks>
[Required]
#pragma warning disable CA1819 // Properties should not return arrays. Keeping to avoid breaking changes.
public ITaskItem[]? RuntimeCopyLocalItems { get; set; }
#pragma warning restore CA1819 // Properties should not return arrays. Keeping to avoid breaking changes.

/// <summary>
/// Gets or sets a value indicating whether to use verbose logging.
Expand Down Expand Up @@ -82,7 +86,7 @@ private bool ExecuteImplementation()
}

// Process each instrumentation target item.
foreach (var instrumentationTarget in InstrumentationTargetItems ?? Array.Empty<ITaskItem>())
foreach (var instrumentationTarget in InstrumentationTargetItems ?? [])
{
MissingInstrumentationAdapterPackage(instrumentationTarget, runtimeCopyLocalItemsDictionary);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ public VersionRange TargetNuGetPackageVersionRange
{
get
{
if (_targetNuGetPackageVersionRange is null)
{
_targetNuGetPackageVersionRange = ReadAndParseMetadata<VersionRange>(
"TargetNuGetPackageVersionRange", VersionRange.TryParse);
}
_targetNuGetPackageVersionRange ??= ReadAndParseMetadata<VersionRange>(
"TargetNuGetPackageVersionRange", VersionRange.TryParse);

return _targetNuGetPackageVersionRange;
}
Expand All @@ -55,16 +52,13 @@ public string InstrumentationNuGetPackageId
{
get
{
if (_instrumentationNuGetPackageId is null)
{
_instrumentationNuGetPackageId = ReadAndParseMetadata(
"InstrumentationNuGetPackageId",
(string value, out string parsedValue) =>
{
parsedValue = value;
return true;
});
}
_instrumentationNuGetPackageId ??= ReadAndParseMetadata(
"InstrumentationNuGetPackageId",
(string value, out string parsedValue) =>
{
parsedValue = value;
return true;
});

return _instrumentationNuGetPackageId;
}
Expand All @@ -74,11 +68,8 @@ public NuGetVersion InstrumentationNuGetPackageVersion
{
get
{
if (_instrumentationNuGetPackageVersion is null)
{
_instrumentationNuGetPackageVersion = ReadAndParseMetadata<NuGetVersion>(
"InstrumentationNuGetPackageVersion", NuGetVersion.TryParse);
}
_instrumentationNuGetPackageVersion ??= ReadAndParseMetadata<NuGetVersion>(
"InstrumentationNuGetPackageVersion", NuGetVersion.TryParse);

return _instrumentationNuGetPackageVersion;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<!-- The version of certain packages is needed to copy dependencies when creating the NuGet package -->
<NuGetVersioningVersion>6.5.0</NuGetVersioningVersion>
<AnalysisLevel>latest-All</AnalysisLevel>
</PropertyGroup>

<!-- ItemGroup with build files -->
Expand Down
Loading