summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-10-12 22:01:55 -0700
committerRob Mensching <rob@firegiant.com>2022-10-14 20:13:50 -0700
commit07b3d459ea0a45cbef29b98d283edafbab26462a (patch)
tree1e834882038ba3862f8acb7b60e7a4bfaef793fd /src/internal
parent5567239a9411aac769a34f2c65b80a523a577ad7 (diff)
downloadwix-07b3d459ea0a45cbef29b98d283edafbab26462a.tar.gz
wix-07b3d459ea0a45cbef29b98d283edafbab26462a.tar.bz2
wix-07b3d459ea0a45cbef29b98d283edafbab26462a.zip
Normalize ToolsetTask implementation to call wix.exe and heat.exe
Share the ToolsetTask implementation that can find .NET Core and .NET Framework with multiple architectures. Fixes 6951
Diffstat (limited to '')
-rw-r--r--src/internal/SetBuildNumber/Directory.Packages.props.pp1
-rw-r--r--src/internal/WixToolset.BaseBuildTasks.Sources/BaseToolsetTask.cs (renamed from src/wix/WixToolset.BuildTasks/ToolsetTask.cs)9
-rw-r--r--src/internal/WixToolset.BaseBuildTasks.Sources/FileSearchHelperMethods.cs (renamed from src/wix/WixToolset.BuildTasks/FileSearchHelperMethods.cs)2
-rw-r--r--src/internal/WixToolset.BaseBuildTasks.Sources/WixCommandLineBuilder.cs (renamed from src/wix/WixToolset.BuildTasks/WixCommandLineBuilder.cs)2
-rw-r--r--src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj36
-rw-r--r--src/internal/internal.cmd2
-rw-r--r--src/internal/internal.sln22
-rw-r--r--src/internal/internal_t.proj1
8 files changed, 67 insertions, 8 deletions
diff --git a/src/internal/SetBuildNumber/Directory.Packages.props.pp b/src/internal/SetBuildNumber/Directory.Packages.props.pp
index d06990fe..e1df6f8e 100644
--- a/src/internal/SetBuildNumber/Directory.Packages.props.pp
+++ b/src/internal/SetBuildNumber/Directory.Packages.props.pp
@@ -8,6 +8,7 @@
8 8
9 <PackageVersion Include="WixBuildTools.TestSupport" Version="{packageversion}" /> 9 <PackageVersion Include="WixBuildTools.TestSupport" Version="{packageversion}" />
10 <PackageVersion Include="WixBuildTools.TestSupport.Native" Version="{packageversion}" /> 10 <PackageVersion Include="WixBuildTools.TestSupport.Native" Version="{packageversion}" />
11 <PackageVersion Include="WixToolset.BaseBuildTasks.Sources" Version="{packageversion}" />
11 12
12 <PackageVersion Include="WixToolset.DUtil" Version="{packageversion}" /> 13 <PackageVersion Include="WixToolset.DUtil" Version="{packageversion}" />
13 <PackageVersion Include="WixToolset.WcaUtil" Version="{packageversion}" /> 14 <PackageVersion Include="WixToolset.WcaUtil" Version="{packageversion}" />
diff --git a/src/wix/WixToolset.BuildTasks/ToolsetTask.cs b/src/internal/WixToolset.BaseBuildTasks.Sources/BaseToolsetTask.cs
index 3eee7625..d9e3b5e8 100644
--- a/src/wix/WixToolset.BuildTasks/ToolsetTask.cs
+++ b/src/internal/WixToolset.BaseBuildTasks.Sources/BaseToolsetTask.cs
@@ -1,13 +1,13 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixToolset.BuildTasks 3namespace WixToolset.BaseBuildTasks
4{ 4{
5 using System; 5 using System;
6 using System.IO; 6 using System.IO;
7 using System.Runtime.InteropServices; 7 using System.Runtime.InteropServices;
8 using Microsoft.Build.Utilities; 8 using Microsoft.Build.Utilities;
9 9
10 public abstract class ToolsetTask : ToolTask 10 public abstract class BaseToolsetTask : ToolTask
11 { 11 {
12 /// <summary> 12 /// <summary>
13 /// Gets or sets additional options that are appended the the tool command-line. 13 /// Gets or sets additional options that are appended the the tool command-line.
@@ -88,6 +88,7 @@ namespace WixToolset.BuildTasks
88 commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput); 88 commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput);
89 commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors); 89 commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors);
90 commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); 90 commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors);
91 commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions);
91 } 92 }
92 93
93 protected sealed override string GenerateResponseFileCommands() 94 protected sealed override string GenerateResponseFileCommands()
@@ -152,11 +153,11 @@ namespace WixToolset.BuildTasks
152 private string GetDefaultToolFullPath() 153 private string GetDefaultToolFullPath()
153 { 154 {
154#if NETCOREAPP 155#if NETCOREAPP
155 var thisTaskFolder = Path.GetDirectoryName(typeof(ToolsetTask).Assembly.Location); 156 var thisTaskFolder = Path.GetDirectoryName(typeof(BaseToolsetTask).Assembly.Location);
156 157
157 return Path.Combine(thisTaskFolder, this.ToolExe); 158 return Path.Combine(thisTaskFolder, this.ToolExe);
158#else 159#else
159 var thisTaskFolder = Path.GetDirectoryName(new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath); 160 var thisTaskFolder = Path.GetDirectoryName(new Uri(typeof(BaseToolsetTask).Assembly.CodeBase).AbsolutePath);
160 161
161 var archFolder = GetArchitectureFolder(thisTaskFolder); 162 var archFolder = GetArchitectureFolder(thisTaskFolder);
162 163
diff --git a/src/wix/WixToolset.BuildTasks/FileSearchHelperMethods.cs b/src/internal/WixToolset.BaseBuildTasks.Sources/FileSearchHelperMethods.cs
index 94ff8c67..442fedd6 100644
--- a/src/wix/WixToolset.BuildTasks/FileSearchHelperMethods.cs
+++ b/src/internal/WixToolset.BaseBuildTasks.Sources/FileSearchHelperMethods.cs
@@ -1,6 +1,6 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixToolset.BuildTasks 3namespace WixToolset.BaseBuildTasks
4{ 4{
5 using System; 5 using System;
6 using System.IO; 6 using System.IO;
diff --git a/src/wix/WixToolset.BuildTasks/WixCommandLineBuilder.cs b/src/internal/WixToolset.BaseBuildTasks.Sources/WixCommandLineBuilder.cs
index a979dbb0..152992dd 100644
--- a/src/wix/WixToolset.BuildTasks/WixCommandLineBuilder.cs
+++ b/src/internal/WixToolset.BaseBuildTasks.Sources/WixCommandLineBuilder.cs
@@ -1,6 +1,6 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixToolset.BuildTasks 3namespace WixToolset.BaseBuildTasks
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
diff --git a/src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj b/src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj
new file mode 100644
index 00000000..6ae5165e
--- /dev/null
+++ b/src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj
@@ -0,0 +1,36 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4<Project>
5 <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
6
7 <PropertyGroup>
8 <TargetFramework>netstandard2.0</TargetFramework>
9 <PackageDescription>WiX Toolset BuildTasks Foundation Sources</PackageDescription>
10 <IsPackable>true</IsPackable>
11 <EnableDefaultItems>false</EnableDefaultItems>
12 <IncludeBuildOutput>false</IncludeBuildOutput>
13 <ContentTargetFolders>contentFiles</ContentTargetFolders>
14 <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
15 <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
16 <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
17 <NoWarn>CS8021</NoWarn>
18 <NoBuild>true</NoBuild>
19 <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
20 <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
21 </PropertyGroup>
22
23 <ItemGroup>
24 <Compile Include="*.cs" Pack="true" PackagePath="$(ContentTargetFolders)\cs\netstandard2.0\$(PackageId)\%(RecursiveDir)" />
25 <EmbeddedResource Include="*.resx" Pack="true" PackagePath="$(ContentTargetFolders)\any\any\$(PackageId)\%(RecursiveDir)" />
26 </ItemGroup>
27
28 <ItemGroup>
29 <PackageReference Remove="@(PackageReference)" />
30 </ItemGroup>
31
32 <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
33
34 <Target Name="Compile" />
35 <Target Name="CopyFilesToOutputDirectory" />
36</Project>
diff --git a/src/internal/internal.cmd b/src/internal/internal.cmd
index 9380ce4e..32df26e9 100644
--- a/src/internal/internal.cmd
+++ b/src/internal/internal.cmd
@@ -33,8 +33,10 @@ msbuild internal_t.proj -p:Configuration=%_C% -nologo -warnaserror -bl:%_L%\inte
33@rd /s/q "..\..\build\internal" 2> nul 33@rd /s/q "..\..\build\internal" 2> nul
34@del "..\..\build\artifacts\WixBuildTools.TestSupport.*.nupkg" 2> nul 34@del "..\..\build\artifacts\WixBuildTools.TestSupport.*.nupkg" 2> nul
35@del "..\..\build\artifacts\WixBuildTools.TestSupport.Native.*.nupkg" 2> nul 35@del "..\..\build\artifacts\WixBuildTools.TestSupport.Native.*.nupkg" 2> nul
36@del "..\..\build\artifacts\WixToolset.BaseBuildTasks.Sources.*.nupkg" 2> nul
36@rd /s/q "%USERPROFILE%\.nuget\packages\wixbuildtools.testsupport" 2> nul 37@rd /s/q "%USERPROFILE%\.nuget\packages\wixbuildtools.testsupport" 2> nul
37@rd /s/q "%USERPROFILE%\.nuget\packages\wixbuildtools.testsupport.native" 2> nul 38@rd /s/q "%USERPROFILE%\.nuget\packages\wixbuildtools.testsupport.native" 2> nul
39@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.basebuildtasks.sources" 2> nul
38@exit /b 40@exit /b
39 41
40:end 42:end
diff --git a/src/internal/internal.sln b/src/internal/internal.sln
index 9d4fe69f..fe36efbe 100644
--- a/src/internal/internal.sln
+++ b/src/internal/internal.sln
@@ -1,12 +1,14 @@
1 1
2Microsoft Visual Studio Solution File, Format Version 12.00 2Microsoft Visual Studio Solution File, Format Version 12.00
3# Visual Studio Version 16 3# Visual Studio Version 17
4VisualStudioVersion = 16.6.30114.105 4VisualStudioVersion = 17.3.32929.385
5MinimumVisualStudioVersion = 10.0.40219.1 5MinimumVisualStudioVersion = 10.0.40219.1
6Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixBuildTools.TestSupport", "WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj", "{8E082709-7355-41D5-AF86-6BBF9C89BDD7}" 6Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixBuildTools.TestSupport", "WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj", "{8E082709-7355-41D5-AF86-6BBF9C89BDD7}"
7EndProject 7EndProject
8Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WixBuildTools.TestSupport.Native", "WixBuildTools.TestSupport.Native\WixBuildTools.TestSupport.Native.vcxproj", "{95BABD97-FBDB-453A-AF8A-FA031A07B599}" 8Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WixBuildTools.TestSupport.Native", "WixBuildTools.TestSupport.Native\WixBuildTools.TestSupport.Native.vcxproj", "{95BABD97-FBDB-453A-AF8A-FA031A07B599}"
9EndProject 9EndProject
10Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.BaseBuildTasks.Sources", "WixToolset.BaseBuildTasks.Sources\WixToolset.BaseBuildTasks.Sources.csproj", "{6B654490-AB0D-4F94-B564-DAA80044D5A3}"
11EndProject
10Global 12Global
11 GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 Debug|Any CPU = Debug|Any CPU 14 Debug|Any CPU = Debug|Any CPU
@@ -47,6 +49,22 @@ Global
47 {95BABD97-FBDB-453A-AF8A-FA031A07B599}.Release|x64.ActiveCfg = Release|Win32 49 {95BABD97-FBDB-453A-AF8A-FA031A07B599}.Release|x64.ActiveCfg = Release|Win32
48 {95BABD97-FBDB-453A-AF8A-FA031A07B599}.Release|x86.ActiveCfg = Release|Win32 50 {95BABD97-FBDB-453A-AF8A-FA031A07B599}.Release|x86.ActiveCfg = Release|Win32
49 {95BABD97-FBDB-453A-AF8A-FA031A07B599}.Release|x86.Build.0 = Release|Win32 51 {95BABD97-FBDB-453A-AF8A-FA031A07B599}.Release|x86.Build.0 = Release|Win32
52 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
54 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|ARM64.ActiveCfg = Debug|Any CPU
55 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|ARM64.Build.0 = Debug|Any CPU
56 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|x64.ActiveCfg = Debug|Any CPU
57 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|x64.Build.0 = Debug|Any CPU
58 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|x86.ActiveCfg = Debug|Any CPU
59 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Debug|x86.Build.0 = Debug|Any CPU
60 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
61 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|Any CPU.Build.0 = Release|Any CPU
62 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|ARM64.ActiveCfg = Release|Any CPU
63 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|ARM64.Build.0 = Release|Any CPU
64 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|x64.ActiveCfg = Release|Any CPU
65 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|x64.Build.0 = Release|Any CPU
66 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|x86.ActiveCfg = Release|Any CPU
67 {6B654490-AB0D-4F94-B564-DAA80044D5A3}.Release|x86.Build.0 = Release|Any CPU
50 EndGlobalSection 68 EndGlobalSection
51 GlobalSection(SolutionProperties) = preSolution 69 GlobalSection(SolutionProperties) = preSolution
52 HideSolutionNode = FALSE 70 HideSolutionNode = FALSE
diff --git a/src/internal/internal_t.proj b/src/internal/internal_t.proj
index fda67786..fc4956d2 100644
--- a/src/internal/internal_t.proj
+++ b/src/internal/internal_t.proj
@@ -1,5 +1,6 @@
1<Project Sdk="Microsoft.Build.Traversal"> 1<Project Sdk="Microsoft.Build.Traversal">
2 <ItemGroup> 2 <ItemGroup>
3 <ProjectReference Include="WixToolset.BaseBuildTasks.Sources\WixToolset.BaseBuildTasks.Sources.csproj" Targets="Pack" />
3 <ProjectReference Include="WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj" Targets="Pack" /> 4 <ProjectReference Include="WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj" Targets="Pack" />
4 <ProjectReference Include="WixBuildTools.TestSupport.Native\WixBuildTools.TestSupport.Native.vcxproj" Properties="Platform=x86" /> 5 <ProjectReference Include="WixBuildTools.TestSupport.Native\WixBuildTools.TestSupport.Native.vcxproj" Properties="Platform=x86" />
5 <ProjectReference Include="WixBuildTools.TestSupport.Native\WixBuildTools.TestSupport.Native.vcxproj" Properties="Platform=x64" /> 6 <ProjectReference Include="WixBuildTools.TestSupport.Native\WixBuildTools.TestSupport.Native.vcxproj" Properties="Platform=x64" />