csharp-sdk/Directory.Build.props
2025-11-21 15:28:42 +02:00

49 lines
2.8 KiB
XML

<Project>
<PropertyGroup>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
<!-- Temp workaround for https://github.com/dotnet/sdk/issues/51265 -->
<RestoreEnablePackagePruning>false</RestoreEnablePackagePruning>
</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>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<_MTPResultsDirectory>$(ArtifactsTestResultsDir)</_MTPResultsDirectory>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --results-directory $(_MTPResultsDirectory) --report-trx --report-trx-filename $(MSBuildProjectName).$(TargetFramework).$(OS).trx</TestingPlatformCommandLineArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<!-- Don't use x64 when running netfx test procs on Windows ARM -->
<PreferNativeArm64>true</PreferNativeArm64>
</PropertyGroup>
</Project>