aspnetcore/eng/targets/CSharp.Common.props

86 lines
3.9 KiB
XML

<Project>
<PropertyGroup>
<LangVersion>9.0</LangVersion>
<!-- Enables Strict mode for Roslyn compiler -->
<Features>strict</Features>
</PropertyGroup>
<ItemGroup>
<!-- Required to exist in the NuGet package cache to enable code-signing. -->
<PackageReference Include="MicroBuild.Core" Version="0.3.0" PrivateAssets="All" AllowExplicitReference="true" ExcludeAssets="All" />
</ItemGroup>
<PropertyGroup>
<_ReferenceLocalRazorSDK
Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != '' OR '$(_RazorSdkImportsMicrosoftNetSdk)' == 'true'">true</_ReferenceLocalRazorSDK>
</PropertyGroup>
<ItemGroup Condition="'$(_ReferenceLocalRazorSDK)' == 'true'">
<!--
Use the Razor SDK as a project reference. The version of the .NET Core SDK we build with often contains a version of the Razor SDK
several versions older than latest. We reference the project to ensure it's built before the other projects that use it. Since this
is a project reference, we must explicitly import the props file and also specify the output location of the SDK directory.
-->
<Reference Include="Microsoft.NET.Sdk.Razor"
PrivateAssets="All"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true"
UndefineProperties="TargetFramework;TargetFrameworks" />
</ItemGroup>
<ImportGroup Condition="'$(_ReferenceLocalRazorSDK)' == 'true'">
<Import Project="$(RepoRoot)eng\targets\GetRazorSDKDirectory.props" />
<Import Project="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Microsoft.NET.Sdk.Razor.props" />
</ImportGroup>
<ItemGroup Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true'">
<!-- See comments further up in the file when we import the Razor SDK-->
<Reference Include="Microsoft.NET.Sdk.BlazorWebAssembly"
PrivateAssets="All"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true"
UndefineProperties="TargetFramework;TargetFrameworks" />
</ItemGroup>
<ImportGroup Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true'">
<Import Project="$(RepoRoot)src\Components\WebAssembly\Sdk\src\build\net5.0\Microsoft.NET.Sdk.BlazorWebAssembly.props" />
</ImportGroup>
<PropertyGroup Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true'">
<BlazorWebAssemblySdkDirectoryRoot>$(ArtifactsBinDir)\Microsoft.NET.Sdk.BlazorWebAssembly\$(Configuration)\sdk-output\</BlazorWebAssemblySdkDirectoryRoot>
</PropertyGroup>
<ItemGroup Condition=" '$(IsTestProject)' != 'true' AND '$(DotNetBuildFromSource)' != 'true' ">
<Reference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" PrivateAssets="All" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>$(RepoRoot)eng\AllRulesDisabled.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
<Reference Include="Microsoft.AspNetCore.Testing" />
<Reference Include="Moq" />
<Reference Include="NETStandard.Library" />
<Compile Include="$(SharedSourceRoot)test\SuccessfulTests.cs" LinkBase="SharedTests" />
</ItemGroup>
<Import Project="$(RepoRoot)src\Testing\src\build\Microsoft.AspNetCore.Testing.props" Condition=" '$(IsTestProject)' == 'true' " />
<ItemDefinitionGroup Condition=" '$(IsTestProject)' == 'true' ">
<Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemDefinitionGroup>
<!-- Properties to control how we handle warnings when using the tasks provided by the Yarn MSBuild SDK -->
<PropertyGroup>
<IgnoreYarnWarnings>false</IgnoreYarnWarnings>
<IgnoreYarnWarnings Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</IgnoreYarnWarnings>
</PropertyGroup>
</Project>