forked from bradygaster/squad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
64 lines (61 loc) · 4.2 KB
/
Copy pathDirectory.Build.props
File metadata and controls
64 lines (61 loc) · 4.2 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
<Project>
<!--
Repo-wide MSBuild defaults for the Crew.Agents.AI .NET package (src/Crew.Agents.AI,
test/Crew.Agents.AI.Tests, src/Crew.Agents.AI/samples/Crew.Agents.AI.Sample).
This file currently only exists to fix Copilot CLI native-payload propagation; see
below. It applies to every project in the repo, but today those three are the only
.csproj files that exist.
-->
<PropertyGroup>
<!--
Single source of truth for the GitHub.Copilot.SDK version Crew.Agents.AI targets.
Crew.Agents.AI.csproj's PackageReference uses this value, and the override right
below keeps the Microsoft.Agents.AI.GitHub.Copilot native-payload bridge in sync
with it, so bumping this one property is enough to move both together.
-->
<CrewCopilotSdkVersion>1.0.8</CrewCopilotSdkVersion>
<!--
Why this override is required:
Microsoft.Agents.AI.GitHub.Copilot ships GitHub.Copilot.SDK's CLI-download build/
targets to transitive consumers via a buildTransitive/ bridge file
(Microsoft.Agents.AI.GitHub.Copilot.targets), because GitHub.Copilot.SDK itself only
ships those targets under build/ (which NuGet auto-imports solely for projects with
a DIRECT PackageReference to it). That bridge file imports
"$(NuGetPackageRoot)/github.copilot.sdk/$(_MicrosoftAgentsAICopilotSdkVersion)/build/GitHub.Copilot.SDK.targets"
and, when $(_MicrosoftAgentsAICopilotSdkVersion) is unset, defaults it to the SDK
version the adapter itself was packed against, its nuspec's dependency FLOOR
(1.0.5 for Microsoft.Agents.AI.GitHub.Copilot 1.14.0-rc1), NOT the version this repo
actually depends on ($(CrewCopilotSdkVersion), i.e. 1.0.7). Left unset, any project
that pulls in the adapter WITHOUT a direct PackageReference to GitHub.Copilot.SDK
(test/Crew.Agents.AI.Tests, src/Crew.Agents.AI/samples/Crew.Agents.AI.Sample here,
and any real external NuGet consumer of Crew.Agents.AI) downloads and bundles the
OLDER Copilot CLI build pinned to SDK 1.0.5 (Copilot CLI 1.0.67) instead of the CLI
pinned to SDK 1.0.7 (Copilot CLI 1.0.71); verified against this repo's own CI logs
for PR #1519 (run 29856026557): "Build package" (src/Crew.Agents.AI, which DOES have
the direct PackageReference) downloaded CLI 1.0.71, while "Build tests" and
"Build sample" (no direct PackageReference) downloaded CLI 1.0.67, on both
ubuntu-latest and windows-latest.
Setting the property here (Directory.Build.props is imported before NuGet's
per-project generated props/targets) makes every project in this repo resolve the
SAME SDK version, and therefore the same native Copilot CLI/runtime.node payload,
whether or not it has a direct PackageReference to GitHub.Copilot.SDK. This is the
exact override contract Microsoft.Agents.AI.GitHub.Copilot.targets documents in its
own comments ("consumers may override the SDK version path by setting
$(_MicrosoftAgentsAICopilotSdkVersion) before this file is imported"), so it works
regardless of NuGet's props/targets import ordering between packages: if this file's
value is seen first, the adapter's own conditional default (guarded by
Condition="'$(_MicrosoftAgentsAICopilotSdkVersion)' == ''") never fires; if it is
seen after, Crew.Agents.AI's own packed buildTransitive/Crew.Agents.AI.props
(generated at pack time from this same property, see Crew.Agents.AI.csproj)
unconditionally overwrites it again for real external consumers.
Excluded for the Crew.Agents.AI project itself: it already gets the right SDK
version via its own direct PackageReference to GitHub.Copilot.SDK (whose build/
import happens unconditionally, ahead of the adapter's fallback), so setting the
override there too would just make NuGet import the SAME
github.copilot.sdk/$(CrewCopilotSdkVersion)/build/GitHub.Copilot.SDK.targets file
twice, and MSBuild warns (MSB4011) about the resulting harmless-but-noisy duplicate
import.
-->
<_MicrosoftAgentsAICopilotSdkVersion Condition="'$(MSBuildProjectName)' != 'Crew.Agents.AI'">$(CrewCopilotSdkVersion)</_MicrosoftAgentsAICopilotSdkVersion>
</PropertyGroup>
</Project>