Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
26 changes: 24 additions & 2 deletions src/Build/Microsoft.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,36 @@

<PackageReference Include="Microsoft.IO.Redist" Condition="'$(FeatureMSIORedist)' == 'true'" />

<PackageReference Include="Microsoft.CodeAnalysis.Collections" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.PooledObjects" PrivateAssets="all" />
<PackageReference Include="Microsoft.BuildXL.Processes" Condition="'$(FeatureReportFileAccesses)' == 'true'" PrivateAssets="all" />
<!-- Remove the direct NETStandard.Library dependency when Microsoft.BuildXL.Processes stops bringing in netstandard1.x dependencies
or when a .NET 10 SDK is used (NuGet Package Pruning eliminates netstandard1.x dependencies). -->
<PackageReference Include="NETStandard.Library" VersionOverride="2.0.3" PrivateAssets="all" Condition="'$(FeatureReportFileAccesses)' == 'true'" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Collections" PrivateAssets="all" />

<!-- Display files included by the Microsoft.CodeAnalysis.Collections source package in a 'SourcePackages\Collections' folder -->
<Content Update="@(Content)">
<Link Condition="'%(NuGetPackageId)' == 'Microsoft.CodeAnalysis.Collections'">SourcePackages\Collections\%(Link)</Link>
</Content>
<Compile Update="@(Compile)">
<Link Condition="'%(NuGetPackageId)' == 'Microsoft.CodeAnalysis.Collections'">SourcePackages\Collections\%(Link)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PooledObjects" PrivateAssets="all" />

<!-- Display files included by the Microsoft.CodeAnalysis.PooledObjects source package in a 'SourcePackages\PooledObjects' folder -->
<Content Update="@(Content)">
<Link Condition="'%(NuGetPackageId)' == 'Microsoft.CodeAnalysis.PooledObjects'">SourcePackages\PooledObjects\%(Link)</Link>
</Content>
<Compile Update="@(Compile)">
<Link Condition="'%(NuGetPackageId)' == 'Microsoft.CodeAnalysis.PooledObjects'">SourcePackages\PooledObjects\%(Link)</Link>
</Compile>
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(DotNetBuildSourceOnly)' != 'true'">
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" PrivateAssets="all" />
</ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/Framework/BuildErrorEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using Microsoft.Build.Shared;

Expand Down
2 changes: 0 additions & 2 deletions src/Framework/BuildMessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using System.Runtime.Serialization;
using Microsoft.Build.Shared;
Expand Down
2 changes: 0 additions & 2 deletions src/Framework/BuildWarningEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using Microsoft.Build.Shared;

Expand Down
2 changes: 0 additions & 2 deletions src/Framework/CriticalBuildMessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif

#nullable disable

Expand Down
2 changes: 0 additions & 2 deletions src/Framework/CustomBuildEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif

#nullable disable

Expand Down
2 changes: 0 additions & 2 deletions src/Framework/ExtendedBuildErrorEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

using System;
using System.Collections.Generic;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using Microsoft.Build.Shared;

Expand Down
2 changes: 0 additions & 2 deletions src/Framework/ExtendedBuildWarningEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

using System;
using System.Collections.Generic;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using Microsoft.Build.Shared;

Expand Down
2 changes: 0 additions & 2 deletions src/Framework/LazyFormattedBuildEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.Globalization;
using System.IO;

Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Microsoft.Build.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Contracts" PrivateAssets="all" />

<!-- Display files included by the Microsoft.CodeAnalysis.Contracts source package in a 'SourcePackages\Contracts' folder -->
<Content Update="@(Content)">
<Link Condition="'%(NuGetPackageId)' == 'Microsoft.CodeAnalysis.Contracts'">SourcePackages\Contracts\%(Link)</Link>
</Content>
<Compile Update="@(Compile)">
<Link Condition="'%(NuGetPackageId)' == 'Microsoft.CodeAnalysis.Contracts'">SourcePackages\Contracts\%(Link)</Link>
</Compile>
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
Expand Down
11 changes: 10 additions & 1 deletion src/Framework/Polyfills/CallerArgumentExpressionAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#if NETCOREAPP3_0_OR_GREATER

using System.Runtime.CompilerServices;

// This is a supporting forwarder for an internal polyfill API
[assembly: TypeForwardedTo(typeof(CallerArgumentExpressionAttribute))]

#else

namespace System.Runtime.CompilerServices;

#if !NET
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
internal sealed class CallerArgumentExpressionAttribute : Attribute
{
Expand All @@ -14,4 +22,5 @@ public CallerArgumentExpressionAttribute(string parameterName)

public string ParameterName { get; }
}

#endif
12 changes: 10 additions & 2 deletions src/Framework/Polyfills/StringSyntaxAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#if !NET
#if NET7_0_OR_GREATER

using System;
using System.Runtime.CompilerServices;

// This is a supporting forwarder for an internal polyfill API
[assembly: TypeForwardedTo(typeof(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute))]

#else

namespace System.Diagnostics.CodeAnalysis;

[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
internal sealed class StringSyntaxAttribute : Attribute
Expand Down Expand Up @@ -67,4 +74,5 @@ public StringSyntaxAttribute(string syntax, params object?[] arguments)
/// <summary>The syntax identifier for strings containing XML.</summary>
public const string Xml = nameof(Xml);
}

#endif
2 changes: 0 additions & 2 deletions src/Framework/ProjectImportedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using Microsoft.Build.Shared;

Expand Down
2 changes: 0 additions & 2 deletions src/Framework/TargetSkippedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using Microsoft.Build.Shared;

Expand Down
2 changes: 0 additions & 2 deletions src/Shared/TaskLoggingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.Globalization;
using System.IO;
using System.Resources;
Expand Down
2 changes: 0 additions & 2 deletions src/Tasks/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

#nullable disable

#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using Microsoft.Build.Framework;

namespace Microsoft.Build.Tasks
Expand Down
2 changes: 0 additions & 2 deletions src/Tasks/Exec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

using System;
using System.Collections.Generic;
#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
Expand Down
2 changes: 0 additions & 2 deletions src/Tasks/Warning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

#nullable disable

#if NET
using System.Diagnostics.CodeAnalysis;
#endif
using Microsoft.Build.Framework;

namespace Microsoft.Build.Tasks
Expand Down