Skip to content

Commit a98d18c

Browse files
authored
Fix missing .xaml references (#11805)
I'm working on making the FastUpToDate check in Vs work for the Terminal project. This is one of a few PRs in this area. FastUpToDate lets vs check quickly determine that it doesn't need to do anything for a given project. However, a few of our projects don't produce all the right artifacts, or check too many things, and this eventually causes the `wapproj` to rebuild, EVERY TIME YOU F5 in VS. This second PR deals with some projects MYSTERIOUSLY depending on the `.xaml` files from `Terminal.Control`, even when they by all accounts shouldn't. TerminalSettingsModel ISN'T EVEN A XAML project, so I have no idea why it thinks it needs these xaml files. The TerminalAppLib project thinking it needs them - makes more sense, but is still confusing. Below are my verbatim notes, which led to the solution in this PR. ``` 34>------ Up-To-Date check: Project: Microsoft.Terminal.Settings.Model.Lib, Configuration: Debug x64 ------ 34>Project is not up-to-date: build output 'c:\users\migrie\dev\public\terminal\bin\x64\debug\microsoft.terminal.settings.model.lib\microsoft.terminal.control\searchboxcontrol.xaml' is missing ``` * Just copying the xaml files from `bin\x64\debug\microsoft.terminal.control\microsoft.terminal.control\*.xaml` to `bin\x64\debug\microsoft.terminal.settings.model.lib\microsoft.terminal.control` seemed to fix this. * the .xbfs were already there * It's very unclear why these were ever needed? They aren't used in the build for `Microsoft.Terminal.Settings.Model.Lib`. They aren't copied as a part of the build either - no .xaml files are copied at all in fact * [ ] Does TSE have these .xamls in it's output? * UPDATE: checking out main, and building again - ran into this again. WHY?? * Cleaned again, then built TerminalApp.vcxproj. File is no longer needed? nothing makes sense. * `obj\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsof.CA5CAD1A.tlog\Microsoft.Terminal.Settings.Model.Lib.write.1u.tlog`: ``` C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\SearchBoxControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TermControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TSFInputControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\SearchBoxControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TermControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TSFInputControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\SearchBoxControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TermControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TSFInputControl.xbf C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\SearchBoxControl.xaml C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TermControl.xaml C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TSFInputControl.xaml ``` From the build: ``` 18>Target _CopyOutOfDateSourceItemsToOutputDirectory: 18> Skipping target "_CopyOutOfDateSourceItemsToOutputDirectory" because all output files are up-to-date with respect to the input files. 18> Input files: 18> C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Control\Microsoft.Terminal.Control\SearchBoxControl.xbf 18> C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Control\Microsoft.Terminal.Control\TermControl.xbf 18> C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Control\Microsoft.Terminal.Control\TSFInputControl.xbf 18> C:\Users\migrie\dev\public\terminal\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\runtimes\win10-x64\native\Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png 18> Output files: 18> C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\SearchBoxControl.xbf 18> C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TermControl.xbf 18> C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.Terminal.Control\TSFInputControl.xbf 18> C:\Users\migrie\dev\public\terminal\bin\x64\Debug\Microsoft.Terminal.Settings.Model.Lib\Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png ``` * Hmm, `21>Project is not up-to-date: build output 'c:\users\migrie\dev\public\terminal\bin\x64\debug\terminalapplib\microsoft.terminal.control\searchboxcontrol.xaml' is missing` as well.
1 parent dc01926 commit a98d18c

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

src/cascadia/TerminalApp/TerminalAppLib.vcxproj

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,29 @@
318318
</ProjectReference>
319319
<!-- For whatever reason, we can't include the TerminalControl and
320320
TerminalSettings projects' winmds via project references. So we'll have to
321-
manually include the winmds as References below -->
321+
manually include the winmds as References below
322+
323+
BODGY: we do need to add a ProjectReference to TerminalControl.vcxproj,
324+
with Private=true, ReferenceOutputAssembly=false, so that Visual Studio's
325+
"Fast Up-to-date Check" will work with this project. If we don't, the Fast
326+
Up-to-date Check will look for the .xaml files from that project in our
327+
output, which won't actually be there.
328+
329+
We do still need to separately reference the winmds manually below, which is annoying.
330+
-->
331+
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\dll\TerminalControl.vcxproj">
332+
<!-- Private:true and ReferenceOutputAssembly:false, in combination with
333+
the manual reference to TerminalControl.winmd below make sure that this
334+
project will compile correct, and that we won't roll up the TermControl
335+
xbf's into the packaging project twice. -->
336+
<Private>true</Private>
337+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
338+
</ProjectReference>
339+
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj">
340+
<Private>true</Private>
341+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
342+
</ProjectReference>
343+
322344
</ItemGroup>
323345
<PropertyGroup>
324346
<!-- This is a hack to get the ARM64 CI build working. See

src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,29 @@
197197
<Project>{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE}</Project>
198198
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
199199
</ProjectReference>
200+
200201
<!-- For whatever reason, we can't include the TerminalControl and
201202
TerminalSettings projects' winmds via project references. So we'll have to
202-
manually include the winmds as References below -->
203+
manually include the winmds as References below
204+
205+
BODGY: we do need to add a ProjectReference to TerminalControl.vcxproj,
206+
with Private=true, ReferenceOutputAssembly=false, so that Visual Studio's
207+
"Fast Up-to-date Check" will work with this project. If we don't, the Fast
208+
Up-to-date Check will look for the .xaml files from that project in our
209+
output, which won't actually be there.
210+
211+
We do still need to separately reference the winmds manually below, which is annoying.
212+
-->
213+
214+
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\dll\TerminalControl.vcxproj">
215+
<!-- Private:true and ReferenceOutputAssembly:false, in combination with
216+
the manual reference to TerminalControl.winmd below make sure that this
217+
project will compile correct, and that we won't roll up the TermControl
218+
xbf's into the packaging project twice. -->
219+
<Private>true</Private>
220+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
221+
</ProjectReference>
222+
203223
</ItemGroup>
204224
<ItemGroup>
205225
<!-- Manually add references to each of our dependent winmds. Mark them as
@@ -266,4 +286,5 @@
266286
</Target>
267287
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
268288
<Import Project="..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets" Condition="Exists('..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" />
289+
269290
</Project>

src/cascadia/TerminalSettingsModel/dll/Microsoft.Terminal.Settings.Model.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</ProjectReference>
6666

6767
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\dll\TerminalControl.vcxproj">
68-
<!-- Private:false and ReferenceOutputAssembly:false, in combination with
68+
<!-- Private:true and ReferenceOutputAssembly:false, in combination with
6969
the manual reference to TerminalControl.winmd below make sure that this
7070
project will compile correct, and that we won't roll up the TermControl
7171
xbf's into the packaging project twice. -->

0 commit comments

Comments
 (0)