-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectory.Build.targets
315 lines (264 loc) · 17.7 KB
/
Directory.Build.targets
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<Project>
<!-- import the non-default targets files -->
<Import Project="$(MSBuildCommunityTasksPath)\MSBuildTasks.Targets" />
<Import Project="$(ATAPUtilitiesBuildToolingTargetsPath)\ATAP.Utilities.BuildTooling.Targets" />
<!-- ItemGroup for automatically generating Designer files and embedding resources in an assembly -->
<!-- Attribution: https://stackoverflow.com/questions/46584499/how-to-add-a-glob-for-resx-files-for-new-sdk-csproj-file -->
<!-- ToDo: Make the Generator Value conditional, if run under VS, use PublicResXFileCodeGenerator or ResXFileCodeGenerator.
if not run under CS (for example dotnet build or dotnet msbuild, use resgen.exe)
-->
<ItemGroup>
<Resx Include="**\*.resx" />
<EmbeddedResource Include="**\*.resource" />
<!--
<Compile Include="**\*.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>$([System.String]::Copy('%(FileName)').Replace('.Designer', '.resx'))</DependentUpon>
</Compile>
-->
</ItemGroup>
<!-- It appears that there is no solution for building/embedding resources in the dotnet toolchain for V5.0-->
<!--
</ItemGroup>
<Target Name="Resources" BeforeTargets="Compile">
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="_TargetFrameworks = @(_TargetFrameworks -> '%(Identity)')" />
<ItemGroup>
<_TargetFrameworks Include="$(TargetFrameworks.Split(';'))" />
</ItemGroup>
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="_TargetFrameworks = @(_TargetFrameworks -> '%(Identity)')" />
<ItemGroup>
<_IntermediateOutputPathPlusTargetFramework Include="@(_TargetFrameworks -> '$(IntermediateOutputPath)%(Identity)')" />
</ItemGroup>
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="testStr = 'testStr'" />
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="testStrReplace = $([System.String]::Copy('testStr').Replace('test','replace'))" />
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="_IntermediateOutputPathPlusTargetFramework = @(_IntermediateOutputPathPlusTargetFramework->'%(Identity)')" />
-->
<!-- ToDo: Add Runtime Identifier -->
<!--
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="ListOfResxFiles = @(Resx)" />
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="ListOfDesignerFiles = @(Resx -> '%(Identity)')" />
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="ListOfDesignerFiles = @(Resx -> $([System.String]::Copy('%(Resx.Identity)').Replace('resx','Generated.cs'))" />
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="OutputResources = @(Resx->'$(IntermediateOutputPath)%(TargetFrameworks)%(FileName).resources')" />
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="OutputResources = @($([System.String]::Copy('%(Resx.Identity)').Replace('.resx', '.resource')))" />
<PropertyGroup>
<SingleResxFile>Resources/DebugMessages.resx</SingleResxFile>
<SingleResourceFile>Resources/ATAP.Services.GenerateProgram.DebugMessages.resources</SingleResourceFile>
<SingleStronglyTypedFilename>Resources/ATAP.Services.GenerateProgram.DebugMessages.GeneratedStronglyTypedFile.cs</SingleStronglyTypedFilename>
<StronglyTypedNamespace>ATAP.Services.GenerateProgram</StronglyTypedNamespace>
<StronglyTypedClassName>DebugMessages</StronglyTypedClassName>
</PropertyGroup>
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="SingleResxFile = $(SingleResxFile); SingleResourceFile = $(SingleResourceFile); SingleStronglyTypedFilename = $(SingleStronglyTypedFilename)" />
<GenerateResource Condition="Exists('$(SingleResxFile)')" Sources="$(SingleResxFile)" OutputResources="$(SingleResourceFile)" PublicClass="true" StronglyTypedLanguage="C#"
StronglyTypedNamespace = '$(StronglyTypedNamespace)'
StronglyTypedClassName = '$(StronglyTypedClassName)'
StronglyTypedFilename = '$(SingleStronglyTypedFilename)'
>
<Output TaskParameter="OutputResources" ItemName="Resources" />
<Output TaskParameter="FilesWritten" ItemName="FileWrites" />
</GenerateResource>
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="OutputResources = @(Resources)" />
<Message Condition="'$(ATAPBuildToolingConfiguration)'=='Debug'" Text="FilesWritten = @(FileWrites)" />
</Target>
-->
<!-- when creating Console programs or services, if they dynamically load Plugins, define where the Plugins subdirectory is located -->
<PropertyGroup>
<PluginsRelativeDir Condition="$(PluginsRelativeDir) == '' Or $(PluginsRelativeDir) == '*Undefined*'">Plugins\</PluginsRelativeDir>
<PluginsDir Condition="$(PluginsDir) == '' Or $(PluginsDir) == '*Undefined*'">$(OutputPath)$(PluginsRelativeDir)</PluginsDir>
</PropertyGroup>
<!-- Solution-wide, copy newer .json settings files that exist in the project directory into the output directory -->
<PropertyGroup>
<PrepareForRunDependsOn>$(PrepareForRunDependsOn);CopyJSONSettingsFilesToOutputDirectory</PrepareForRunDependsOn>
</PropertyGroup>
<ItemGroup>
<JsonSettingsFiles Include="*.json" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(%(Filename), '[Ss]ettings.*json$'))" />
</ItemGroup>
<Target Name="CopyJSONSettingsFilesToOutputDirectory">
<Copy SourceFiles="@(JsonSettingsFiles)" DestinationFolder="$(OutDir)" />
</Target>
<!-- Targets for multiframework and multiple Runtime Identifiers publishing courtesy of
this stackoverflow answer https://stackoverflow.com/questions/43947599/how-to-publish-for-all-target-frameworks
this GIST:https://gist.github.com/dasMulli/b14026437468ce4b56ef93e010f24a36
and this issue: https://github.com/dotnet/sdk/issues/9363
-->
<Target Name="PublishProjectForAllRIDsIfTargetFrameworkSet" Condition=" '$(TargetFramework)' != '' and '$(RuntimeIdentifiers)' != '' and '$(RuntimeIdentifier)' == '' ">
<ItemGroup>
<_PublishRuntimeIdentifier Include="$(RuntimeIdentifiers)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PublishAll" Properties="TargetFramework=$(TargetFramework);RuntimeIdentifier=%(_PublishRuntimeIdentifier.Identity)" />
</Target>
<Target Name="PublishProjectForAllFrameworksIfFrameworkUnset" Condition=" '$(TargetFramework)' == '' ">
<ItemGroup>
<_PublishFramework Include="$(TargetFrameworks)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PublishAll" Properties="TargetFramework=%(_PublishFramework.Identity)" />
</Target>
<Target Name="PublishAll" DependsOnTargets="PublishProjectIfFrameworkSet;PublishProjectForAllRIDsIfTargetFrameworkSet;PublishProjectForAllFrameworksIfFrameworkUnset" />
<Target Name="PublishProjectIfFrameworkSet" DependsOnTargets="Publish" Condition=" '$(TargetFramework)' != '' " />
<!-- Microsoft Source Link for every project -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- Include Roslyn Code Analysis for every project -->
<!-- FxCopAnalyzers package has been deprecated in favor of 'Microsoft.CodeAnalysis.NetAnalyzers', hence this is now commented out -->
<!--
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers"></PackageReference>
</ItemGroup>
-->
<!-- Centrally manage package versions for all NuGet package dependencies, courtesy of https://www.strathweb.com/2018/07/solution-wide-nuget-package-version-handling-with-msbuild-15/ -->
<ItemGroup>
<!--Stateless lightweight StateMachine library -->
<PackageReference Update="Stateless" Version="5.1.2" />
<!-- QuickGraph and its dependencies -->
<PackageReference Update="YC.QuickGraph" Version="3.7.4" />
<PackageReference Update="DotNet.Contracts" Version="1.10.20606.1" />
<!-- <PackageReference Update="FSharp.Core" Version="2.5.0" />
<PackageReference Update="FSharp.Core" Version="3.0.2" />-->
<PackageReference Update="FSharp.Core" Version="4.3.4" />
<PackageReference Update="FSharpx.Collections.Experimental" Version="2.1.3" />
<!-- Reactive Extensions -->
<PackageReference Update="System.Reactive" Version="5.0.0" />
<!-- Text-To-Speech (TTS) packages -->
<PackageReference Update="System.Speech" Version="5.0.0" />
<!-- ServiceStack -->
<PackageReference Update="ServiceStack" Version="5.12.0" />
<!-- ServiceStack serializers and dump utility -->
<PackageReference Update="ServiceStack.Text.EnumMemberSerializer" Version="3.0.0.50044" />
<PackageReference Update="ServiceStack.Text" Version="5.12.0" />
<PackageReference Update="ServiceStack.HttpClient" Version="5.12.0" />
<!-- ServiceStack ORMLite and SQLServer -->
<PackageReference Update="ServiceStack.OrmLite" Version="5.12.0" />
<PackageReference Update="ServiceStack.OrmLite.SqlServer" Version="5.12.0" />
<PackageReference Update="ServiceStack.OrmLite.MySQL" Version="5.12.0" />
<PackageReference Update="ServiceStack.OrmLite.Sqlite" Version="5.12.0" />
<PackageReference Update="ServiceStack.OrmLite.Core" Version="5.12.0" />
<PackageReference Update="ServiceStack.OrmLite.SqlServer.Core" Version="5.12.0" />
<PackageReference Update="ServiceStack.OrmLite.MySQL.Core" Version="5.12.0" />
<PackageReference Update="ServiceStack.OrmLite.Sqlite.Core" Version="5.12.0" />
<!-- Library of rich time and interval manipulation routines -->
<PackageReference Update="TimePeriodLibrary.NET" Version="2.1.1" />
<!-- Packages necessary to run the Net Core Generic Host and web server hosts Server -->
<PackageReference Update="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Binder" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.CommandLine" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Localization" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<!-- <PackageReference Update="Microsoft.AspNetCore.Hosting.Abstractions" Version="5.0.0" /> -->
<!-- Standalone reference to Microsoft.Extensions.DependencyInjection is used by unitTest projects-->
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<!-- alternate DI container used in UnitTest projects-->
<PackageReference Update="Ninject" Version="3.3.4" />
<PackageReference Update="Ninject.extensions.conventions" Version="3.3.0" />
<!-- Packages to add resilience policies to async and synchronous operations which may have transient exceptions -->
<PackageReference Update="Polly" Version="7.2.1" />
<PackageReference Update="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Update="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<!-- FileIO Extension to provide file and directory Globbing requires System.IO.Abstractions -->
<PackageReference Update="System.IO.Abstractions" Version="13.2.47" />
<!-- Packages to implement ETW logging of method entry, method exit, and exceptions -->
<PackageReference Update="MethodBoundaryAspect.Fody" Version="2.0.138" />
<!-- Package to implement the c# client library for the RabbitMQ message queue provider-->
<PackageReference Update="RabbitMQ.Client" Version="6.2.2" />
<!-- Task Parallel (TPL) Library-->
<PackageReference Update="System.Threading.Tasks.Dataflow" Version="5.0.0" />
<!-- The Automapper Package -->
<PackageReference Update="AutoMapper" Version="10.1.1" />
<!-- Packages used for custom build tasks -->
<PackageReference Update="Microsoft.Build.Framework" Version="16.8.0" />
<PackageReference Update="Microsoft.Build.Utilities.Core" Version="16.8.0" />
<!-- Roslyn Code Analyzers -->
<!-- FxCopAnalyzers package has been deprecated in favor of 'Microsoft.CodeAnalysis.NetAnalyzers', hence this is now commented out -->
<!--
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2"></PackageReference>
-->
<!-- Microsoft Source Link -->
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<!-- Serilog packages -->
<PackageReference Update="Serilog" Version="2.10.0" />
<PackageReference Update="Serilog.Settings.Configuration" Version="3.3.0" />
<PackageReference Update="Serilog.Enrichers.Thread" Version="3.2.0-dev-00752" />
<PackageReference Update="Serilog.Extensions.Hosting" Version="4.1.2" />
<PackageReference Update="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Update="Serilog.Exceptions" Version="7.1.0" />
<PackageReference Update="Serilog.Sinks.Console" Version="4.0.0" />
<PackageReference Update="Serilog.Sinks.Debug" Version="2.0" />
<PackageReference Update="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Update="Serilog.Sinks.Seq" Version="5.0.0" />
<PackageReference Update="SerilogAnalyzer" Version="0.15.0" />
<!-- Packages to add Serilog and SEQ as Microsoft.Extensions.Logging providers -->
<PackageReference Update="Serilog.Extensions.Hosting" Version="4.1.2" />
<PackageReference Update="Seq.Extensions.Logging" Version="6.0.0" />
<!-- Package to ease spawning of and communications with processes -->
<PackageReference Update="MedallionShell" Version="1.6.2" />
<!-- Package to use real-world Units of Measure -->
<PackageReference Update="UnitsNet" Version="4.77.0" />
<!-- Package to extend Microsoft.Extensions.DependencyInjection with Scan and Decorate methods -->
<PackageReference Update="Scrutor" Version="3.3.0" />
<!-- Packages to add xUnit Testing providers and extensions -->
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Update="FluentAssertions" Version="6.2.0" />
<PackageReference Update="Moq" Version="4.16.1" />
<PackageReference Update="Xunit.DependencyInjection" Version="7.1.0" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.console" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Update="coverlet.collector" Version="3.1.0" />
<!-- Packages to add xUnit Testing dotnet tool -->
<DotNetCliToolReference Update="dotnet-xunit" Version="2.3.1" />
<!-- To Be Sorted -->
<PackageReference Update="NLog" Version="4.7.0" />
<PackageReference Update="NLog.Config" Version="4.7.0" />
<!-- Dynamic Types -->
<PackageReference Update="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Update="System.Dynamic.Runtime" Version="4.3.0" />
<!-- DocFX package -->
<PackageReference Update="docfx" Version="2.56.5" />
<!-- Packages to play with CSharpSyntaxTree -->
<PackageReference Update="Microsoft.CodeAnalysis.Common" Version="3.5.0" />
</ItemGroup>
<!-- The Serializer Libraries available versions are highly dependent on the target framework being used (See also ServiceStack.Text) -->
<!-- https://docs.microsoft.com/en-us/answers/questions/65502/which-net-framework-needed-to-use-systemtextjson.html -->
<!-- The regex should match net472, net48, netstandard, netcore, nad net5.0, but something is wrong.this workaround always matches-->
<PropertyGroup>
<tfr><![CDATA[^(net)]]></tfr>
</PropertyGroup>
<ItemGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(TargetFramework), '(net|net472|standard|core|net[56])'))">
<!-- V 5.0.0 supports framework 4.7.2 and later -->
<PackageReference Update="System.Text.Json" Version="5.0.0" />
</ItemGroup>
<!-- This item group is for package versions specific to .Net Standard or Core -->
<ItemGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(TargetFramework), '(standard|core|net[56])'))">
<!-- Immutable Collestionsfor .Net Core-->
<PackageReference Update="System.Collections.Immutable" Version="5.0.0" />
<!-- The Serializer Libraries available (See also ServiceStack.Text) -->
<PackageReference Update="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<!-- This item group is for package versions specific to .Net Desktop -->
<ItemGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(TargetFramework), '^net4'))">
<!-- Immutable Collestions for .Net desktop-->
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<!-- The Serializer Libraries available (See also ServiceStack.Text) -->
<PackageReference Update="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<!-- This item group is for package versions specific to .Net Core and Net 5.0 -->
<ItemGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(TargetFramework), '^(core|net[56])'))">
<!-- Plugin Framework -->
<PackageReference Update="McMaster.NETCore.Plugins" Version="1.3.1" />
</ItemGroup>
<!-- Include Documentation generation for every project, but only when built with Net47, as docfx 2.51.2 is only supported on net47 -->
<!--
<ItemGroup Condition="$(TargetFramework.Contains('net47'))>
<PackageReference Include="docfx" />
<Folder Include="Documentation\" />
<PackageReference Update="docfx" Version="2.51.2" />
</ItemGroup>
-->
</Project>