Skip to content

Commit 93902be

Browse files
committed
Use Traversal filtering of solution files
1 parent a7a6f33 commit 93902be

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Directory.Solution.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TraversalSkipUnsupportedProjects>true</TraversalSkipUnsupportedProjects>
5+
</PropertyGroup>
6+
7+
<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.props" />
8+
9+
</Project>

Directory.Solution.targets

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project>
2+
3+
<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />
4+
5+
<!-- Overwrite Traversal Sdk.targetse target to skip projects without even kicking-off evaluations. -->
6+
<Target Name="GetProjectsToSkip">
7+
<ItemGroup Condition="'$(Test)' == 'false'">
8+
<ProjectToSkip Include="@(ProjectReference)"
9+
Message=""
10+
Condition="$([System.String]::new('%(ProjectReference.Identity)').EndsWith('.Tests.csproj'))"
11+
OriginalItemSpec="%(Identity)" />
12+
</ItemGroup>
13+
</Target>
14+
15+
</Project>

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"allowPrerelease": true
88
},
99
"msbuild-sdks": {
10-
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23628.1"
10+
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23628.1",
11+
"Microsoft.Build.Traversal": "4.1.0"
1112
}
1213
}

0 commit comments

Comments
 (0)