Avoid reading Configuration in Directory.Build.props (#1776)

This commit is contained in:
Loi Nguyen 2026-08-05 06:32:07 +07:00 • committed by GitHub
commit aa07c6fcca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 12 deletions

View file

@ -11,30 +11,19 @@
</PropertyGroup>
<PropertyGroup>
<!-- This works around issues with dotnet test which are fixed in https://github.com/dotnet/sdk/pull/51794 -->
<!-- It can be safely removed once .NET SDK 10.0.101 is out and is used in the repo -->
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</RepoRoot>
<ArtifactsDir Condition="'$(ArtifactsDir)' == ''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</ArtifactsDir>
<ArtifactsObjDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'obj'))</ArtifactsObjDir>
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
<ArtifactsTestResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'TestResults', '$(Configuration)'))</ArtifactsTestResultsDir>
<ArtifactsPackagesDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'packages', '$(Configuration)'))</ArtifactsPackagesDir>
<OutDirName>$(MSBuildProjectName)</OutDirName>
<BaseIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(OutDirName)\'))</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<BaseOutputPath>$([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\'))</BaseOutputPath>
<OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
<PackageOutputPath>$(ArtifactsPackagesDir)</PackageOutputPath>
</PropertyGroup>
<PropertyGroup>
<VSTestLogger Condition="'$(VSTestLogger)' == ''">trx%3bLogFileName=$(MSBuildProjectName).$(TargetFramework).$(OS).trx</VSTestLogger>
<VSTestResultsDirectory Condition="'$(VSTestResultsDirectory)' == ''">$(ArtifactsTestResultsDir)</VSTestResultsDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">

8
Directory.Build.targets Normal file
View file

@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<ArtifactsTestResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'TestResults', '$(Configuration)'))</ArtifactsTestResultsDir>
<ArtifactsPackagesDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'packages', '$(Configuration)'))</ArtifactsPackagesDir>
<PackageOutputPath>$(ArtifactsPackagesDir)</PackageOutputPath>
<VSTestResultsDirectory Condition="'$(VSTestResultsDirectory)' == ''">$(ArtifactsTestResultsDir)</VSTestResultsDirectory>
</PropertyGroup>
</Project>

View file

@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.100",
"version": "10.0.101",
"rollForward": "minor"
}
}

View file

@ -1,4 +1,6 @@
<Project>
<Import Project="..\Directory.Build.targets" />
<Target Name="PinMcpProjectReferencePackageVersions"
AfterTargets="_GetProjectReferenceVersions"
Condition="'$(MSBuildProjectName)' == 'ModelContextProtocol'