firegiant / HeatWaveSupport

Issues-only repository to report HeatWave bugs and feature requests to FireGiant
3 stars 0 forks source link

Custom platform not supported #17

Open iskiselev opened 1 year ago

iskiselev commented 1 year ago

HeatWave Version

0.9.3

Visual Studio Version

17.4.4

Repro Steps

  1. Open a solution and add new project of type "MSI Package (WiX v4)"
  2. On file menu click on Build -> Configuration Manager
  3. Click on the Platform down next to the installer project

Alterantively: Add <Platforms>Any;x64;x86;ARM64</Platforms> to PropertyGroup of installer project

Actual Result

No option "New" to add platform. List of platforms does not honor Platforms property of the project.

Expected Result

A way to add / edit list of used projects. At least honor list of platforms configured in project.

With WIX 3 I used custom platform "Any", that used to build for both x86/x64 platforms from one Build (similar to TargetFramewroks in .NET projects). It is still perfectly supported with command line build with something like:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Platform">
  <Target Name="_ComputeTargetPlatformItems">
    <ItemGroup>
      <_TargetPlatfrom Include="x86;x64" />
      <_InnerBuildProjects Include="$(MSBuildProjectFile)">
        <AdditionalProperties>Platform=%(_TargetPlatfrom.Identity)</AdditionalProperties>
      </_InnerBuildProjects>
    </ItemGroup>
  </Target>

  <Target Name="DispatchToInnerBuilds"
          DependsOnTargets="_ComputeTargetPlatformItems">
    <MSBuild Projects="@(_InnerBuildProjects)"
             Condition="'@(_InnerBuildProjects)' != '' "
             BuildInParallel="true" />
  </Target>

  <Target Name="Build" DependsOnTargets="DispatchToInnerBuilds" />
  <Target Name="Clean"
          DependsOnTargets="_ComputeTargetPlatformItems">
    <MSBuild Projects="@(_InnerBuildProjects)"
             Condition="'@(_InnerBuildProjects)' != '' "
             Targets="Clean"
             BuildInParallel="true" />
  </Target>
  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
</Project>

It is possible to use some other hacks to achieve the same (I could use something like <TargetPlatforms>x86;x64<TargetPlatforms> property to drive the same - but it will be less intuitive in VS, as platform for outer build will be selected to either x86/x64/arm64.

iskiselev commented 1 year ago

It is a little bit similar to #12.

iskiselev commented 1 year ago

For references: https://github.com/dotnet/project-system/blob/main/docs/configurations.md Platforms/Configurations properties used to define them in dotnet project-system.

FireGiantHelp commented 1 year ago

This issue does seem related to #12. We'll include this issue when addressing that backlog item.

PeterESoft commented 1 year ago

I found a workaround for this issue by adapting the installation file "FireGiant.HeatWave.DesignTime.targets": C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\FireGiant\HeatWave\FireGiant.HeatWave.DesignTime.targets Remove the lines: `

Debug;Release
<Platforms>x86;x64;ARM64</Platforms>

`

I think adding those properties only when no previous values are set might work then for everyone

FireGiantHelp commented 1 year ago

HeatWave v0.9.5 should now respect custom Configurations and Platforms properties defined in the .wixproj. Also, Configurations can be added and edited via HeatWave but Platforms only supports editing. We'll keep this issue open as we continue to investigate support for adding new Platforms.