|
2 | 2 | <Project Sdk="Microsoft.NET.Sdk"> |
3 | 3 | <PropertyGroup> |
4 | 4 | <TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks> |
| 5 | + <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">net6.0</TargetFrameworks> |
5 | 6 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
6 | 7 | <LangVersion>Latest</LangVersion> |
7 | 8 | <IsPackable>true</IsPackable> |
|
11 | 12 | <NoWarn>$(NoWarn);NU5127</NoWarn> |
12 | 13 | <EnableDefaultNoneItems>false</EnableDefaultNoneItems> |
13 | 14 | <RootNamespace>Microsoft.DotNet.Build.Tasks.Workloads</RootNamespace> |
| 15 | + |
| 16 | + <!-- |
| 17 | + Only include WiX-powered features when running a non-from-source build. (For example, the |
| 18 | + Microsoft build used to build .NET for Windows.) |
| 19 | +
|
| 20 | + This removes a dependency on prebuilt WiX binaries. The purpose of WiX is to produce Windows |
| 21 | + installers, and source-build doesn't run on Windows, so excluding WiX while building in |
| 22 | + source-build mode to remove the prebuilt dependency has no impact to available .NET features. |
| 23 | + --> |
| 24 | + <IncludeWiX Condition="'$(DotNetBuildFromSource)' != 'true'">true</IncludeWiX> |
14 | 25 | </PropertyGroup> |
15 | 26 |
|
16 | 27 | <ItemGroup> |
|
19 | 30 | <PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" /> |
20 | 31 | <PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" /> |
21 | 32 | <PackageReference Include="NuGet.Packaging" Version="$(NuGetVersion)" /> |
22 | | - <PackageReference Include="Wix" Version="3.11.2" /> |
23 | 33 | <PackageReference Include="Microsoft.NET.Sdk.WorkloadManifestReader" Version="$(MicrosoftNetSdkWorkloadManifestReaderVersion)" /> |
24 | | - <PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" Condition="'$(TargetFramework)' == 'net472'"/> |
| 34 | + <PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" Condition="'$(TargetFramework)' == 'net472'" /> |
25 | 35 | <PackageReference Include="Microsoft.Deployment.DotNet.Releases" Version="$(MicrosoftDeploymentDotNetReleasesVersion)" /> |
26 | 36 | </ItemGroup> |
27 | 37 |
|
28 | | - <ItemGroup> |
| 38 | + <ItemGroup Condition="'$(IncludeWiX)' == 'true'"> |
| 39 | + <PackageReference Include="Wix" Version="3.11.2" /> |
| 40 | + </ItemGroup> |
| 41 | + |
| 42 | + <ItemGroup Condition="'$(IncludeWiX)' == 'true'"> |
29 | 43 | <Reference Include="$(WixInstallPath)\Microsoft.Deployment.Resources.dll" /> |
30 | 44 | <Reference Include="$(WixInstallPath)\Microsoft.Deployment.Compression.dll" /> |
31 | 45 | <Reference Include="$(WixInstallPath)\Microsoft.Deployment.Compression.Cab.dll" /> |
|
48 | 62 | <EmbeddedResource Remove="obj\**" /> |
49 | 63 | </ItemGroup> |
50 | 64 |
|
| 65 | + <ItemGroup Condition="'$(IncludeWiX)' != 'true'"> |
| 66 | + <Compile Remove="**\*.wix.cs" /> |
| 67 | + </ItemGroup> |
| 68 | + |
51 | 69 | <ItemGroup> |
52 | 70 | <EmbeddedResource Include="Misc\*.*" /> |
53 | 71 | <EmbeddedResource Include="MsiTemplate\*.wxs" /> |
|
0 commit comments