-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
55 lines (48 loc) · 3.15 KB
/
Directory.Build.targets
File metadata and controls
55 lines (48 loc) · 3.15 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
<!--
This file is imported late in the build order. Use it to override properties
and define dependent properties.
Per-project Flowthru reference injection (PackageReference→ProjectReference swap,
Core/FUnit analyzer wiring, FUnit constants) is NOT handled here for projects
that explicitly import build/FlowthruInRepoSwap.props (and optionally
build/FlowthruFUnit.props). Those projects own their own swap logic.
The remaining unmigrated test projects under tests/ that don't import
FlowthruInRepoSwap.props (most of tests/core, tests/extensions, tests/misc) use
direct <ProjectReference> to Flowthru/Flowthru.Core in their csprojs and rely
on the Core/FUnit targets being imported here so that analyzers get registered.
This block is migration-scope only — it shrinks as more test projects adopt
FlowthruInRepoSwap.props.
-->
<Project>
<PropertyGroup>
<MSBuildProjectDirRelativePath>$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectDirectory)))</MSBuildProjectDirRelativePath>
<NodeModulesRelativePath>$([MSBuild]::MakeRelative($(MSBuildProjectDirectory), $(RepoRoot)))</NodeModulesRelativePath>
</PropertyGroup>
<!-- Determine whether this project already imports FlowthruInRepoSwap.props (in
which case the analyzer wiring is already handled by that file). We can't
inspect imports directly, so we set a marker property in FlowthruInRepoSwap
and check for it here. The check is conservative: if the marker is unset
(not migrated), we fall back to the legacy global Core/FUnit imports below. -->
<!-- Legacy fallback: register Core source generators for unmigrated tests/ projects
that still rely on global injection. Once all tests/ projects import
FlowthruInRepoSwap.props, this block can go away. -->
<Import Project="$(RepoRoot)src/core/Flowthru.Core/build/Flowthru.Core.targets"
Condition="$(MSBuildProjectDirRelativePath.StartsWith('tests')) AND
'$(FlowthruInRepoSwapImported)' != 'true' AND
Exists('$(RepoRoot)src/core/Flowthru.Core/build/Flowthru.Core.targets')" />
<Import Project="$(RepoRoot)src/core/Flowthru.FUnit/build/Flowthru.FUnit.targets"
Condition="$(MSBuildProjectDirRelativePath.StartsWith('tests')) AND
$(MSBuildProjectDirRelativePath.Contains('FUnit')) AND
'$(FlowthruInRepoSwapImported)' != 'true' AND
Exists('$(RepoRoot)src/core/Flowthru.FUnit/build/Flowthru.FUnit.targets')" />
<!--
Central coverage configuration: any project identified as a test project by
Microsoft.NET.Test.Sdk automatically uses coverlet.runsettings, regardless of
how dotnet test is invoked (IDE, CLI, or NX target). This removes the need to
pass collect and settings flags on every call site. Individual test projects
can override this by setting their own RunSettingsFilePath in PropertyGroup
(e.g., Flowthru.Tests.Examples uses a project-local runsettings file).
-->
<PropertyGroup Condition="'$(IsTestProject)' == 'true' AND '$(RunSettingsFilePath)' == ''">
<RunSettingsFilePath>$(RepoRoot)coverlet.runsettings</RunSettingsFilePath>
</PropertyGroup>
</Project>