Skip to content

Commit

Permalink
Merge pull request #19440 from unoplatform/dev/jela/single-startup-tfm
Browse files Browse the repository at this point in the history
fix(vs): Use single TFM build feature from VS
  • Loading branch information
jeromelaban authored Feb 4, 2025
2 parents b9a091e + e9b7e8d commit 6ad9bc1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 33 deletions.
1 change: 0 additions & 1 deletion build/nuget/uno.winui.single-project.targets
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
<ProjectCapability Include="XamarinStaticLaunchProfiles" Condition=" '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' &lt; '17.0' " />
<!-- Otherwise define LaunchProfilesGroupByPlatformFilters by default -->
<ProjectCapability Include="LaunchProfilesGroupByPlatformFilters" Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &gt;= '17.0' " />
<ProjectCapability Include="SingleTargetBuildForStartupProjects" Condition=" '$(EnableSingleTargetBuildForStartupProjects)' != 'false' " />

<ProjectCapability Include="UseMauiCore" />

Expand Down
4 changes: 0 additions & 4 deletions src/Uno.Sdk/Sdk/Sdk.props.buildschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@
"description": "Disables removing the Microsoft.WindowsDesktop.App from the runtime configuration file in the output layout. Uno relies on loading WPF dynamically by searching for the WPF assemblies in the .NET SDK install folder.",
"type": "bool"
},
"UnoDisableVSFilterTargetFrameworkWithDebuggerTarget": {
"description": "Disables restricting the number of active target frameworks used when building a head project.",
"type": "bool"
},
"DisableWinUI8857_Workaround": {
"description": "Disables the WinUI workaround for issue 8857.",
"helpUrl": "https://github.com/microsoft/microsoft-ui-xaml/issues/8857",
Expand Down
6 changes: 6 additions & 0 deletions src/Uno.Sdk/targets/Uno.ProjectCapabilities.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<ProjectCapability Include="WindowsXamlResourceDictionary"/>
<ProjectCapability Include="WindowsXamlUserControl"/>
<ProjectCapability Include="WindowsUniversalMultiViews"/>

<!--
Allow VS to start using a single TFM, instead of building all available TFMs when starting a debugging session
Note that this capability must be defined on all TFMs to be effectively enabled.
-->
<ProjectCapability Include="SingleTargetBuildForStartupProjects" Condition=" '$(EnableSingleTargetBuildForStartupProjects)' != 'false' " />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFrameworks)' != '' AND ( $(TargetFrameworks.Contains('-ios')) OR $(TargetFrameworks.Contains('-android')) OR $(TargetFrameworks.Contains('-catalyst')) )">
Expand Down
28 changes: 0 additions & 28 deletions src/Uno.Sdk/targets/Uno.SingleProject.VS.Build.targets
Original file line number Diff line number Diff line change
@@ -1,30 +1,2 @@
<Project>

<Target Name="_UnoFilterTargetFrameworkWithDebuggerTarget"
BeforeTargets="_SetBuildInnerTarget;_ComputeTargetFrameworkItems"
Condition="
'$(BuildingInsideVisualStudio)'=='true'
AND '$(UnoDisableVSFilterTargetFrameworkWithDebuggerTarget)' != 'true'
AND '$(IsImplicitlyTriggeredBuild)' == 'true'
AND '$(IsUnoHead)' == 'true'
AND '$(ExcludeRestorePackageImports)' != 'true' ">

<!--
This target is used to restrict the number of active target frameworks used when
building a head project. This current version uses $(_IsExecutable) in order to
allow for faster builds with the uno.templates `Server` project.
Filtering on `IsImplicitlyTriggeredBuild` implies that this target will be
executed only when the debugger command is used. An explicit build or rebuild
on the project will perform a full build.
This will be enhanced in the future to support class libraries as well.
-->

<PropertyGroup Condition=" '$(TargetFramework)'=='' AND '$(_SelectedTargetFramework)' != '' ">
<TargetFramework>$(_SelectedTargetFramework)</TargetFramework>
<TargetFrameworks>$(_SelectedTargetFramework)</TargetFrameworks>
</PropertyGroup>
</Target>

</Project>

0 comments on commit 6ad9bc1

Please sign in to comment.