Files
PowerToys/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.Branding.props
Gordon Lam 9aca6d136f Revert "Revert commit" - Using centralized package management for vcxproj (#44289)
Reverts microsoft/PowerToys#44208
Basically enable back: https://github.com/microsoft/PowerToys/pull/43920

the core change is adding this new Target to ensure when "building in
Visual Studio", it will restore the nuget package first for vcxproj:
```xml
  <!-- Auto-restore NuGet for native vcxproj (PackageReference) when building inside VS -->
  <Target Name="EnsureNuGetRestoreForVcxproj" BeforeTargets="PrepareForBuild" Condition="
            '$(BuildingInsideVisualStudio)' == 'true'
            and '$(DesignTimeBuild)' != 'true'
            and '$(RestoreInProgress)' != 'true'
            and '$(MSBuildProjectExtension)' == '.vcxproj'
            and '$(RestoreProjectStyle)' == 'PackageReference'
            and '$(MSBuildProjectExtensionsPath)' != ''
            and !Exists('$(MSBuildProjectExtensionsPath)project.assets.json')
          ">

    <Message Importance="normal" Text="NuGet assets missing for $(MSBuildProjectName); running Restore...; IntDir=$(IntDir); BaseIntermediateOutputPath=$(BaseIntermediateOutputPath)" />

    <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Restore" Properties="RestoreInProgress=true" BuildInParallel="false" />
  </Target>
```
2025-12-16 10:46:39 +08:00

45 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CmdPalAssetSuffix Condition="'$(CommandPaletteBranding)'=='Release'">Stable</CmdPalAssetSuffix>
<CmdPalAssetSuffix Condition="'$(CommandPaletteBranding)'=='Preview'">Stable</CmdPalAssetSuffix>
<CmdPalAssetSuffix Condition="'$(CommandPaletteBranding)'=='Canary'">Stable</CmdPalAssetSuffix>
<CmdPalAssetSuffix Condition="'$(CommandPaletteBranding)'=='' or '$(CommandPaletteBranding)'=='Dev'">Dev</CmdPalAssetSuffix>
</PropertyGroup>
<PropertyGroup Condition="'$(CommandPaletteBranding)'=='Release'">
<ApplicationIcon>Assets\Stable\icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(CommandPaletteBranding)'=='Preview'">
<ApplicationIcon>Assets\Stable\icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(CommandPaletteBranding)'=='Canary'">
<ApplicationIcon>Assets\Stable\icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(CommandPaletteBranding)'=='' or '$(CommandPaletteBranding)'=='Dev'">
<ApplicationIcon>Assets\Dev\icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<!-- Images -->
<Content Include=".\Assets\$(CmdPalAssetSuffix)\**\*">
<DeploymentContent>true</DeploymentContent>
<Link>Assets\%(RecursiveDir)%(FileName)%(Extension)</Link>
</Content>
</ItemGroup>
<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
<!-- In the future, when we actually want to support "preview" and "canary",
add a Package-Pre.appxmanifest, etc. -->
<AppxManifest Include="Package.appxmanifest" Condition="'$(CommandPaletteBranding)'=='Release'" />
<AppxManifest Include="Package.appxmanifest" Condition="'$(CommandPaletteBranding)'=='Preview'" />
<AppxManifest Include="Package.appxmanifest" Condition="'$(CommandPaletteBranding)'=='Canary'" />
<AppxManifest Include="Package-Dev.appxmanifest" Condition="'$(CommandPaletteBranding)'=='' or '$(CommandPaletteBranding)'=='Dev'" />
</ItemGroup>
</Project>