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
2 changes: 2 additions & 0 deletions eng/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<ItemGroup>
<PackageVersion Include="Microsoft.Build.NuGetSdkResolver" Version="$(NuGetBuildTasksVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Collections" Version="$(MicrosoftCodeAnalysisCollectionsVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Contracts" Version="$(MicrosoftCodeAnalysisCollectionsVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.PooledObjects" Version="$(MicrosoftCodeAnalysisCollectionsVersion)" />
<PackageVersion Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageVersion Include="Microsoft.IO.Redist" Version="$(MicrosoftIORedistVersion)" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetVersion)" Condition="'$(UsingToolMicrosoftNetCompilers)' != 'true'" />
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<!-- DotNetCliVersion MUST match the dotnet version in global.json.
Otherwise, this version of dotnet will not be installed and the build will error out. -->
<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\global.json')), '"dotnet": "([^"]*)"').Groups.get_Item(1))</DotNetCliVersion>
<MicrosoftCodeAnalysisCollectionsVersion>4.2.0-1.22102.8</MicrosoftCodeAnalysisCollectionsVersion>
<MicrosoftCodeAnalysisCollectionsVersion>5.0.0-1.25277.114</MicrosoftCodeAnalysisCollectionsVersion>
<MicrosoftDotNetXUnitExtensionsVersion>10.0.0-beta.25358.3</MicrosoftDotNetXUnitExtensionsVersion>
<NuGetBuildTasksVersion>6.15.0-preview.1.86</NuGetBuildTasksVersion>
<MicrosoftNetCompilersToolsetVersion>5.0.0-1.25361.3</MicrosoftNetCompilersToolsetVersion>
Expand Down
5 changes: 2 additions & 3 deletions src/Build/Microsoft.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

<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). -->
Expand Down Expand Up @@ -124,9 +126,6 @@
<Compile Include="..\Shared\TaskLoggingHelperExtension.cs">
<Link>BackEnd\Components\RequestBuilder\IntrinsicTasks\TaskLoggingHelperExtension.cs</Link>
</Compile>
<Compile Include="..\Shared\IsExternalInit.cs">
<Link>BuildCheck\Utilities\IsExternalInit.cs</Link>
</Compile>
<Compile Include="..\Shared\TaskParameter.cs" />
<Compile Include="..\Shared\TaskParameterTypeVerifier.cs" />
<Compile Include="..\Shared\TranslatorHelpers.cs" />
Expand Down
7 changes: 0 additions & 7 deletions src/Framework/AssemblyUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@
using Microsoft.Build.Framework;
#endif


// Declare this to get init properties. See https://github.com/dotnet/roslyn/issues/45510#issuecomment-694977239
#nullable disable

namespace System.Runtime.CompilerServices
{
internal static class IsExternalInit { }
}

namespace Microsoft.Build.Shared
{
/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions src/Framework/Microsoft.Build.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

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

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
Expand All @@ -29,8 +29,9 @@
<PackageReference Include="Microsoft.VisualStudio.OpenTelemetry.ClientExtensions" PrivateAssets="all" />
</ItemGroup>

<!-- Framework and standard don't have DiagnosticSource. -->
<!-- Framework and standard don't have these. -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' OR '$(TargetFrameworkIdentifier)' == '.NETStandard'">
<PackageReference Include="System.Collections.Immutable" />
Comment thread
teo-tsirpanis marked this conversation as resolved.
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions src/MSBuildTaskHost/MSBuildTaskHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<Link>CopyOnWriteDictionary.cs</Link>
</Compile>
<Compile Include="..\Shared\Constants.cs" />
<Compile Include="..\Shared\IsExternalInit.cs" />
<Compile Include="..\Shared\EnvironmentUtilities.cs" Link="EnvironmentUtilities.cs" />
<Compile Include="..\Shared\ReadOnlyEmptyDictionary.cs" />
<Compile Include="..\Framework\ErrorUtilities.cs">
Expand Down Expand Up @@ -202,6 +203,7 @@
<Compile Include="Concurrent\ConcurrentDictionary.cs" />
<Compile Include="Concurrent\ConcurrentQueue.cs" />
<Compile Include="Immutable\ImmutableDictionary.cs" />
<Compile Include="NullableAttributes.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TypeLoader.cs" />
<Compile Include="..\MSBuild\LogMessagePacket.cs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

// This was copied from https://github.com/dotnet/runtime/blob/39b9607807f29e48cae4652cd74735182b31182e/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
// and updated to have the scope of the attributes be internal.
// This file is used only by MSBuildTaskHost; other projects should get the polyfills from the
// Microsoft.CodeAnalysis.Contracts package, through the Microsoft.Build.Framework project.

#nullable disable

Expand Down
13 changes: 13 additions & 0 deletions src/Shared/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#if NET
using System.Runtime.CompilerServices;

// Type-forward to the inbox class where available, in order to maintain binary compatibility
// between the .NET and .NET Standard 2.0 assemblies.
[assembly: TypeForwardedTo(typeof(IsExternalInit))]

#else

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
// Needed so we can use init setters in full fw or netstandard
// (details: https://developercommunity.visualstudio.com/t/error-cs0518-predefined-type-systemruntimecompiler/1244809)
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class IsExternalInit { }
}
#endif