Repository navigation
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
48 lines (43 loc) · 3.02 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
48 lines (43 loc) · 3.02 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<Project>
<!--
OllamaSharp ships a Roslyn source generator (OllamaSharp.SourceGenerators) built
against a newer compiler than the currently pinned .NET SDK provides, which fails
the build with CS9057. The generator is not used by this repository, so strip it
from the analyzer set before compilation across every project (it also flows
transitively into hosts that reference the Ollama provider). Revisit once the
SDK's bundled Roslyn version catches up with the analyzer's target.
-->
<Target Name="RemoveIncompatibleOllamaSharpAnalyzers" BeforeTargets="CoreCompile">
<ItemGroup>
<Analyzer Remove="@(Analyzer)" Condition="$([System.String]::Copy('%(Analyzer.Identity)').Contains('OllamaSharp.SourceGenerators'))" />
</ItemGroup>
</Target>
<Target Name="RegenerateFrameworkAssemblyAttributes"
BeforeTargets="GenerateTargetFrameworkMonikerAttribute"
Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' and '$(TargetFrameworkMonikerAssemblyAttributesPath)' != ''">
<Delete Files="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
</Target>
<Target Name="DeleteStaleRazorAssemblyInfo"
BeforeTargets="CoreCompile"
Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true'">
<ItemGroup>
<_StaleRazorAssemblyInfoFiles Include="$(IntermediateOutputPath)*.AssemblyInfo.cs;
$(IntermediateOutputPath)*.AssemblyInfoInputs.cache;
$(IntermediateOutputPath)*.GeneratedMSBuildEditorConfig.editorconfig;
$(IntermediateOutputPath)*.GlobalUsings.g.cs;
$(IntermediateOutputPath)*.RazorAssemblyInfo.cs;
$(IntermediateOutputPath)*.MvcApplicationPartsAssemblyInfo.cs;
$(IntermediateOutputPath)*.RazorAssemblyInfo.cache;
$(IntermediateOutputPath)*.MvcApplicationPartsAssemblyInfo.cache"
Exclude="$(IntermediateOutputPath)$(AssemblyName).AssemblyInfo.cs;
$(IntermediateOutputPath)$(AssemblyName).AssemblyInfoInputs.cache;
$(IntermediateOutputPath)$(AssemblyName).GeneratedMSBuildEditorConfig.editorconfig;
$(IntermediateOutputPath)$(AssemblyName).GlobalUsings.g.cs;
$(IntermediateOutputPath)$(AssemblyName).RazorAssemblyInfo.cs;
$(IntermediateOutputPath)$(AssemblyName).MvcApplicationPartsAssemblyInfo.cs;
$(IntermediateOutputPath)$(AssemblyName).RazorAssemblyInfo.cache;
$(IntermediateOutputPath)$(AssemblyName).MvcApplicationPartsAssemblyInfo.cache" />
</ItemGroup>
<Delete Files="@(_StaleRazorAssemblyInfoFiles)" />
</Target>
</Project>