This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDirectory.Build.props
158 lines (140 loc) · 8.6 KB
/
Directory.Build.props
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<Project>
<ImportGroup Condition="Exists($([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))) == 'true'">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
</ImportGroup>
<PropertyGroup Label="Project">
<!-- Prepend organization name to default namespace -->
<RootNamespace>Esentis.$(MSBuildProjectName)</RootNamespace>
<!-- Generate documentation file and ignore warnings for undocumented elements -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<!-- Error out upon trying to package projects marked as not packable -->
<WarnOnPackingNonPackableProject>true</WarnOnPackingNonPackableProject>
<!-- Disable warnings on preview SDK versions -->
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<!-- We only target a single framework hence the subdir is not needed -->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<!-- Same but for runtime assemblies -->
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<!-- Enable lock files -->
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<!-- Locked mode should only be enabled on CI -->
<RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</RestoreLockedMode>
<!-- Disable nugets from SDK fallback folders -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<!-- Enable nullable context by default for all projects -->
<Nullable>enable</Nullable>
<!-- Enable .NET 5+ native analyzers -->
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<!-- Use latest stable language features -->
<AnalysisLevel>latest</AnalysisLevel>
<!-- Use latest language version supported by the SDK -->
<LangVersion>latest</LangVersion>
<!-- Use deterministic builds -->
<Deterministic>true</Deterministic>
</PropertyGroup>
<!-- Sets deterministic source paths for CI builds -->
<PropertyGroup Label="CI Build">
<!-- https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#system-variables -->
<ContinuousIntegrationBuild Condition="'$(TF_BUILD)' == 'true'">true</ContinuousIntegrationBuild>
<!-- https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables -->
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<!-- https://docs.gitlab.com/ee/ci/variables/predefined_variables.html -->
<ContinuousIntegrationBuild Condition="'$(GITLAB_CI)' == 'true'">true</ContinuousIntegrationBuild>
<!-- https://www.appveyor.com/docs/environment-variables/ -->
<ContinuousIntegrationBuild Condition="'$(APPVEYOR)' == 'True'">true</ContinuousIntegrationBuild>
<ContinuousIntegrationBuild Condition="'$(APPVEYOR)' == 'true'">true</ContinuousIntegrationBuild>
</PropertyGroup>
<!-- Enable custom nesting for files -->
<ItemGroup>
<ProjectCapability Include="DynamicFileNesting" />
<ProjectCapability Include="DynamicDependentFile" />
</ItemGroup>
<!-- Use submodule .NET ruleset for analyzers -->
<PropertyGroup Label="Code Analysis Ruleset" Condition="Exists('$(MSBuildThisFileDirectory)\dotnet.ruleset')">
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)\dotnet.ruleset</CodeAnalysisRuleset>
</PropertyGroup>
<!-- Use submodule stylecop configuration -->
<ItemGroup Label="Code Analysis Configuration" Condition="Exists('$(MSBuildThisFileDirectory)\stylecop.json')">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<!-- Use common AssemblyInfo versioning -->
<ItemGroup Label="AssemblyInfo Versioning" Condition="Exists('$(MSBuildThisFileDirectory)\AssemblyInfo\AssemblyInfo.cs')">
<Compile Include="$(MSBuildThisFileDirectory)\AssemblyInfo\AssemblyInfo.cs" Link="Properties\AssemblyInfo.cs" />
</ItemGroup>
<PropertyGroup Label="Disable AssemblyInfo Generation" Condition="Exists('$(MSBuildThisFileDirectory)\AssemblyInfo\AssemblyInfo.cs')">
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup>
<!-- Disable packable/publishable for test projects -->
<PropertyGroup Label="Output Modifiers">
<InTestFolder>false</InTestFolder>
<InTestFolder Condition="'$([System.IO.Directory]::GetParent($(MSBuildProjectDirectory)).Name)' == 'tests'">true</InTestFolder>
<IsTest Condition="$(MSBuildProjectName.ToLowerInvariant().EndsWith('tests'))">true</IsTest>
<IsPackable Condition="'$(IsTest)' == 'true' OR '$(InTestFolder)' == 'true'">false</IsPackable>
<IsPublishable Condition="'$(IsTest)' == 'true' OR '$(InTestFolder)' == 'true'">false</IsPublishable>
</PropertyGroup>
<!-- Uses pretty xunit configuration -->
<ItemGroup Label="xUnit Configuration" Condition="Exists('$(MSBuildThisFileDirectory)\xunit.runner.json') AND $(IsTest)=='True'">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\xunit.runner.json" Link="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AdditionalFiles>
</ItemGroup>
<!-- Project internals are exposed to projects named $(Project).Tests by default -->
<ItemGroup Condition="@(InternalsVisibleToSuffix->Count()) == 0 AND @(InternalsVisibleTo->Count()) == 0">
<InternalsVisibleToSuffix Include=".Tests" />
</ItemGroup>
<PropertyGroup Label="Package">
<PackageId>$(RootNamespace)</PackageId>
<Company>Esentis</Company>
<Authors>George Leonidis</Authors>
<Copyright>© Esentis. All rights reserved.</Copyright>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryType>git</RepositoryType>
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB -->
<!-- This is useful if you generate files during the build -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup Label="Test Dependencies" Condition="'$(IsTest)'=='true'">
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Label="Nugets" Condition="'$(IsTest)' != 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="SerilogAnalyzer" Version="0.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="SmartanAlyzers.ExceptionAnalyzer" Version="1.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Label="SourceLink" Condition="$(IsPackable)">
<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0" PrivateAssets="All" />
<SourceLinkGitLabHost Include="git.kritikos.io" />
<SourceLinkGitHubHost Include="github.com" />
<SourceLinkBitBucketHost Include="bitbucket.org" />
</ItemGroup>
</Project>