-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathbuild2.proj
More file actions
586 lines (526 loc) · 26.7 KB
/
build2.proj
File metadata and controls
586 lines (526 loc) · 26.7 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
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Imports ========================================================= -->
<Import Project="src/Directory.Build.props" />
<!-- Build Parameters ================================================ -->
<!-- @TODO: Add a Help target that lists targets and these descriptions of the parameters -->
<PropertyGroup>
<!--
BuildNumber
Applies to: BuildMds*, PackMds
Description: Number that identifies the build.
For local developer builds, this does not need to be used. The developer
should either specify an entire package version override (via
PackageVersionMds, et. al.) or by omitting the package version.
For automated builds, this should always be specified instead of
a package version. Thus, the version base is controlled via source and the
build number is simply appended as a revision number.
Default value: [blank]
Example: 1234
-->
<!-- @TODO: Currently this is defaulted to 0 by Directory.Build.props, which is the same default used later on anyhow. -->
<BuildNumber Condition="'$(BuildNumber)' == ''" />
<BuildNumberArgument Condition="'$(BuildNumber)' != ''">
-p:BuildNumber=$(BuildNumber)
</BuildNumberArgument>
<!--
BuildSuffix
Aplies to: BuildMds*, PackMds
Description: Suffix to add at the end of the package version to indicate the generated
version is a pre-release.
For local developer builds, this does not need to be set. If a specific
package version is needed, specify PackageVersionMds. Otherwise, the
generated package version will eg, 1.2.3.dev.
For automated builds, this should only be specified on pre-release builds, ie
PR/CI pipeline runs. For official, production-ready builds, omit this field
and include a BuildNumber.
Default value: [blank]
Example: prbuild
-->
<BuildSuffix Condition="'$(BuildSuffix)' == ''" />
<BuildSuffixArgument Condition="'$(BuildSuffix)' != ''">
-p:BuildSuffix=$(BuildSuffix)
</BuildSuffixArgument>
<!--
Configuration
Applies to: All targets
Description: Which build configuration to build
Default value: Debug
Allowed values: Debug, Release
-->
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<!--
DotnetPath
Applies to: All targets
Description: Path to folder containing the `dotnet` binary. Override this if a specific
version (eg, x86) is required. Otherwise, this defaults to using the dotnet
binary in the PATH variable. The provided path should end with a `\` (or `/`)
character.
Default value: [blank]
Example: C:\x86\
-->
<DotnetPath Condition="'$(DotnetPath)' == ''" />
<!--
NugetPath
Applies to: PackMds
Description: Path to NuGet executable. Override if `nuget` is not included in the PATH
variable.
Default value: nuget
Example: C:\nuget\nuget.exe
-->
<NugetPath Condition="'$(NugetPath)' == ''">nuget</NugetPath>
<!--
PackBuild
Applies to: PackMds
Description: Whether the PackMds target should run BuildMds before packing. If true,
BuildMds will be called as a dependency of PackMds. If false, it will not.
For most developers, building immediately before packing is the norm, and
this functionality is added for convenience. However, for official builds,
binaries are signed between building and packing, so building immediately
before packing would clobber the signed binaries.
Default value: true
Allowed values: (true|false)
-->
<!--
@TODO: This is kinda hacky, ideally we can pack via dotnet pack, which will handle building,
and can thus be switched off by passing -no-build. However, we're not there because we need
to build multiple projects before packaging, and thus need to use nuget. So, until then we
will switch off dependency building dynamically building the target dependencies
-->
<PackBuild Condition="'$(PackBuild)' == ''">true</PackBuild>
<PackMdsDependsOn Condition="'$(PackBuild.ToLower())' == 'true'">BuildMds</PackMdsDependsOn>
<!--
PackageVersionAbstractions
Applies to: BuildMds, BuildMdsRef, BuildMdsUnix, BuildMdsWindows
PackMds
TestMds, TestMdsFunctional, TestMdsManual
Description: Specifies what version of the Microsoft.Data.SqlClient.Abstractions to use
when compiling MDS. If not specified, the version defined in
Directory.Packages.props is used. This argument only has effect if the
ReferenceType argument is set to "Package".
Default value: [blank]
Example: 1.0.1-dev2345
-->
<PackageVersionAbstractions Condition="'$(PackageVersionAbstractions)' == ''" />
<PackageVersionAbstractionsArgument Condition="'$(PackageVersionAbstractions)' != ''">
-p:AbstractionsPackageVersion=$(PackageVersionAbstractions)
</PackageVersionAbstractionsArgument>
<!--
PackageVersionLogging
Applies to: BuildMds, BuildMdsUnix, BuildMdsWindows
PackMds
TestMds, TestMdsFunctional, TestMdsManual
Description: Specifies what version of the Microsoft.Data.SqlClient.Internal.Logging to use
when compiling MDS. If not specified, the version defined in
Directory.Packages.props is used. This argument only has effect if the
ReferenceType argument is set to "Package".
Default value: [blank]
Example: 1.0.1-dev2345
-->
<PackageVersionLogging Condition="'$(PackageVersionLogging)' == ''" />
<PackageVersionLoggingArgument Condition="'$(PackageVersionLogging)' != ''">
-p:LoggingPackageVersion=$(PackageVersionLogging)
</PackageVersionLoggingArgument>
<!--
PackageVersionMds
Applies to: TestMdsFunctional, TestMdsManual (when ReferenceType is Package)
Description: Specifies what version of the Microsoft.Data.SqlClient package to run tests
against. If not specified, the version pinned in Directory.Packages.props
will be used.
Applies to: BuildMds*
Description: Specifies the version to assign to the MDS NuGet package and assembly files.
If this is not specified, the version defined in MdsVersions.props is used.
Applies to: PackMds
Description: Specifies the version to assign to the MDS NuGet package. If not specified,
the target will fail (@TODO).
Default value: [blank]
Example: 7.0.0-preview4
-->
<PackageVersionMds Condition="'$(PackageVersionMds)' == ''" />
<PackageVersionMdsArgument Condition="'$(PackageVersionMds)' != ''">
-p:MdsPackageVersion=$(PackageVersionMds)
</PackageVersionMdsArgument>
<!--
ReferenceType
Applies to: BuildMds, BuildMdsUnix, BuildMdsWindows
Description: Determines how to build MDS. If set to "Project", any cross-project
references (eg, Abstractions from MDS) will be made as project references. If
set to "Package", package references will be made instead. When running in
package mode, target versions can be specified via PackageVersion* build
parameters. If these are not provided, the central feed version will be used
instead (see Directory.Packages.props). When running in project mode, the
dependencies will be built automatically.
Applies to: TestMdsFunctional, TestMdsManual
Description: Determines whether to test against a project reference or a package version
of the test targets. Same description above applies.
Default value: Project
Allowed values: (Package|Project)
-->
<ReferenceType Condition="'$(ReferenceType)' == ''">Project</ReferenceType>
<ReferenceTypeArgument Condition="'$(ReferenceType.ToLower())' == 'package'">
-p:ReferenceType=Package
</ReferenceTypeArgument>
<!--
SigningKeyPath
Applies to: Build*
Description: Path to the key to use to strong name sign binaries. If omitted, binaries
will not be strong name signed.
Default value: [blank]
Example: C:\path\to\my\signing\key.snk
-->
<SigningKeyPath Condition="'$(SigningKeyPath)' == ''" />
<SigningKeyPathArgument Condition="'$(SigningKeyPath)' != ''">
-p:SigningKeyPath="$(SigningKeyPath)"
</SigningKeyPathArgument>
<!--
TestBlameTimeout
Applies to: Test* targets
Description: How long to wait on a test before timing it out. This will be fed to the
dotnet blame-hang-timeout argument. If 0 is specified, hang timeout will be
disabled. For more details and supported suffixes see:
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test-vstest#options
Default value: 10m
Allowed values: (time_expression|0)
-->
<TestBlameTimeout Condition="'$(TestBlameTimeout)' == ''">10m</TestBlameTimeout>
<TestBlameArgument Condition="'$(TestBlameTimeout)' != '0'">
--blame-hang
--blame-hang-dump-type full
--blame-hang-timeout $(TestBlameTimeout)
</TestBlameArgument>
<!--
TestCodeCoverage
Applies to: Test* targets
Description: Whether code coverage data should be collected during test target execution.
Default value: true
Allowed value: (true|false)
-->
<TestCodeCoverage Condition="'$(TestCodeCoverage)' == ''">true</TestCodeCoverage>
<TestCodeCoverageArgument Condition="'$(TestCodeCoverage.ToLower())' == 'true'">
--collect "Code coverage"
--settings "$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/CodeCoverage.runsettings"
</TestCodeCoverageArgument>
<!--
TestFilters
Applies to: Test* targets
Description: Filter to use to include or exclude any tests. If not specified, this defaults
to including all tests that are not in the category "failing" or "flaky". Use
"none" to disable filtering and run all tests in the target.
For more information see:
https://learn.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests
Default value: category!=failing&category!=flaky
Allowed values: (category_expression|none)
-->
<TestFilters Condition="'$(TestFilters)' == ''">category!=failing&category!=flaky</TestFilters>
<TestFilters Condition="'$(TestFilters.ToLower())' == 'none'" />
<TestFiltersArgument Condition="'$(TestFilters)' != ''">
--filter "$(TestFilters)"
</TestFiltersArgument>
<!--
TestFramework
Applies to: Test* targets
Description: Target framework moniker for the version of .NET to use to execute the
specified test target. If not specified, this defaults to running tests for
*all* framework versions supported for the project.
Default value: [blank]
Example: net462
-->
<TestFramework Condition="'$(TestFramework)' == ''" />
<TestFrameworkArgument Condition="'$(TestFramework)' != ''">-f $(TestFramework)</TestFrameworkArgument>
<!--
TestResultsFolderPath
Applies to: Test* targets
Description: Absolute path to directory where any test results should be dumped. If not
specified, this path will default to test_results in the root of the
repository.
Default value: $(REPO_ROOT)\test_results
Example: C:\my_test_results\my_extra_special_test_run_folder\
-->
<TestResultsFolderPath Condition="'$(TestResultsFolderPath)' == ''">$(RepoRoot)test_results</TestResultsFolderPath>
<!--
TestSet
Applies to: TestMdsManual target
Description: Used to select a set of tests to run from the MDS manual tests project. If not
specified, all tests will be executed.
Default value: [blank]
Allowed values: ([1][2][3][AE])
Examples: "1", "12", "AE", "12AE"
-->
<TestSet Condition="'$(TestSet)' == ''" />
<TestSetArgument Condition="'$(TestSet)' != ''">-p:TestSet="$(TestSet)"</TestSetArgument>
</PropertyGroup>
<!-- ================================================================= -->
<!-- Microsoft.Data.SqlClient Targets -->
<PropertyGroup>
<!-- Root for MDS projects -->
<MdsSrcRoot>$(RepoRoot)src/Microsoft.Data.SqlClient/</MdsSrcRoot>
<MdsArtifactRoot>$(RepoRoot)artifacts/Microsoft.Data.SqlClient/</MdsArtifactRoot>
<!-- Project Path -->
<MdsProjectPath>$(MdsSrcRoot)src/Microsoft.Data.SqlClient.csproj</MdsProjectPath>
<MdsRefProjectPath>$(MdsSrcRoot)ref/Microsoft.Data.SqlClient.csproj</MdsRefProjectPath>
<MdsNotSupportedProjectPath>$(MdsSrcRoot)notsupported/Microsoft.Data.SqlClient.csproj</MdsNotSupportedProjectPath>
<!-- Test Project Paths -->
<MdsFunctionalTestProjectPath>$(MdsSrcRoot)tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj</MdsFunctionalTestProjectPath>
<MdsManualTestProjectPath>$(MdsSrcRoot)tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj</MdsManualTestProjectPath>
<MdsUnitTestProjectPath>$(MdsSrcRoot)tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj</MdsUnitTestProjectPath>
<!-- Tools/Specs Paths -->
<MdsNuspecPath>$(RepoRoot)tools/specs/Microsoft.Data.SqlClient.nuspec</MdsNuspecPath>
<GenApiPath>$(RepoRoot)tools/GenAPI/Microsoft.DotNet.GenAPI/</GenApiPath>
<GenApiProjectPath>$(GenApiPath)Microsoft.DotNet.GenAPI.csproj</GenApiProjectPath>
</PropertyGroup>
<!-- Build MDS Targets =============================================== -->
<!-- BuildMds: Builds all binaries for MDS -->
<Target Name="BuildMds" DependsOnTargets="BuildMdsUnix;BuildMdsWindows;BuildMdsRef;BuildMdsNotSupported" />
<!--
BuildMdsNotSupported: Builds a version of the MDS assemblies that always throws
PlatformNotSupportedException. It generates the source for this using GenAPI which is built as
the first step of this target.
-->
<Target Name="BuildMdsNotSupported">
<PropertyGroup>
<DotnetCommand>
"$(DotnetPath)dotnet" build "$(GenApiProjectPath)"
-p:Configuration=$(Configuration)
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Building GenAPI project via command: '$(DotnetCommand)'"/>
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
<!-- Get the path to the GenAPI artifact -->
<ItemGroup>
<GenApiArtifactPath Include="$(GenApiPath)bin/$(Configuration)/**/Microsoft.DotNet.GenAPI.dll" />
</ItemGroup>
<PropertyGroup>
<DotnetCommand>
"$(DotnetPath)dotnet" build "$(MdsNotSupportedProjectPath)"
-p:Configuration=$(Configuration)
-p:GenApiPath="@(GenApiArtifactPath->'%(FullPath)')"
$(SigningKeyPathArgument)
<!-- Versioning arguments -->
$(BuildNumberArgument)
$(BuildSuffixArgument)
$(PackageVersionMdsArgument)
<!-- Reference Type Arguments -->
$(ReferenceTypeArgument)
$(PackageVersionAbstractionsArgument)
$(PackageVersionLoggingArgument)
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Building not supported binaries project via command: '$(DotnetCommand)'"/>
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>
<!-- BuildMdsRef: Builds the ref binaries project for MDS, which is OS-agnostic -->
<Target Name="BuildMdsRef">
<PropertyGroup>
<DotnetCommand>
"$(DotnetPath)dotnet" build $(MdsRefProjectPath)
-p:Configuration=$(Configuration)
$(SigningKeyPathArgument)
<!-- Versioning arguments -->
$(BuildNumberArgument)
$(BuildSuffixArgument)
$(PackageVersionMdsArgument)
<!-- Reference type arguments -->
$(ReferenceTypeArgument)
$(PackageVersionAbstractionsArgument)
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Building MDS ref binaries via command: $(DotnetCommand)"/>
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>
<!-- BuildMdsUnix: Builds all unix-specific MDS binaries -->
<Target Name="BuildMdsUnix">
<PropertyGroup>
<DotnetCommand>
"$(DotnetPath)dotnet" build $(MdsProjectPath)
-p:Configuration=$(Configuration)
-p:TargetOs=Unix
$(SigningKeyPathArgument)
<!-- Versioning arguments -->
$(BuildNumberArgument)
$(BuildSuffixArgument)
$(PackageVersionMdsArgument)
<!-- Reference Type Arguments -->
$(ReferenceTypeArgument)
$(PackageVersionAbstractionsArgument)
$(PackageVersionLoggingArgument)
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Building MDS for Unix via command: $(DotnetCommand)"/>
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>
<!-- BuildMdsWindows: Builds all windows-specific MDS binaries -->
<Target Name="BuildMdsWindows">
<PropertyGroup>
<DotnetCommand>
"$(DotnetPath)dotnet" build $(MdsProjectPath)
-p:Configuration=$(Configuration)
-p:TargetOs=Windows_NT
$(SigningKeyPathArgument)
<!-- Versioning Arguments -->
$(BuildNumberArgument)
$(BuildSuffixArgument)
$(PackageVersionMdsArgument)
<!-- Reference Type Arguments -->
$(ReferenceTypeArgument)
$(PackageVersionAbstractionsArgument)
$(PackageVersionLoggingArgument)
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Building MDS for Windows via command: $(DotnetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>
<!-- Pack MDS Target ===================================================== -->
<!--
PackMds: Packages MDS binaries into a NuGet package.
Because the MDS package depends on the "not supported" and ref projects, we can't use dotnet to
automatically build before packaging. Instead, we rely on target dependency to handle building
the same binaries that will be packaged.
-->
<Target Name="PackMds" DependsOnTargets="$(PackMdsDependsOn)">
<Error Text="PackageVersionAbstractions must be set!"
Condition="'$(PackageVersionAbstractions)' == ''" />
<Error Text="PackageVersionLogging must be set!"
Condition="'$(PackageVersionLogging)' == ''" />
<PropertyGroup>
<GitCommand>
git rev-parse HEAD
</GitCommand>
<!-- Convert more than one whitespace character into one space -->
<GitCommand>$([System.Text.RegularExpressions.Regex]::Replace($(GitCommand), "\s+", " "))</GitCommand>
</PropertyGroup>
<Message Text=">>> Fetching latest git commit hash via command: $(GitCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(GitCommand)">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitId" />
</Exec>
<!-- This is a bit hacky, and can be (@TODO:) removed once packaging is done w/o a nuspec from dotnet -->
<PropertyGroup>
<GetMdsPackageVersionCommand>
"$(DotnetPath)dotnet" msbuild "$(MdsProjectPath)"
-nologo
-verbosity:quiet
-getProperty:MdsPackageVersion
<!-- Versioning arguments -->
$(BuildNumberArgument)
$(BuildSuffixArgument)
$(PackageVersionMdsArgument)
</GetMdsPackageVersionCommand>
<!-- Convert more than one whitespace character into one space -->
<GetMdsPackageVersionCommand>$([System.Text.RegularExpressions.Regex]::Replace($(GetMdsPackageVersionCommand), "\s+", " "))</GetMdsPackageVersionCommand>
</PropertyGroup>
<Message Text=">>> Evaluating MDS package version via command: $(GetMdsPackageVersionCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(GetMdsPackageVersionCommand)">
<Output TaskParameter="ConsoleOutput" PropertyName="_EvaluatedMdsPackageVersion" />
</Exec>
<Error Text="Failed to evaluate MdsPackageVersion for PackMds."
Condition="'$(_EvaluatedMdsPackageVersion)' == ''" />
<PropertyGroup>
<_EvaluatedMdsPackageVersion>$([System.Text.RegularExpressions.Regex]::Replace($(_EvaluatedMdsPackageVersion), "\s", ""))</_EvaluatedMdsPackageVersion>
<CommitId>$([System.Text.RegularExpressions.Regex]::Replace($(CommitId), "\s", ""))</CommitId>
<NuGetCommand>
"$(NugetPath)" pack "$(MdsNuspecPath)"
-Symbols
-SymbolPackageFormat snupkg
-Version "$(_EvaluatedMdsPackageVersion)"
-OutputDirectory "$(MdsArtifactRoot)/$(ReferenceType)-$(Configuration)"
-properties "COMMITID=$(CommitId);Configuration=$(Configuration);ReferenceType=$(ReferenceType);AbstractionsPackageVersion=$(PackageVersionAbstractions);LoggingPackageVersion=$(PackageVersionLogging)"
</NuGetCommand>
<!-- Convert more than one whitespace character into one space -->
<NuGetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(NuGetCommand), "\s+", " "))</NuGetCommand>
</PropertyGroup>
<Message Text=">>> Packing MDS nuget via command: $(NuGetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(NuGetCommand)" />
</Target>
<!-- Test MDS Targets ==================================================== -->
<!-- TestMds: Runs all test projects for MDS -->
<Target Name="TestMds" DependsOnTargets="TestMdsFunctional;TestMdsManual;TestMdsUnit" />
<!-- TestMdsFunctional: Runs functional tests for MDS -->
<Target Name="TestMdsFunctional">
<!-- @TODO: Prevent from running in non-admin user mode -->
<PropertyGroup>
<LogFilePrefix>MdsFunctional-$(OS)</LogFilePrefix>
<LogFilePrefix Condition="'$(TestFramework)' != ''">$(LogFilePrefix)-$(TestFramework)</LogFilePrefix>
<DotnetCommand>
"$(DotnetPath)dotnet" test "$(MdsFunctionalTestProjectPath)"
-p:Configuration=$(Configuration)
$(TestBlameArgument)
$(TestCodeCoverageArgument)
$(TestFiltersArgument)
$(TestFrameworkArgument)
--results-directory "$(TestResultsFolderPath)"
--logger:"trx;LogFilePrefix=$(LogFilePrefix)"
<!-- Reference Type Arguments -->
$(ReferenceTypeArgument)
$(PackageVersionAbstractionsArgument)
$(PackageVersionLoggingArgument)
$(PackageVersionMdsArgument)
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Running functional tests for MDS via command: $(DotnetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>
<!-- TestMdsManual: Runs manual tests for MDS -->
<Target Name="TestMdsManual">
<PropertyGroup>
<LogFilePrefix>MdsManual-$(OS)</LogFilePrefix>
<LogFilePrefix Condition="'$(TestFramework)' != ''">$(LogFilePrefix)-$(TestFramework)</LogFilePrefix>
<LogFilePrefix Condition="'$(TestSet)' != ''">$(LogFilePrefix)-$(TestSet)</LogFilePrefix>
<DotnetCommand>
"$(DotnetPath)dotnet" test "$(MdsManualTestProjectPath)"
-p:Configuration=$(Configuration)
$(TestBlameArgument)
$(TestCodeCoverageArgument)
$(TestFiltersArgument)
$(TestFrameworkArgument)
$(TestSetArgument)
--results-directory "$(TestResultsFolderPath)"
--logger:"trx;LogFilePrefix=$(LogFilePrefix)"
<!-- Reference Type Arguments -->
$(ReferenceTypeArgument)
$(PackageVersionAbstractionsArgument)
$(PackageVersionLoggingArgument)
$(PackageVersionMdsArgument)
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Running manual tests for MDS via command: $(DotnetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>
<!-- TestMdsUnit: Runs unit tests for MDS -->
<Target Name="TestMdsUnit">
<PropertyGroup>
<!--
Note: This test exclusively uses project references, so neither ReferenceType nor any
package version arguments are specified in this command.
-->
<LogFilePrefix>MdsUnit-$(OS)</LogFilePrefix>
<LogFilePrefix Condition="'$(TestFramework)' != ''">$(LogFilePrefix)-$(TestFramework)</LogFilePrefix>
<DotnetCommand>
"$(DotnetPath)dotnet" test "$(MdsUnitTestProjectPath)"
-p:Configuration=$(Configuration)
$(TestBlameArgument)
$(TestCodeCoverageArgument)
$(TestFiltersArgument)
$(TestFrameworkArgument)
--results-directory "$(TestResultsFolderPath)"
--logger:"trx;LogFilePrefix=$(LogFilePrefix)"
</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Running unit tests for MDS via command: $(DotnetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>
</Project>