Skip to content

Commit

Permalink
Set ExcludeFrom* properties for test projects in targets (#14321)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorHofer authored Dec 20, 2023
1 parent 0e5cb66 commit c0c425d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
where the BeforeCommonTargets hook is not used (see https://github.com/dotnet/arcade/issues/2676).
In that case, Sdk.targets imports it explicitly. -->

<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestUtilityProject)' == 'true'">
<!-- Exclude test projects from source-build by default -->
<ExcludeFromSourceBuild Condition="'$(ExcludeFromSourceBuild)' == ''">true</ExcludeFromSourceBuild>
<!-- Vertical Build PoC. Exclude test projects. -->
<ExcludeFromVerticalBuild Condition="'$(ExcludeFromVerticalBuild)' == ''">true</ExcludeFromVerticalBuild>
</PropertyGroup>

<!--
If a project specifies ExcludeFromSourceBuild=true or ExcludeFromVerticalBuild=true during a source build/vertical
build suppress all targets and emulate a no-op (empty common targets like Restore, Build, Pack, etc.).
Expand Down
11 changes: 0 additions & 11 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,4 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" IsImplicitlyDefined="true" />
</ItemGroup>

<!-- The IsTestUtilityProject property is supposed to be set manually for test utility projects, there's no auto-detection. -->
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestUtilityProject)' == 'true'">
<!-- Treat test assemblies as non-shipping (do not publish or sign them). -->
<IsShipping Condition="'$(IsShipping)' == ''">false</IsShipping>

<!-- exclude test projects from source-build by default -->
<ExcludeFromSourceBuild Condition="'$(ExcludeFromSourceBuild)' == ''">true</ExcludeFromSourceBuild>
<!-- Vertical Build PoC. Exclude test projects. -->
<ExcludeFromVerticalBuild Condition="'$(ExcludeFromVerticalBuild)' == ''">true</ExcludeFromVerticalBuild>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
if available for the kind of artifact they operate on.
-->
<PropertyGroup>
<!-- Treat test assemblies as non-shipping (do not publish or sign them). -->
<IsShipping Condition="'$(IsShipping)' == '' and ('$(IsTestProject)' == 'true' or '$(IsTestUtilityProject)' == 'true')">false</IsShipping>
<IsShipping Condition="'$(IsShipping)' == ''">true</IsShipping>

<IsShippingAssembly Condition="'$(IsShippingAssembly)' == ''">$(IsShipping)</IsShippingAssembly>
Expand Down

0 comments on commit c0c425d

Please # to comment.