Skip to content

Commit 1dbd5e9

Browse files
committed
Fix IsUnitTestProject (cannot be specified twice) and MSBuildProjectName.EndsWith (was invalid syntax so NCrunch was broken and VS was padlock unhappy if tolerant)
1 parent 0ba0a35 commit 1dbd5e9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Directory.Build.props

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
<AnalysisLevel>latest</AnalysisLevel>
3232
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
3333

34-
<IsUnitTestProject>false</IsUnitTestProject>
3534
<DisableApiAnalyzers>false</DisableApiAnalyzers>
36-
<IsUnitTestProject Condition="$(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.Testing'))">true</IsUnitTestProject>
35+
<IsUnitTestProject Condition="'$(MSBuildProjectName)' != '' and ($([System.String]::Copy($(MSBuildProjectName)).EndsWith('.Tests')) Or $([System.String]::Copy($(MSBuildProjectName)).EndsWith('.Testing')))">true</IsUnitTestProject>
3736
</PropertyGroup>
3837

3938
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
@@ -50,7 +49,7 @@
5049
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5150
</PackageReference>
5251
</ItemGroup>
53-
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'false' and $(MSBuildProjectName.EndsWith('.Schema')) == 'false' and '$(DisableApiAnalyzers)' == 'false'">
52+
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'false' and '$(MSBuildProjectName)' != '' and $([System.String]::Copy($(MSBuildProjectName)).EndsWith('.Schema')) == 'false' and '$(DisableApiAnalyzers)' == 'false'">
5453
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers">
5554
<PrivateAssets>all</PrivateAssets>
5655
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -76,7 +75,7 @@
7675
</PackageReference>
7776

7877
</ItemGroup>
79-
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'true' and $(MSBuildProjectName.EndsWith('.Tests'))">
78+
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'true' and $([System.String]::Copy($(MSBuildProjectName)).EndsWith('.Tests'))">
8079
<ProjectReference Include="..\GitVersion.Testing\GitVersion.Testing.csproj"/>
8180

8281
<Using Include="GitVersion.Testing"/>

0 commit comments

Comments
 (0)