Skip to content

Commit

Permalink
Make sure changes to ruleset files trigger a build
Browse files Browse the repository at this point in the history
Workaround for dotnet/project-system#2374
Workaround for dotnet/roslyn#25041
  • Loading branch information
sharwell committed Feb 25, 2018
1 parent 0c32f59 commit e4c960c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,19 @@
<EmbeddedResource Update="**\*.resx" GenerateSource="true" />
</ItemGroup>

<ItemGroup>
<!-- Workaround for https://github.com/dotnet/project-system/issues/2374 -->
<UpToDateCheckInput Include="$(CodeAnalysisRuleSet)" Condition="'$(CodeAnalysisRuleSet)' != ''" />

<!-- Include the shipping rules explicitly when they are imported by the non-shipping rules -->
<!-- Additional workaround for https://github.com/dotnet/project-system/issues/2374 -->
<UpToDateCheckInput Include="$(MSBuildThisFileDirectory)..\build\Analyzers_ShippingRules.ruleset" Condition="'$(IsTestProject)' == 'true' OR '$(NonShipping)' == 'true'" />
</ItemGroup>

<PropertyGroup>
<!-- Workaround for https://github.com/dotnet/roslyn/issues/25041 -->
<MSBuildAllProjects Condition="'$(IsTestProject)' == 'true' OR '$(NonShipping)' == 'true'">$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\build\Analyzers_ShippingRules.ruleset</MSBuildAllProjects>
</PropertyGroup>

<Import Project="$(RepoToolsetDir)Imports.targets" Condition="Exists('$(RepoToolsetDir)Imports.targets')" />
</Project>

0 comments on commit e4c960c

Please sign in to comment.