Skip to content

Commit 5f2a9f5

Browse files
lbussellMichaelSimonsdagood
authored
[release/6.0] Apply source build patches (backport) (#8384)
* Build Microsoft.DotNet.Build.Tasks.Workloads for net6.0 * workaround for hardcoded DotNetSharedFrameworkTaskDir * don't use obsolete managed SHA256 class * Disable Workloads WiX dependency in source-build This removes the prebuilt WiX dependency: #8014 The patch is temporary, pending upstream fix and dependency flow. Co-authored-by: Michael Simons <[email protected]> Co-authored-by: Davis Goodin <[email protected]>
1 parent b1d1532 commit 5f2a9f5

13 files changed

+25
-4
lines changed

src/Microsoft.DotNet.Build.Tasks.Workloads/src/Microsoft.DotNet.Build.Tasks.Workloads.csproj

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">net6.0</TargetFrameworks>
56
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
67
<LangVersion>Latest</LangVersion>
78
<IsPackable>true</IsPackable>
@@ -11,6 +12,16 @@
1112
<NoWarn>$(NoWarn);NU5127</NoWarn>
1213
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
1314
<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>
1425
</PropertyGroup>
1526

1627
<ItemGroup>
@@ -19,13 +30,16 @@
1930
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />
2031
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
2132
<PackageReference Include="NuGet.Packaging" Version="$(NuGetVersion)" />
22-
<PackageReference Include="Wix" Version="3.11.2" />
2333
<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'" />
2535
<PackageReference Include="Microsoft.Deployment.DotNet.Releases" Version="$(MicrosoftDeploymentDotNetReleasesVersion)" />
2636
</ItemGroup>
2737

28-
<ItemGroup>
38+
<ItemGroup Condition="'$(IncludeWiX)' == 'true'">
39+
<PackageReference Include="Wix" Version="3.11.2" />
40+
</ItemGroup>
41+
42+
<ItemGroup Condition="'$(IncludeWiX)' == 'true'">
2943
<Reference Include="$(WixInstallPath)\Microsoft.Deployment.Resources.dll" />
3044
<Reference Include="$(WixInstallPath)\Microsoft.Deployment.Compression.dll" />
3145
<Reference Include="$(WixInstallPath)\Microsoft.Deployment.Compression.Cab.dll" />
@@ -48,6 +62,10 @@
4862
<EmbeddedResource Remove="obj\**" />
4963
</ItemGroup>
5064

65+
<ItemGroup Condition="'$(IncludeWiX)' != 'true'">
66+
<Compile Remove="**\*.wix.cs" />
67+
</ItemGroup>
68+
5169
<ItemGroup>
5270
<EmbeddedResource Include="Misc\*.*" />
5371
<EmbeddedResource Include="MsiTemplate\*.wxs" />

0 commit comments

Comments
 (0)