|
87 | 87 | <TrimmerRootAssembly Include="GitHub.Copilot.SDK" RootMode="All" /> |
88 | 88 | </ItemGroup> |
89 | 89 |
|
90 | | - <!-- The SDK only maps standard RIDs (osx-arm64, etc.) to download the copilot CLI. |
91 | | - Mac Catalyst uses maccatalyst-arm64 which the SDK doesn't recognize, so the |
92 | | - download is silently skipped. Map it to the darwin-arm64 npm package. --> |
93 | | - <Target Name="_FixCopilotRidForMacCatalyst" BeforeTargets="_DownloadCopilotCli"> |
94 | | - <PropertyGroup Condition="'$(_CopilotPlatform)' == '' And $(_CopilotRid.StartsWith('maccatalyst-arm64'))"> |
95 | | - <_CopilotPlatform>darwin-arm64</_CopilotPlatform> |
96 | | - <_CopilotBinary>copilot</_CopilotBinary> |
97 | | - <_CopilotOriginalRid>$(_CopilotRid)</_CopilotOriginalRid> |
98 | | - <_CopilotRid>osx-arm64</_CopilotRid> |
99 | | - </PropertyGroup> |
100 | | - <PropertyGroup Condition="'$(_CopilotPlatform)' == '' And '$(_CopilotRid)' == 'maccatalyst-x64'"> |
101 | | - <_CopilotPlatform>darwin-x64</_CopilotPlatform> |
102 | | - <_CopilotBinary>copilot</_CopilotBinary> |
103 | | - <_CopilotOriginalRid>$(_CopilotRid)</_CopilotOriginalRid> |
104 | | - <_CopilotRid>osx-x64</_CopilotRid> |
105 | | - </PropertyGroup> |
106 | | - </Target> |
107 | | - |
108 | | - <!-- The SDK at runtime uses RuntimeInformation.RuntimeIdentifier (maccatalyst-arm64) |
109 | | - to locate the binary, so also copy it to that path. --> |
110 | | - <Target Name="_CopyCopilotCliForMacCatalyst" AfterTargets="_CopyCopilotCliToOutput" Condition="'$(_CopilotOriginalRid)' != ''"> |
| 90 | + <!-- SDK 0.1.26+ natively maps maccatalyst RIDs for CLI download (issue #454). |
| 91 | + The _FixCopilotRidForMacCatalyst workaround is no longer needed. --> |
| 92 | + |
| 93 | + <!-- The SDK (0.1.26+) now maps maccatalyst RIDs to osx RIDs for download. |
| 94 | + However, at runtime RuntimeInformation.RuntimeIdentifier returns maccatalyst-arm64, |
| 95 | + so the SDK looks for runtimes/maccatalyst-arm64/native/copilot. We still need to |
| 96 | + copy the binary to that path AND into the .app bundle's MonoBundle. --> |
| 97 | + <Target Name="_CopyCopilotCliForMacCatalyst" AfterTargets="_CopyCopilotCliToOutput" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst' And '$(_CopilotPlatform)' != ''"> |
111 | 98 | <PropertyGroup> |
112 | | - <_CopilotMacCatalystOutputDir>$(OutDir)runtimes/$(_CopilotOriginalRid)/native</_CopilotMacCatalystOutputDir> |
| 99 | + <_CopilotMacCatalystOutputDir>$(OutDir)runtimes/$(RuntimeIdentifier)/native</_CopilotMacCatalystOutputDir> |
113 | 100 | <_CopilotCacheDir>$(IntermediateOutputPath)copilot-cli/$(CopilotCliVersion)/$(_CopilotPlatform)</_CopilotCacheDir> |
114 | 101 | </PropertyGroup> |
115 | 102 | <MakeDir Directories="$(_CopilotMacCatalystOutputDir)" /> |
|
142 | 129 | <!-- Ensure the copilot CLI binary is included in the Mac Catalyst .app bundle. |
143 | 130 | MAUI flattens everything into MonoBundle, so runtimes/ paths don't work. |
144 | 131 | Copy the binary directly into the .app bundle's MonoBundle. --> |
145 | | - <Target Name="_IncludeCopilotCliInBundle" AfterTargets="Build" Condition="'$(_CopilotOriginalRid)' != ''"> |
| 132 | + <Target Name="_IncludeCopilotCliInBundle" AfterTargets="Build" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst' And '$(_CopilotPlatform)' != ''"> |
146 | 133 | <PropertyGroup> |
147 | 134 | <_CopilotCacheDir>$(IntermediateOutputPath)copilot-cli/$(CopilotCliVersion)/$(_CopilotPlatform)</_CopilotCacheDir> |
148 | 135 | <_AppBundleMonoBundle>$(OutDir)PolyPilot.app/Contents/MonoBundle</_AppBundleMonoBundle> |
|
0 commit comments