|
| 1 | +<Project Sdk="Microsoft.NET.Sdk"> |
| 2 | + |
| 3 | + <PropertyGroup> |
| 4 | + <OutputType>Exe</OutputType> |
| 5 | + <TargetFrameworks>net8.0</TargetFrameworks> |
| 6 | + <ImplicitUsings>enable</ImplicitUsings> |
| 7 | + <Nullable>enable</Nullable> |
| 8 | + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| 9 | + |
| 10 | + <IsPackable>false</IsPackable> |
| 11 | + <IsTestProject>true</IsTestProject> |
| 12 | + <RootNamespace>ModelContextProtocol.Tests</RootNamespace> |
| 13 | + <!-- https://github.com/dotnet/sdk/issues/51060 --> |
| 14 | + <NoWarn>$(NoWarn);NU1903;NU1902</NoWarn> |
| 15 | + <!-- Define for conditional TimeProvider support in InMemoryMcpTaskStore --> |
| 16 | + <DefineConstants>$(DefineConstants);MCP_TEST_TIME_PROVIDER</DefineConstants> |
| 17 | + </PropertyGroup> |
| 18 | + |
| 19 | + <PropertyGroup> |
| 20 | + <!-- Without this, tests are currently not showing results until all tests complete |
| 21 | + https://xunit.net/docs/getting-started/v3/microsoft-testing-platform |
| 22 | + --> |
| 23 | + <DisableTestingPlatformServerCapability>true</DisableTestingPlatformServerCapability> |
| 24 | + </PropertyGroup> |
| 25 | + |
| 26 | + <!-- Include all test source files from the main test project --> |
| 27 | + <ItemGroup> |
| 28 | + <Compile Include="../ModelContextProtocol.Tests/**/*.cs" |
| 29 | + Exclude="../ModelContextProtocol.Tests/bin/**;../ModelContextProtocol.Tests/obj/**" /> |
| 30 | + </ItemGroup> |
| 31 | + |
| 32 | + <ItemGroup> |
| 33 | + <Compile Include="..\Common\**\*.cs" /> |
| 34 | + <!-- Link InMemoryMcpTaskStore.cs for testing with TimeProvider support --> |
| 35 | + <Compile Include="..\..\src\ModelContextProtocol.Core\Server\InMemoryMcpTaskStore.cs" Link="Server\InMemoryMcpTaskStore.cs" /> |
| 36 | + <!-- Include dependencies for the linked InMemoryMcpTaskStore.cs --> |
| 37 | + <Compile Include="..\..\src\Common\Experimentals.cs" Link="Experimentals.cs" /> |
| 38 | + <Compile Include="..\..\src\Common\Polyfills\System\IdHelpers.cs" Link="Polyfills\IdHelpers.cs" /> |
| 39 | + </ItemGroup> |
| 40 | + |
| 41 | + <ItemGroup> |
| 42 | + <PackageReference Include="coverlet.collector"> |
| 43 | + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
| 44 | + <PrivateAssets>all</PrivateAssets> |
| 45 | + </PackageReference> |
| 46 | + <PackageReference Include="Microsoft.Extensions.AI" /> |
| 47 | + <PackageReference Include="Microsoft.Extensions.AI.OpenAI" /> |
| 48 | + <PackageReference Include="Microsoft.Extensions.Logging" /> |
| 49 | + <PackageReference Include="Microsoft.Extensions.Logging.Console" /> |
| 50 | + <PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" /> |
| 51 | + <PackageReference Include="Microsoft.NET.Test.Sdk" /> |
| 52 | + <PackageReference Include="Moq" /> |
| 53 | + <PackageReference Include="OpenTelemetry" /> |
| 54 | + <PackageReference Include="OpenTelemetry.Exporter.InMemory" /> |
| 55 | + <PackageReference Include="Serilog" /> |
| 56 | + <PackageReference Include="JsonSchema.Net" /> |
| 57 | + <PackageReference Include="xunit.v3" /> |
| 58 | + <PackageReference Include="xunit.runner.visualstudio"> |
| 59 | + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
| 60 | + <PrivateAssets>all</PrivateAssets> |
| 61 | + </PackageReference> |
| 62 | + <PackageReference Include="System.Linq.AsyncEnumerable" /> |
| 63 | + </ItemGroup> |
| 64 | + |
| 65 | + <ItemGroup> |
| 66 | + <!-- Force ModelContextProtocol.Core to use netstandard2.0 build --> |
| 67 | + <ProjectReference Include="..\..\src\ModelContextProtocol.Core\ModelContextProtocol.Core.csproj"> |
| 68 | + <SetTargetFramework>TargetFramework=netstandard2.0</SetTargetFramework> |
| 69 | + </ProjectReference> |
| 70 | + <ProjectReference Include="..\ModelContextProtocol.TestServer\ModelContextProtocol.TestServer.csproj" /> |
| 71 | + <ProjectReference Include="..\..\samples\TestServerWithHosting\TestServerWithHosting.csproj" /> |
| 72 | + </ItemGroup> |
| 73 | + |
| 74 | + <ItemGroup> |
| 75 | + <Content Include="$([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)'))ModelContextProtocol.TestServer\$(Configuration)\$(TargetFramework)\*"> |
| 76 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 77 | + </Content> |
| 78 | + <Content Include="$([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)'))TestServerWithHosting\$(Configuration)\$(TargetFramework)\*"> |
| 79 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 80 | + </Content> |
| 81 | + </ItemGroup> |
| 82 | + |
| 83 | +</Project> |
0 commit comments