Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
171 lines (155 loc) · 9.46 KB
/
Copy pathDirectory.Build.props
File metadata and controls
171 lines (155 loc) · 9.46 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
<Project>
<!--
Centralize the Windows App SDK version so all projects stay in sync.
This uses the public Microsoft.WindowsAppSDK package from NuGet.
To install: dotnet restore (NuGet will pull the package automatically).
WindowsAppSDKSelfContained default is `false` — the framework, its
samples, and the perf benches all consume the *installed* Windows App
Runtime rather than bundling a copy of the runtime
into every build output. Projects that genuinely need a standalone
deployable set `WindowsAppSDKSelfContained=true` explicitly in their
own csproj — the user-facing scaffolded template, the AOT publish
proofs, and the in-process test hosts (Reactor.Tests,
Reactor.AppTests.Host, etc.) that load WinUI activation factories
before any bootstrapper has run.
bootstrap.ps1 installs that runtime, deriving its winget id from the
version below via tools/WindowsAppRuntimeId.ps1. Which package that is
depends on the SDK generation, so see that file rather than assuming a
shape here.
-->
<PropertyGroup>
<WindowsAppSDKVersion>2.2.0</WindowsAppSDKVersion>
<!--
Windows App SDK 2.0 split the monolithic Microsoft.WindowsAppSDK metapackage
into independently-versioned sub-packages. Framework-dependent projects
reference only Microsoft.WindowsAppSDK.WinUI (see the injection rule in
Directory.Build.targets); the WinUI sub-package tracks its own version, which
does NOT track the aggregate metapackage version (2.2.1 vs 2.2.0 — it is
neither equal to it nor a fixed offset from it; the 2.1.3 metapackage paired
with WinUI 2.1.0). The pairing is not derivable: read the metapackage's own
nuspec dependency on Microsoft.WindowsAppSDK.WinUI for the target version and
pin that exact value here. (spec 063 §3)
-->
<WindowsAppSDKWinUIVersion>2.2.1</WindowsAppSDKWinUIVersion>
<Win2DVersion>1.4.0</Win2DVersion>
<WindowsAppSDKSelfContained>false</WindowsAppSDKSelfContained>
<!--
Single source of truth for the current PUBLIC Microsoft.UI.Reactor package
version. This is the ONE literal to bump at release time (see
docs/contributing/release-runbook.md). One consumer reads it:
1. The doc pipeline's `compile` (tools/Reactor.DocPipeline,
VersionSource.ReadPublicVersion) substitutes it
for the {{reactorVersion}} token in docs/_pipeline/templates/*.md.dt,
so guide prose needs no per-release hand edits.
Keep it a real PUBLISHED public version. Every release is a prerelease, so
a floating range like 0.1.* matches nothing and fails restore (NU1103) —
pin a real version here and substitute it, never float.
-->
<ReactorPublicVersion>0.1.0-preview.18</ReactorPublicVersion>
</PropertyGroup>
<!--
Release builds treat warnings as errors, globally, for every project in the
repo. The CI PR-gate and the official release/pack pipeline both build with
`-c Release` (see .github/workflows/ci.yml + release.yml), so this makes any
compiler / analyzer / NuGet-restore warning a hard build break there while
keeping Debug (the inner developer loop) warning-tolerant for fast iteration.
Scoped to Configuration=Release only, and set in Directory.Build.props (an
early import) so an individual csproj can still opt out or add codes via the
usual TreatWarningsAsErrors / WarningsNotAsErrors / NoWarn knobs after this.
NuGet honors TreatWarningsAsErrors during restore, so a Release-configured
restore escalates NU-prefixed warnings too. Note the CI/release pipelines
restore separately (`dotnet restore` without `-c Release`) and then build with
`no-restore`, so NU-prefixed restore warnings only hard-fail on a combined
Release restore+build — keep package versions aligned (Directory.Packages.props).
-->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<!--
Run the IDE code-style analyzers during the build, not just in the editor.
Without this, IDE-prefixed rules never surface in `dotnet build` / CI no
matter what severity .editorconfig gives them. Only rules that .editorconfig
raises to `warning` (currently IDE0330, "prefer System.Threading.Lock",
issue #1350) affect the build; everything left at `suggestion` stays
IDE-only.
-->
<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<!--
Repository / project URL metadata for every packable project. NuGet.org's
Microsoft compliance policy (https://aka.ms/Microsoft-NuGet-Compliance)
REJECTS any Microsoft-signed package that is missing ProjectUrl — the push
fails with HTTP 400 at publish time, AFTER earlier packages in the same
push loop have already gone out (the loop is not atomic). Centralizing the
defaults here guarantees every current and future package id (framework,
Advanced, Devtools, …) inherits compliant metadata, so a
new package can never silently ship without it. Individual csprojs may still
override (the '== '' guard makes these defaults, not forced values).
-->
<PropertyGroup>
<PackageProjectUrl Condition="'$(PackageProjectUrl)' == ''">https://github.com/microsoft/microsoft-ui-reactor</PackageProjectUrl>
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/microsoft/microsoft-ui-reactor</RepositoryUrl>
<RepositoryType Condition="'$(RepositoryType)' == ''">git</RepositoryType>
</PropertyGroup>
<!--
SourceLink — lets consumers step into Reactor source while debugging. The
GitHub provider (Microsoft.SourceLink.GitHub) is bundled in the .NET SDK and
auto-imported for GitHub-hosted repos, so no PackageReference is needed (which
also avoids having to seed the package into the sealed-container internal feed).
These properties make the published .snupkg carry SourceLink metadata:
- PublishRepositoryUrl embeds RepositoryUrl in the package.
- EmbedUntrackedSources embeds generated/untracked sources (e.g. source-gen
output) so every PDB document resolves.
- ContinuousIntegrationBuild + DeterministicSourcePaths normalize source paths
to deterministic roots so PDBs don't leak local paths (e.g. E:\repos\...) and
match the committed source on GitHub. Gated to CI: turning them on locally
rewrites paths and breaks stepping into your own working-tree builds.
NOTE on '$(CI)': despite the name, this is the universal "automated build agent"
flag (set by GitHub Actions, ADO, etc.), NOT "the CI/PR-gate pipeline". BOTH the
PR-gate (OneBranch.CI.Reactor.yml) AND the release/pack pipeline
(OneBranch.Official.Reactor.yml) set CI=true — so the deterministic-path arm below
DOES run for the signed release packages. "CI" here means "not a developer's
interactive working-tree build", which is exactly when we want deterministic,
source-linked PDBs.
-->
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<PropertyGroup Condition="'$(CI)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<DeterministicSourcePaths>true</DeterministicSourcePaths>
</PropertyGroup>
<!--
In CI we never need the GitHub.Copilot.SDK native CLI (copilot.exe), which the
SDK's build targets fetch from the github/copilot-cli GitHub releases via an
unauthenticated MSBuild DownloadFile task. That download can fail in restricted CI
environments and cannot use an authenticated feed. The binary is purely a RUNTIME artifact: it is
not needed to compile the framework, pack the NuGets, or run unit tests, and CI
never executes a code path that starts it. Deriving the skip from $(CI) is reliable
because $(CI) is set as an explicit MSBuild global property by the build pipeline
and is honored in every project evaluation.
"Runtime artifact" is NOT the same as "sample-only", so do not reach for
CopilotSkipCliDownload=true as a local fix for a failing download. Three projects
reference the SDK, and the first is the shipped CLI, not a sample:
src/Reactor.Cli `mur loc translate` constructs
CopilotTranslationProvider (TranslateCommand.cs),
which does `new CopilotClient()` and StartAsync()
against the native binary.
samples/apps/widget-creator generation pipeline
samples/apps/demo-script-tool generation pipeline
Skipping the download locally therefore makes `mur loc translate` and both samples
fail at run time, with an error that points at the missing binary rather than at the
property that removed it. When the download itself is what is failing, redirect it
instead with the SDK's CopilotCliReleaseBaseUrl property (or the
COPILOT_CLI_DOWNLOAD_BASE_URL environment variable), or point CopilotCliBinaryPath
at a pre-downloaded binary. Anyone can still override CopilotSkipCliDownload
explicitly when they genuinely only need a compile.
-->
<PropertyGroup Condition="'$(CopilotSkipCliDownload)' == '' and '$(CI)' == 'true'">
<CopilotSkipCliDownload>true</CopilotSkipCliDownload>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)src\Reactor\build\Reactor.targets"
Condition="Exists('$(MSBuildThisFileDirectory)src\Reactor\build\Reactor.targets')" />
</Project>