Skip to content
Closed
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
39 changes: 39 additions & 0 deletions src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.Build.Execution;
using Shouldly;
using Xunit;

namespace Microsoft.Build.Engine.UnitTests.BackEnd
{
public class TypeForwarding_Tests
{
[Theory]
[InlineData("Microsoft.Build.Internal.Handshake")]
[InlineData("Microsoft.Build.Internal.HandshakeComponents")]
[InlineData("Microsoft.Build.Internal.HandshakeOptions")]
[InlineData("Microsoft.Build.Internal.HandshakeStatus")]
[InlineData("Microsoft.Build.Internal.ServerNodeHandshake")]
[InlineData("Microsoft.Build.BackEnd.INodePacket")]
[InlineData("Microsoft.Build.BackEnd.NodePacketType")]
[InlineData("Microsoft.Build.BackEnd.NodePacketTypeExtensions")]
[InlineData("Microsoft.Build.Internal.CommunicationsUtilities")]
[InlineData("Microsoft.Build.Shared.XMakeAttributes")]
[InlineData("Microsoft.Build.Shared.XMakeElements")]
public void BuildAssemblyContainsExpectedTypeForwarders(string typeName)
{
GetForwardedTypeNames().ShouldContain(typeName);
}

private static HashSet<string> GetForwardedTypeNames()
=> typeof(BuildManager).Assembly
.GetForwardedTypes()
.Select(type => type.FullName!)
.ToHashSet(StringComparer.Ordinal);
}
}
11 changes: 11 additions & 0 deletions src/Build/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@
[assembly: Dependency("BuildXL.Processes", LoadHint.Sometimes)]

[assembly: TypeForwardedTo(typeof(Microsoft.Build.Execution.BuildRequestDataFlags))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.Handshake))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.HandshakeComponents))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.HandshakeOptions))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.HandshakeStatus))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.ServerNodeHandshake))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.BackEnd.INodePacket))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.BackEnd.NodePacketType))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.BackEnd.NodePacketTypeExtensions))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.CommunicationsUtilities))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Shared.XMakeAttributes))]
[assembly: TypeForwardedTo(typeof(Microsoft.Build.Shared.XMakeElements))]
Loading