|
| 1 | +<Project> |
| 2 | + |
| 3 | + <PropertyGroup Condition="'$(UsingMicrosoftNETSdk)' == ''"> |
| 4 | + <ElskomSdkMicrosoftNETSdkImported>true</ElskomSdkMicrosoftNETSdkImported> |
| 5 | + </PropertyGroup> |
| 6 | + |
| 7 | + <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" Condition="'$(UsingMicrosoftNETSdk)' == ''" /> |
| 8 | + |
| 9 | + <PropertyGroup> |
| 10 | + <LangVersion>preview</LangVersion> |
| 11 | + <EnforceCodeStyleInBuild Condition="'$(ProduceOnlyReferenceAssembly)' == ''">true</EnforceCodeStyleInBuild> |
| 12 | + <EnableNETAnalyzers>true</EnableNETAnalyzers> |
| 13 | + <AnalysisLevel>preview</AnalysisLevel> |
| 14 | + <AnalysisMode>AllEnabledByDefault</AnalysisMode> |
| 15 | + <!-- |
| 16 | + When DisableImplicitFrameworkReferences is true and ElskomSdkDisableImplicitFrameworkReference |
| 17 | + is not set, then set it to true by default. |
| 18 | + --> |
| 19 | + <ElskomSdkDisableImplicitFrameworkReference Condition="'$(DisableImplicitFrameworkReferences)' == 'true' AND '$(ElskomSdkDisableImplicitFrameworkReference)' == ''">true</ElskomSdkDisableImplicitFrameworkReference> |
| 20 | + <ElskomSdkFrameworkVersion Condition="'$(ElskomSdkFrameworkVersion)' == ''">@SDK_VERSION@</ElskomSdkFrameworkVersion> |
| 21 | + </PropertyGroup> |
| 22 | + |
| 23 | + <ItemGroup Condition="'$(ElskomSdkSkipImplicitPackages)' == ''"> |
| 24 | + <!-- Only add these analyzers when installed as an Sdk package from nuget. --> |
| 25 | + <PackageReference |
| 26 | + Include="SonarAnalyzer.CSharp" |
| 27 | + IsImplicitlyDefined="true" |
| 28 | + Version="*-*"> |
| 29 | + <PrivateAssets>all</PrivateAssets> |
| 30 | + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
| 31 | + </PackageReference> |
| 32 | + <PackageReference |
| 33 | + Include="StyleCop.Analyzers" |
| 34 | + IsImplicitlyDefined="true" |
| 35 | + Version="*-*"> |
| 36 | + <PrivateAssets>all</PrivateAssets> |
| 37 | + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
| 38 | + </PackageReference> |
| 39 | + <PackageReference |
| 40 | + Include="IDisposableAnalyzers" |
| 41 | + IsImplicitlyDefined="true" |
| 42 | + Version="*-*"> |
| 43 | + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
| 44 | + <PrivateAssets>all</PrivateAssets> |
| 45 | + </PackageReference> |
| 46 | + <!-- |
| 47 | + <PackageReference |
| 48 | + Include="ReflectionAnalyzers" |
| 49 | + IsImplicitlyDefined="true" |
| 50 | + Version="*-*" |
| 51 | + Condition="'$(ProduceOnlyReferenceAssembly)' == ''"> |
| 52 | + <PrivateAssets>all</PrivateAssets> |
| 53 | + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
| 54 | + </PackageReference> --> |
| 55 | + <!-- |
| 56 | + Generate code for resx files. |
| 57 | + But not for code that targets WindowsDesktop as that needs a source generator |
| 58 | + that supports binary resources in resx files. |
| 59 | + --> |
| 60 | + <PackageReference |
| 61 | + Include="Microsoft.CodeAnalysis.ResxSourceGenerator" |
| 62 | + IsImplicitlyDefined="true" |
| 63 | + Version="*-*" |
| 64 | + Condition="'$(ProduceOnlyReferenceAssembly)' == '' AND '$(UseWPF)' != 'true' AND '$(UseWindowsForms)' != 'true'"> |
| 65 | + <PrivateAssets>all</PrivateAssets> |
| 66 | + </PackageReference> |
| 67 | + <!-- |
| 68 | + For WindowsDesktop targeting applications, we need to use a special source generator that supports binary resource |
| 69 | + files that are a part of the resx file. |
| 70 | + --> |
| 71 | + <PackageReference |
| 72 | + Include="Meziantou.Framework.ResxSourceGenerator" |
| 73 | + IsImplicitlyDefined="true" |
| 74 | + Version="*-*" |
| 75 | + Condition="'$(ProduceOnlyReferenceAssembly)' == '' AND ('$(UseWPF)' == 'true' OR '$(UseWindowsForms)' == 'true')"> |
| 76 | + <PrivateAssets>all</PrivateAssets> |
| 77 | + </PackageReference> |
| 78 | + <!-- Implicitly include Properties/Resources.resx file for source generation. --> |
| 79 | + <AdditionalFiles |
| 80 | + Include="Properties\Resources.resx" |
| 81 | + Condition="Exists('Properties\Resources.resx')" /> |
| 82 | + <!-- Update implicitly included Properties/Resources.resx file for source generation when it exists inside of a WindowsDesktop application. --> |
| 83 | + <AdditionalFiles |
| 84 | + Update="Properties\Resources.resx" |
| 85 | + Condition="Exists('Properties\Resources.resx') AND ('$(UseWPF)' == 'true' OR '$(UseWindowsForms)' == 'true')" |
| 86 | + Namespace="$(RootNamespace).Properties" |
| 87 | + ClassName="Resources" /> |
| 88 | + <!-- We need the source generator we created. --> |
| 89 | + <PackageReference |
| 90 | + Include="GitBuildInfo.SourceGenerator" |
| 91 | + IsImplicitlyDefined="true" |
| 92 | + Version="*-*" |
| 93 | + Condition="'$(ProduceOnlyReferenceAssembly)' == ''"> |
| 94 | + <PrivateAssets>all</PrivateAssets> |
| 95 | + </PackageReference> |
| 96 | + </ItemGroup> |
| 97 | + |
| 98 | +</Project> |
0 commit comments