Repository navigation
Expand file tree
/
Copy pathDirectory.Solution.targets
More file actions
30 lines (27 loc) · 2.32 KB
/
Copy pathDirectory.Solution.targets
File metadata and controls
30 lines (27 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<Project>
<!-- Import the NuGet props file to get access to Pkg* variables -->
<Import Project="src/FSharp.Formatting/obj/FSharp.Formatting.fsproj.nuget.g.props" Condition="Exists('src/FSharp.Formatting/obj/FSharp.Formatting.fsproj.nuget.g.props')" />
<ItemGroup>
<ProjectsToAnalyze Include="src/**/*.fsproj" />
</ItemGroup>
<Target Name="AnalyzeSolution" Condition="Exists('src/FSharp.Formatting/obj/FSharp.Formatting.fsproj.nuget.g.props')">
<PropertyGroup>
<CodeRoot>$(SolutionDir)</CodeRoot>
<FSharpAnalyzersOtherFlags>--analyzers-path "$(PkgG-Research_FSharp_Analyzers)/analyzers/dotnet/fs"</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --analyzers-path "$(PkgIonide_Analyzers)/analyzers/dotnet/fs"</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --exclude-analyzers PartialAppAnalyzer ReturnStructPartialActivePatternAnalyzer -c Release</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --code-root $(CodeRoot)</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --report "$(CodeRoot)/analysis.sarif"</FSharpAnalyzersOtherFlags>
<!-- These analyzers report at severity Info by default: easy to miss in the console output,
and the tool only exits non-zero for errors, so they never failed anything. -->
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --treat-as-error IONIDE-002 IONIDE-010 IONIDE-012</FSharpAnalyzersOtherFlags>
<!-- The build script is source like anything under src/, and the only F# no project compiles.
The scripts NuGet generates for its `#r "nuget: ..."` references are not ours. -->
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --script "$(SolutionDir)build.fsx" --exclude-files **/.packagemanagement/**</FSharpAnalyzersOtherFlags>
</PropertyGroup>
<Delete Files="$(SolutionDir)/analysis.sarif" Condition="Exists('$(SolutionDir)/analysis.sarif')" />
<!-- Execute fsharp-analyzers with all projects and the build script in a single process -->
<Exec
Command="dotnet fsharp-analyzers $(FSharpAnalyzersOtherFlags) @(ProjectsToAnalyze->'--project "%(FullPath)"', ' ')" />
</Target>
</Project>