diff options
Diffstat (limited to 'src/tools/test')
21 files changed, 786 insertions, 0 deletions
diff --git a/src/tools/test/Directory.Build.props b/src/tools/test/Directory.Build.props new file mode 100644 index 00000000..a0c9a659 --- /dev/null +++ b/src/tools/test/Directory.Build.props | |||
| @@ -0,0 +1,10 @@ | |||
| 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="..\Directory.Build.props" /> | ||
| 6 | |||
| 7 | <PropertyGroup> | ||
| 8 | <OutputPath>$(OutputPath)test\$(ProjectName)</OutputPath> | ||
| 9 | </PropertyGroup> | ||
| 10 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.Heat/HeatRunner.cs b/src/tools/test/WixToolsetTest.Heat/HeatRunner.cs new file mode 100644 index 00000000..287698a9 --- /dev/null +++ b/src/tools/test/WixToolsetTest.Heat/HeatRunner.cs | |||
| @@ -0,0 +1,92 @@ | |||
| 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 | |||
| 3 | namespace WixToolsetTest.Harvesters | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using System.Threading; | ||
| 8 | using System.Threading.Tasks; | ||
| 9 | using WixToolset.Core; | ||
| 10 | using WixToolset.Core.Burn; | ||
| 11 | using WixToolset.Core.TestPackage; | ||
| 12 | using WixToolset.Data; | ||
| 13 | using WixToolset.Extensibility.Data; | ||
| 14 | using WixToolset.Extensibility.Services; | ||
| 15 | using WixToolset.Harvesters; | ||
| 16 | |||
| 17 | /// <summary> | ||
| 18 | /// Utility class to emulate heat.exe. | ||
| 19 | /// </summary> | ||
| 20 | public static class HeatRunner | ||
| 21 | { | ||
| 22 | /// <summary> | ||
| 23 | /// Emulates calling heat.exe. | ||
| 24 | /// </summary> | ||
| 25 | /// <param name="args"></param> | ||
| 26 | /// <param name="messages"></param> | ||
| 27 | /// <param name="warningsAsErrors"></param> | ||
| 28 | /// <returns></returns> | ||
| 29 | public static int Execute(string[] args, out List<Message> messages, bool warningsAsErrors = true) | ||
| 30 | { | ||
| 31 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | ||
| 32 | var task = Execute(args, serviceProvider, out messages, warningsAsErrors: warningsAsErrors); | ||
| 33 | return task.Result; | ||
| 34 | } | ||
| 35 | |||
| 36 | /// <summary> | ||
| 37 | /// Emulates calling wix.exe with standard backends. | ||
| 38 | /// This overload always treats warnings as errors. | ||
| 39 | /// </summary> | ||
| 40 | /// <param name="args"></param> | ||
| 41 | /// <returns></returns> | ||
| 42 | public static WixRunnerResult Execute(params string[] args) | ||
| 43 | { | ||
| 44 | return Execute(true, args); | ||
| 45 | } | ||
| 46 | |||
| 47 | /// <summary> | ||
| 48 | /// Emulates calling wix.exe with standard backends. | ||
| 49 | /// </summary> | ||
| 50 | /// <param name="warningsAsErrors"></param> | ||
| 51 | /// <param name="args"></param> | ||
| 52 | /// <returns></returns> | ||
| 53 | public static WixRunnerResult Execute(bool warningsAsErrors, params string[] args) | ||
| 54 | { | ||
| 55 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | ||
| 56 | var exitCode = Execute(args, serviceProvider, out var messages, warningsAsErrors: warningsAsErrors); | ||
| 57 | return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; | ||
| 58 | } | ||
| 59 | |||
| 60 | /// <summary> | ||
| 61 | /// Emulates calling wix.exe with standard backends. | ||
| 62 | /// </summary> | ||
| 63 | /// <param name="args"></param> | ||
| 64 | /// <param name="coreProvider"></param> | ||
| 65 | /// <param name="messages"></param> | ||
| 66 | /// <param name="warningsAsErrors"></param> | ||
| 67 | /// <returns></returns> | ||
| 68 | public static Task<int> Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List<Message> messages, bool warningsAsErrors = true) | ||
| 69 | { | ||
| 70 | coreProvider.AddBundleBackend(); | ||
| 71 | |||
| 72 | var listener = new TestMessageListener(); | ||
| 73 | |||
| 74 | messages = listener.Messages; | ||
| 75 | |||
| 76 | var messaging = coreProvider.GetService<IMessaging>(); | ||
| 77 | messaging.SetListener(listener); | ||
| 78 | |||
| 79 | if (warningsAsErrors) | ||
| 80 | { | ||
| 81 | messaging.WarningsAsError = true; | ||
| 82 | } | ||
| 83 | |||
| 84 | var arguments = coreProvider.GetService<ICommandLineArguments>(); | ||
| 85 | arguments.Populate(args); | ||
| 86 | |||
| 87 | var commandLine = HeatCommandLineFactory.CreateCommandLine(coreProvider); | ||
| 88 | var command = commandLine.ParseStandardCommandLine(arguments); | ||
| 89 | return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); | ||
| 90 | } | ||
| 91 | } | ||
| 92 | } | ||
diff --git a/src/tools/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj b/src/tools/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj new file mode 100644 index 00000000..73eb078c --- /dev/null +++ b/src/tools/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj | |||
| @@ -0,0 +1,20 @@ | |||
| 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 Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>netcoreapp3.1</TargetFramework> | ||
| 7 | <IsPackable>false</IsPackable> | ||
| 8 | <SignOutput>false</SignOutput> | ||
| 9 | </PropertyGroup> | ||
| 10 | |||
| 11 | <ItemGroup> | ||
| 12 | <PackageReference Include="WixBuildTools.TestSupport" /> | ||
| 13 | </ItemGroup> | ||
| 14 | |||
| 15 | <ItemGroup> | ||
| 16 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> | ||
| 17 | <PackageReference Include="xunit" /> | ||
| 18 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> | ||
| 19 | </ItemGroup> | ||
| 20 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs b/src/tools/test/WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs new file mode 100644 index 00000000..d54da457 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs | |||
| @@ -0,0 +1,410 @@ | |||
| 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 | |||
| 3 | namespace WixToolsetTest.Sdk | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.IO; | ||
| 7 | using System.Linq; | ||
| 8 | using WixBuildTools.TestSupport; | ||
| 9 | using WixToolset.Core.TestPackage; | ||
| 10 | using WixToolset.Data; | ||
| 11 | using WixToolset.Data.Symbols; | ||
| 12 | using Xunit; | ||
| 13 | |||
| 14 | public class MsbuildHeatFixture | ||
| 15 | { | ||
| 16 | public static readonly string HeatTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(MsbuildHeatFixture).Assembly.CodeBase).AbsolutePath), "..", "..", "..", "publish", "WixToolset.Heat", "build", "WixToolset.Heat.targets"); | ||
| 17 | |||
| 18 | public MsbuildHeatFixture() | ||
| 19 | { | ||
| 20 | EnsureWixSdkCached(); | ||
| 21 | } | ||
| 22 | |||
| 23 | [Theory] | ||
| 24 | [InlineData(BuildSystem.DotNetCoreSdk)] | ||
| 25 | [InlineData(BuildSystem.MSBuild)] | ||
| 26 | [InlineData(BuildSystem.MSBuild64)] | ||
| 27 | public void CanBuildHeatFilePackage(BuildSystem buildSystem) | ||
| 28 | { | ||
| 29 | var sourceFolder = TestData.Get("TestData", "HeatFilePackage"); | ||
| 30 | |||
| 31 | using (var fs = new DisposableFileSystem()) | ||
| 32 | { | ||
| 33 | var baseFolder = fs.GetFolder(); | ||
| 34 | var binFolder = Path.Combine(baseFolder, @"bin"); | ||
| 35 | var intermediateFolder = Path.Combine(baseFolder, @"obj\"); | ||
| 36 | var projectPath = Path.Combine(sourceFolder, "HeatFilePackage.wixproj"); | ||
| 37 | |||
| 38 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { | ||
| 39 | "-Restore", | ||
| 40 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "HeatTargetsPath", MsbuildHeatFixture.HeatTargetsPath), | ||
| 41 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "BaseIntermediateOutputPath", intermediateFolder), | ||
| 42 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "OutputPath", binFolder), | ||
| 43 | }); | ||
| 44 | result.AssertSuccess(); | ||
| 45 | |||
| 46 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); | ||
| 47 | Assert.Single(heatCommandLines); | ||
| 48 | |||
| 49 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | ||
| 50 | WixAssert.StringCollectionEmpty(warnings); | ||
| 51 | |||
| 52 | var generatedFilePath = Path.Combine(intermediateFolder, "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); | ||
| 53 | var generatedContents = File.ReadAllText(generatedFilePath); | ||
| 54 | var testXml = generatedContents.GetTestXml(); | ||
| 55 | WixAssert.StringEqual(@"<Wix>" + | ||
| 56 | "<Fragment>" + | ||
| 57 | "<DirectoryRef Id='INSTALLFOLDER'>" + | ||
| 58 | "<Component Id='HeatFilePackage.wixproj' Guid='*'>" + | ||
| 59 | "<File Id='HeatFilePackage.wixproj' KeyPath='yes' Source='SourceDir\\HeatFilePackage.wixproj' />" + | ||
| 60 | "</Component>" + | ||
| 61 | "</DirectoryRef>" + | ||
| 62 | "</Fragment>" + | ||
| 63 | "<Fragment>" + | ||
| 64 | "<ComponentGroup Id='ProductComponents'>" + | ||
| 65 | "<ComponentRef Id='HeatFilePackage.wixproj' />" + | ||
| 66 | "</ComponentGroup>" + | ||
| 67 | "</Fragment>" + | ||
| 68 | "</Wix>", testXml); | ||
| 69 | |||
| 70 | var pdbPath = Path.Combine(binFolder, "HeatFilePackage.wixpdb"); | ||
| 71 | var intermediate = Intermediate.Load(pdbPath); | ||
| 72 | var section = intermediate.Sections.Single(); | ||
| 73 | |||
| 74 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | ||
| 75 | WixAssert.StringEqual(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath()?.Path); | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 79 | [Theory] | ||
| 80 | [InlineData(BuildSystem.DotNetCoreSdk)] | ||
| 81 | [InlineData(BuildSystem.MSBuild)] | ||
| 82 | [InlineData(BuildSystem.MSBuild64)] | ||
| 83 | public void CanBuildHeatFileWithMultipleFilesPackage(BuildSystem buildSystem) | ||
| 84 | { | ||
| 85 | var sourceFolder = TestData.Get(@"TestData", "HeatFileMultipleFilesSameFileName"); | ||
| 86 | |||
| 87 | using (var fs = new DisposableFileSystem()) | ||
| 88 | { | ||
| 89 | var baseFolder = fs.GetFolder(); | ||
| 90 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
| 91 | var intermediateFolder = Path.Combine(baseFolder, @"obj\"); | ||
| 92 | var projectPath = Path.Combine(sourceFolder, "HeatFileMultipleFilesSameFileName.wixproj"); | ||
| 93 | |||
| 94 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { | ||
| 95 | "-Restore", | ||
| 96 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "HeatTargetsPath", MsbuildHeatFixture.HeatTargetsPath), | ||
| 97 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "BaseIntermediateOutputPath", intermediateFolder), | ||
| 98 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "OutputPath", binFolder), | ||
| 99 | }); | ||
| 100 | result.AssertSuccess(); | ||
| 101 | |||
| 102 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); | ||
| 103 | Assert.Equal(2, heatCommandLines.Count()); | ||
| 104 | |||
| 105 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | ||
| 106 | WixAssert.StringCollectionEmpty(warnings); | ||
| 107 | |||
| 108 | var generatedFilePath = Path.Combine(intermediateFolder, "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); | ||
| 109 | Assert.True(File.Exists(generatedFilePath)); | ||
| 110 | |||
| 111 | var generatedContents = File.ReadAllText(generatedFilePath); | ||
| 112 | var testXml = generatedContents.GetTestXml(); | ||
| 113 | WixAssert.StringEqual("<Wix>" + | ||
| 114 | "<Fragment>" + | ||
| 115 | "<DirectoryRef Id='INSTALLFOLDER'>" + | ||
| 116 | "<Component Id='MyProgram.txt' Guid='*'>" + | ||
| 117 | @"<File Id='MyProgram.txt' KeyPath='yes' Source='SourceDir\MyProgram.txt' />" + | ||
| 118 | "</Component>" + | ||
| 119 | "</DirectoryRef>" + | ||
| 120 | "</Fragment>" + | ||
| 121 | "<Fragment>" + | ||
| 122 | "<ComponentGroup Id='TxtProductComponents'>" + | ||
| 123 | "<ComponentRef Id='MyProgram.txt' />" + | ||
| 124 | "</ComponentGroup>" + | ||
| 125 | "</Fragment>" + | ||
| 126 | "</Wix>", testXml); | ||
| 127 | |||
| 128 | generatedFilePath = Path.Combine(intermediateFolder, "Release", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); | ||
| 129 | Assert.True(File.Exists(generatedFilePath)); | ||
| 130 | |||
| 131 | generatedContents = File.ReadAllText(generatedFilePath); | ||
| 132 | testXml = generatedContents.GetTestXml(); | ||
| 133 | WixAssert.StringEqual("<Wix>" + | ||
| 134 | "<Fragment>" + | ||
| 135 | "<DirectoryRef Id='INSTALLFOLDER'>" + | ||
| 136 | "<Component Id='MyProgram.json' Guid='*'>" + | ||
| 137 | @"<File Id='MyProgram.json' KeyPath='yes' Source='SourceDir\MyProgram.json' />" + | ||
| 138 | "</Component>" + | ||
| 139 | "</DirectoryRef>" + | ||
| 140 | "</Fragment>" + | ||
| 141 | "<Fragment>" + | ||
| 142 | "<ComponentGroup Id='JsonProductComponents'>" + | ||
| 143 | "<ComponentRef Id='MyProgram.json' />" + | ||
| 144 | "</ComponentGroup>" + | ||
| 145 | "</Fragment>" + | ||
| 146 | "</Wix>", testXml); | ||
| 147 | |||
| 148 | var pdbPath = Path.Combine(binFolder, "HeatFileMultipleFilesSameFileName.wixpdb"); | ||
| 149 | Assert.True(File.Exists(pdbPath)); | ||
| 150 | |||
| 151 | var intermediate = Intermediate.Load(pdbPath); | ||
| 152 | var section = intermediate.Sections.Single(); | ||
| 153 | |||
| 154 | var fileSymbols = section.Symbols.OfType<FileSymbol>().ToArray(); | ||
| 155 | WixAssert.StringEqual(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); | ||
| 156 | WixAssert.StringEqual(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); | ||
| 157 | } | ||
| 158 | } | ||
| 159 | |||
| 160 | [Theory] | ||
| 161 | [InlineData(BuildSystem.DotNetCoreSdk, true)] | ||
| 162 | [InlineData(BuildSystem.DotNetCoreSdk, false)] | ||
| 163 | [InlineData(BuildSystem.MSBuild, true)] | ||
| 164 | [InlineData(BuildSystem.MSBuild, false)] | ||
| 165 | [InlineData(BuildSystem.MSBuild64, true)] | ||
| 166 | [InlineData(BuildSystem.MSBuild64, false)] | ||
| 167 | public void CanBuildHeatProjectPreSdkStyle(BuildSystem buildSystem, bool useToolsVersion) | ||
| 168 | { | ||
| 169 | var sourceFolder = TestData.Get(@"TestData", "HeatProject"); | ||
| 170 | |||
| 171 | using (var fs = new TestDataFolderFileSystem()) | ||
| 172 | { | ||
| 173 | fs.Initialize(sourceFolder); | ||
| 174 | File.Copy("global.json", Path.Combine(fs.BaseFolder, "global.json")); | ||
| 175 | |||
| 176 | var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectPreSdkStyle"); | ||
| 177 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
| 178 | var intermediateFolder = Path.Combine(baseFolder, @"obj\"); | ||
| 179 | var projectPath = Path.Combine(baseFolder, "HeatProjectPreSdkStyle.wixproj"); | ||
| 180 | |||
| 181 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | ||
| 182 | { | ||
| 183 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "HeatTargetsPath", MsbuildHeatFixture.HeatTargetsPath), | ||
| 184 | useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, | ||
| 185 | }); | ||
| 186 | result.AssertSuccess(); | ||
| 187 | |||
| 188 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); | ||
| 189 | var heatCommandLine = Assert.Single(heatCommandLines); | ||
| 190 | |||
| 191 | if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) | ||
| 192 | { | ||
| 193 | Assert.Contains("-usetoolsversion", heatCommandLine); | ||
| 194 | } | ||
| 195 | else | ||
| 196 | { | ||
| 197 | Assert.DoesNotContain("-usetoolsversion", heatCommandLine); | ||
| 198 | } | ||
| 199 | |||
| 200 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | ||
| 201 | WixAssert.StringCollectionEmpty(warnings); | ||
| 202 | |||
| 203 | var generatedFilePath = Path.Combine(intermediateFolder, "Release", "_ToolsVersion4Cs.wxs"); | ||
| 204 | Assert.True(File.Exists(generatedFilePath)); | ||
| 205 | |||
| 206 | var generatedContents = File.ReadAllText(generatedFilePath); | ||
| 207 | var testXml = generatedContents.GetTestXml(); | ||
| 208 | WixAssert.StringEqual(@"<Wix>" + | ||
| 209 | "<Fragment>" + | ||
| 210 | "<DirectoryRef Id='ToolsVersion4Cs.Binaries'>" + | ||
| 211 | "<Component Id='ToolsVersion4Cs.Binaries.ToolsVersion4Cs.dll' Guid='*'>" + | ||
| 212 | "<File Id='ToolsVersion4Cs.Binaries.ToolsVersion4Cs.dll' Source='$(var.ToolsVersion4Cs.TargetDir)\\ToolsVersion4Cs.dll' />" + | ||
| 213 | "</Component>" + | ||
| 214 | "</DirectoryRef>" + | ||
| 215 | "</Fragment>" + | ||
| 216 | "<Fragment>" + | ||
| 217 | "<ComponentGroup Id='ToolsVersion4Cs.Binaries'>" + | ||
| 218 | "<ComponentRef Id='ToolsVersion4Cs.Binaries.ToolsVersion4Cs.dll' />" + | ||
| 219 | "</ComponentGroup>" + | ||
| 220 | "</Fragment>" + | ||
| 221 | "<Fragment>" + | ||
| 222 | "<DirectoryRef Id='ToolsVersion4Cs.Symbols'>" + | ||
| 223 | "<Component Id='ToolsVersion4Cs.Symbols.ToolsVersion4Cs.pdb' Guid='*'>" + | ||
| 224 | "<File Id='ToolsVersion4Cs.Symbols.ToolsVersion4Cs.pdb' Source='$(var.ToolsVersion4Cs.TargetDir)\\ToolsVersion4Cs.pdb' />" + | ||
| 225 | "</Component>" + | ||
| 226 | "</DirectoryRef>" + | ||
| 227 | "</Fragment>" + | ||
| 228 | "<Fragment>" + | ||
| 229 | "<ComponentGroup Id='ToolsVersion4Cs.Symbols'>" + | ||
| 230 | "<ComponentRef Id='ToolsVersion4Cs.Symbols.ToolsVersion4Cs.pdb' />" + | ||
| 231 | "</ComponentGroup>" + | ||
| 232 | "</Fragment>" + | ||
| 233 | "<Fragment>" + | ||
| 234 | "<DirectoryRef Id='ToolsVersion4Cs.Sources'>" + | ||
| 235 | "<Component Id='ToolsVersion4Cs.Sources.ToolsVersion4Cs.csproj' Guid='*'>" + | ||
| 236 | "<File Id='ToolsVersion4Cs.Sources.ToolsVersion4Cs.csproj' Source='$(var.ToolsVersion4Cs.ProjectDir)\\ToolsVersion4Cs.csproj' />" + | ||
| 237 | "</Component>" + | ||
| 238 | "<Directory Id='ToolsVersion4Cs.Sources.Properties' Name='Properties'>" + | ||
| 239 | "<Component Id='ToolsVersion4Cs.Sources.AssemblyInfo.cs' Guid='*'>" + | ||
| 240 | "<File Id='ToolsVersion4Cs.Sources.AssemblyInfo.cs' Source='$(var.ToolsVersion4Cs.ProjectDir)\\Properties\\AssemblyInfo.cs' />" + | ||
| 241 | "</Component>" + | ||
| 242 | "</Directory>" + | ||
| 243 | "</DirectoryRef>" + | ||
| 244 | "</Fragment>" + | ||
| 245 | "<Fragment>" + | ||
| 246 | "<ComponentGroup Id='ToolsVersion4Cs.Sources'>" + | ||
| 247 | "<ComponentRef Id='ToolsVersion4Cs.Sources.ToolsVersion4Cs.csproj' />" + | ||
| 248 | "<ComponentRef Id='ToolsVersion4Cs.Sources.AssemblyInfo.cs' />" + | ||
| 249 | "</ComponentGroup>" + | ||
| 250 | "</Fragment>" + | ||
| 251 | "<Fragment>" + | ||
| 252 | "<ComponentGroup Id='ToolsVersion4Cs.Content' />" + | ||
| 253 | "</Fragment>" + | ||
| 254 | "<Fragment>" + | ||
| 255 | "<ComponentGroup Id='ToolsVersion4Cs.Satellites' />" + | ||
| 256 | "</Fragment>" + | ||
| 257 | "<Fragment>" + | ||
| 258 | "<ComponentGroup Id='ToolsVersion4Cs.Documents' />" + | ||
| 259 | "</Fragment>" + | ||
| 260 | "</Wix>", testXml); | ||
| 261 | |||
| 262 | var pdbPath = Path.Combine(binFolder, "Release", "HeatProjectPreSdkStyle.wixpdb"); | ||
| 263 | Assert.True(File.Exists(pdbPath)); | ||
| 264 | |||
| 265 | var intermediate = Intermediate.Load(pdbPath); | ||
| 266 | var section = intermediate.Sections.Single(); | ||
| 267 | |||
| 268 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | ||
| 269 | WixAssert.StringEqual(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 273 | [Theory] | ||
| 274 | [InlineData(BuildSystem.DotNetCoreSdk, true)] | ||
| 275 | [InlineData(BuildSystem.DotNetCoreSdk, false)] | ||
| 276 | [InlineData(BuildSystem.MSBuild, true)] | ||
| 277 | [InlineData(BuildSystem.MSBuild, false)] | ||
| 278 | [InlineData(BuildSystem.MSBuild64, true)] | ||
| 279 | [InlineData(BuildSystem.MSBuild64, false)] | ||
| 280 | public void CanBuildHeatProjectSdkStyle(BuildSystem buildSystem, bool useToolsVersion) | ||
| 281 | { | ||
| 282 | var sourceFolder = TestData.Get(@"TestData\HeatProject"); | ||
| 283 | |||
| 284 | using (var fs = new TestDataFolderFileSystem()) | ||
| 285 | { | ||
| 286 | fs.Initialize(sourceFolder); | ||
| 287 | File.Copy("global.json", Path.Combine(fs.BaseFolder, "global.json")); | ||
| 288 | |||
| 289 | var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectSdkStyle"); | ||
| 290 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
| 291 | var intermediateFolder = Path.Combine(baseFolder, @"obj\"); | ||
| 292 | var projectPath = Path.Combine(fs.BaseFolder, "HeatProjectSdkStyle", "HeatProjectSdkStyle.wixproj"); | ||
| 293 | var referencedProjectPath = Path.Combine(fs.BaseFolder, "SdkStyleCs", "SdkStyleCs.csproj"); | ||
| 294 | |||
| 295 | var result = MsbuildUtilities.BuildProject(buildSystem, referencedProjectPath, new[] | ||
| 296 | { | ||
| 297 | "-t:restore", | ||
| 298 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "HeatTargetsPath", MsbuildHeatFixture.HeatTargetsPath), | ||
| 299 | }); | ||
| 300 | result.AssertSuccess(); | ||
| 301 | |||
| 302 | result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | ||
| 303 | { | ||
| 304 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "HeatTargetsPath", MsbuildHeatFixture.HeatTargetsPath), | ||
| 305 | useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, | ||
| 306 | }); | ||
| 307 | result.AssertSuccess(); | ||
| 308 | |||
| 309 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); | ||
| 310 | var heatCommandLine = Assert.Single(heatCommandLines); | ||
| 311 | |||
| 312 | if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) | ||
| 313 | { | ||
| 314 | Assert.Contains("-usetoolsversion", heatCommandLine); | ||
| 315 | } | ||
| 316 | else | ||
| 317 | { | ||
| 318 | Assert.DoesNotContain("-usetoolsversion", heatCommandLine); | ||
| 319 | } | ||
| 320 | |||
| 321 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | ||
| 322 | WixAssert.StringCollectionEmpty(warnings); | ||
| 323 | |||
| 324 | var generatedFilePath = Path.Combine(intermediateFolder, "Release", "_SdkStyleCs.wxs"); | ||
| 325 | Assert.True(File.Exists(generatedFilePath)); | ||
| 326 | |||
| 327 | var generatedContents = File.ReadAllText(generatedFilePath); | ||
| 328 | var testXml = generatedContents.GetTestXml(); | ||
| 329 | WixAssert.StringEqual(@"<Wix>" + | ||
| 330 | "<Fragment>" + | ||
| 331 | "<DirectoryRef Id='SdkStyleCs.Binaries'>" + | ||
| 332 | "<Component Id='SdkStyleCs.Binaries.SdkStyleCs.dll' Guid='*'>" + | ||
| 333 | "<File Id='SdkStyleCs.Binaries.SdkStyleCs.dll' Source='$(var.SdkStyleCs.TargetDir)\\SdkStyleCs.dll' />" + | ||
| 334 | "</Component>" + | ||
| 335 | "</DirectoryRef>" + | ||
| 336 | "</Fragment>" + | ||
| 337 | "<Fragment>" + | ||
| 338 | "<ComponentGroup Id='SdkStyleCs.Binaries'>" + | ||
| 339 | "<ComponentRef Id='SdkStyleCs.Binaries.SdkStyleCs.dll' />" + | ||
| 340 | "</ComponentGroup>" + | ||
| 341 | "</Fragment>" + | ||
| 342 | "<Fragment>" + | ||
| 343 | "<DirectoryRef Id='SdkStyleCs.Symbols'>" + | ||
| 344 | "<Component Id='SdkStyleCs.Symbols.SdkStyleCs.pdb' Guid='*'>" + | ||
| 345 | "<File Id='SdkStyleCs.Symbols.SdkStyleCs.pdb' Source='$(var.SdkStyleCs.TargetDir)\\SdkStyleCs.pdb' />" + | ||
| 346 | "</Component>" + | ||
| 347 | "</DirectoryRef>" + | ||
| 348 | "</Fragment>" + | ||
| 349 | "<Fragment>" + | ||
| 350 | "<ComponentGroup Id='SdkStyleCs.Symbols'>" + | ||
| 351 | "<ComponentRef Id='SdkStyleCs.Symbols.SdkStyleCs.pdb' />" + | ||
| 352 | "</ComponentGroup>" + | ||
| 353 | "</Fragment>" + | ||
| 354 | "<Fragment>" + | ||
| 355 | "<DirectoryRef Id='SdkStyleCs.Sources'>" + | ||
| 356 | "<Component Id='SdkStyleCs.Sources.SdkStyleCs.cs' Guid='*'>" + | ||
| 357 | "<File Id='SdkStyleCs.Sources.SdkStyleCs.cs' Source='$(var.SdkStyleCs.ProjectDir)\\SdkStyleCs.cs' />" + | ||
| 358 | "</Component>" + | ||
| 359 | "<Component Id='SdkStyleCs.Sources.SdkStyleCs.csproj' Guid='*'>" + | ||
| 360 | "<File Id='SdkStyleCs.Sources.SdkStyleCs.csproj' Source='$(var.SdkStyleCs.ProjectDir)\\SdkStyleCs.csproj' />" + | ||
| 361 | "</Component>" + | ||
| 362 | "</DirectoryRef>" + | ||
| 363 | "</Fragment>" + | ||
| 364 | "<Fragment>" + | ||
| 365 | "<ComponentGroup Id='SdkStyleCs.Sources'>" + | ||
| 366 | "<ComponentRef Id='SdkStyleCs.Sources.SdkStyleCs.cs' />" + | ||
| 367 | "<ComponentRef Id='SdkStyleCs.Sources.SdkStyleCs.csproj' />" + | ||
| 368 | "</ComponentGroup>" + | ||
| 369 | "</Fragment>" + | ||
| 370 | "<Fragment>" + | ||
| 371 | "<ComponentGroup Id='SdkStyleCs.Content' />" + | ||
| 372 | "</Fragment>" + | ||
| 373 | "<Fragment>" + | ||
| 374 | "<ComponentGroup Id='SdkStyleCs.Satellites' />" + | ||
| 375 | "</Fragment>" + | ||
| 376 | "<Fragment>" + | ||
| 377 | "<ComponentGroup Id='SdkStyleCs.Documents' />" + | ||
| 378 | "</Fragment>" + | ||
| 379 | "</Wix>", testXml); | ||
| 380 | |||
| 381 | var pdbPath = Path.Combine(binFolder, "Release", "HeatProjectSdkStyle.wixpdb"); | ||
| 382 | Assert.True(File.Exists(pdbPath)); | ||
| 383 | |||
| 384 | var intermediate = Intermediate.Load(pdbPath); | ||
| 385 | var section = intermediate.Sections.Single(); | ||
| 386 | |||
| 387 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | ||
| 388 | WixAssert.StringEqual(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); | ||
| 389 | } | ||
| 390 | } | ||
| 391 | |||
| 392 | /// <summary> | ||
| 393 | /// This method exists to get the WixToolset.Sdk.nupkg into the NuGet package cache using the global.json | ||
| 394 | /// and nuget.config in the root of the repository. By pre-caching the WiX SDK, the rest of the tests will | ||
| 395 | /// pull the binaries out of the cache instead of needing to find the original .nupkg in the build artifacts | ||
| 396 | /// folder (which requires use of nuget.config found in the root of the repo) | ||
| 397 | /// </summary> | ||
| 398 | private static void EnsureWixSdkCached() | ||
| 399 | { | ||
| 400 | // This EnsureWixSdkCached project exists only to pre-cache the WixToolset.Sdk for use by later projects. | ||
| 401 | var sourceFolder = TestData.Get("TestData", "EnsureWixSdkCached"); | ||
| 402 | |||
| 403 | var result = MsbuildUtilities.BuildProject(BuildSystem.DotNetCoreSdk, Path.Combine(sourceFolder, "EnsureWixSdkCached.wixproj"), new[] | ||
| 404 | { | ||
| 405 | "-t:restore", | ||
| 406 | }); | ||
| 407 | result.AssertSuccess(); | ||
| 408 | } | ||
| 409 | } | ||
| 410 | } | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/EnsureWixSdkCached/EnsureWixSdkCached.wixproj b/src/tools/test/WixToolsetTest.HeatTasks/TestData/EnsureWixSdkCached/EnsureWixSdkCached.wixproj new file mode 100644 index 00000000..7730425f --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/EnsureWixSdkCached/EnsureWixSdkCached.wixproj | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <!-- This project exists only to pre-cache the WixToolset.Sdk for use by the other test data projects. --> | ||
| 4 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj new file mode 100644 index 00000000..2aaf5c01 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | |||
| 4 | <ItemGroup> | ||
| 5 | <BindInputPaths Include="." /> | ||
| 6 | </ItemGroup> | ||
| 7 | |||
| 8 | <PropertyGroup> | ||
| 9 | <HarvestFileSuppressUniqueIds>true</HarvestFileSuppressUniqueIds> | ||
| 10 | </PropertyGroup> | ||
| 11 | |||
| 12 | <ItemGroup> | ||
| 13 | <HarvestFile Include="MyProgram.txt"> | ||
| 14 | <ComponentGroupName>TxtProductComponents</ComponentGroupName> | ||
| 15 | <DirectoryRefId>INSTALLFOLDER</DirectoryRefId> | ||
| 16 | <SuppressRootDirectory>true</SuppressRootDirectory> | ||
| 17 | </HarvestFile> | ||
| 18 | <HarvestFile Include="MyProgram.json"> | ||
| 19 | <ComponentGroupName>JsonProductComponents</ComponentGroupName> | ||
| 20 | <DirectoryRefId>INSTALLFOLDER</DirectoryRefId> | ||
| 21 | <SuppressRootDirectory>true</SuppressRootDirectory> | ||
| 22 | </HarvestFile> | ||
| 23 | </ItemGroup> | ||
| 24 | |||
| 25 | <Import Project="$(HeatTargetsPath)" /> | ||
| 26 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json | |||
| @@ -0,0 +1 @@ | |||
| \ No newline at end of file | |||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt | |||
| @@ -0,0 +1 @@ | |||
| \ No newline at end of file | |||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/Package.wxs new file mode 100644 index 00000000..5abcee9f --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFileMultipleFilesSameFileName/Package.wxs | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Package Name="HeatFilePackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" Compressed="yes" InstallerVersion="200"> | ||
| 3 | |||
| 4 | |||
| 5 | <MediaTemplate /> | ||
| 6 | |||
| 7 | <Feature Id="ProductFeature" Title="HeatFileFeature"> | ||
| 8 | <ComponentGroupRef Id="TxtProductComponents" /> | ||
| 9 | <ComponentGroupRef Id="JsonProductComponents" /> | ||
| 10 | </Feature> | ||
| 11 | </Package> | ||
| 12 | |||
| 13 | <Fragment> | ||
| 14 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 15 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 16 | </StandardDirectory> | ||
| 17 | </Fragment> | ||
| 18 | </Wix> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFilePackage/HeatFilePackage.wixproj new file mode 100644 index 00000000..345832cf --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFilePackage/HeatFilePackage.wixproj | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | |||
| 4 | <ItemGroup> | ||
| 5 | <BindInputPaths Include="." /> | ||
| 6 | </ItemGroup> | ||
| 7 | |||
| 8 | <PropertyGroup> | ||
| 9 | <HarvestFileSuppressUniqueIds>true</HarvestFileSuppressUniqueIds> | ||
| 10 | </PropertyGroup> | ||
| 11 | |||
| 12 | <ItemGroup> | ||
| 13 | <HarvestFile Include="HeatFilePackage.wixproj"> | ||
| 14 | <ComponentGroupName>ProductComponents</ComponentGroupName> | ||
| 15 | <DirectoryRefId>INSTALLFOLDER</DirectoryRefId> | ||
| 16 | <SuppressRootDirectory>true</SuppressRootDirectory> | ||
| 17 | </HarvestFile> | ||
| 18 | </ItemGroup> | ||
| 19 | |||
| 20 | <Import Project="$(HeatTargetsPath)" /> | ||
| 21 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFilePackage/Package.wxs b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFilePackage/Package.wxs new file mode 100644 index 00000000..f5fa8cf6 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatFilePackage/Package.wxs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Package Name="HeatFilePackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" Compressed="yes" InstallerVersion="200"> | ||
| 3 | |||
| 4 | |||
| 5 | <MediaTemplate /> | ||
| 6 | |||
| 7 | <Feature Id="ProductFeature" Title="HeatFileFeature"> | ||
| 8 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 9 | </Feature> | ||
| 10 | </Package> | ||
| 11 | |||
| 12 | <Fragment> | ||
| 13 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 14 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 15 | </StandardDirectory> | ||
| 16 | </Fragment> | ||
| 17 | </Wix> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj new file mode 100644 index 00000000..a05348a5 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | |||
| 4 | <ItemGroup> | ||
| 5 | <BindInputPaths Include="." /> | ||
| 6 | </ItemGroup> | ||
| 7 | |||
| 8 | <PropertyGroup> | ||
| 9 | <EnableProjectHarvesting>true</EnableProjectHarvesting> | ||
| 10 | <HarvestProjectsSuppressUniqueIds>true</HarvestProjectsSuppressUniqueIds> | ||
| 11 | </PropertyGroup> | ||
| 12 | |||
| 13 | <ItemGroup> | ||
| 14 | <ProjectReference Include="..\ToolsVersion4Cs\ToolsVersion4Cs.csproj" /> | ||
| 15 | </ItemGroup> | ||
| 16 | |||
| 17 | <Import Project="$(HeatTargetsPath)" /> | ||
| 18 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs new file mode 100644 index 00000000..6c12861b --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Package Name="HeatProjectPreSdkStyle" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5622BB42-89F6-4810-A2A3-98AFF28282FE" Compressed="yes" InstallerVersion="200"> | ||
| 3 | |||
| 4 | |||
| 5 | <MediaTemplate /> | ||
| 6 | |||
| 7 | <Feature Id="ProductFeature" Title="HeatProjectFeature"> | ||
| 8 | <ComponentGroupRef Id="ToolsVersion4Cs.Binaries" /> | ||
| 9 | </Feature> | ||
| 10 | </Package> | ||
| 11 | |||
| 12 | <Fragment> | ||
| 13 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 14 | <Directory Id="ToolsVersion4Cs.Binaries" Name="MsiPackage" /> | ||
| 15 | </StandardDirectory> | ||
| 16 | </Fragment> | ||
| 17 | </Wix> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj new file mode 100644 index 00000000..202921fe --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | |||
| 4 | <ItemGroup> | ||
| 5 | <BindInputPaths Include="." /> | ||
| 6 | </ItemGroup> | ||
| 7 | |||
| 8 | <PropertyGroup> | ||
| 9 | <EnableProjectHarvesting>true</EnableProjectHarvesting> | ||
| 10 | <HarvestProjectsSuppressUniqueIds>true</HarvestProjectsSuppressUniqueIds> | ||
| 11 | </PropertyGroup> | ||
| 12 | |||
| 13 | <ItemGroup> | ||
| 14 | <ProjectReference Include="..\SdkStyleCs\SdkStyleCs.csproj" /> | ||
| 15 | </ItemGroup> | ||
| 16 | |||
| 17 | <Import Project="$(HeatTargetsPath)" /> | ||
| 18 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs new file mode 100644 index 00000000..d30218f3 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Package Name="HeatProjectSdkStyle" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="D2AF3276-A68E-40DE-85A1-4BCD5B35D432" Compressed="yes" InstallerVersion="200"> | ||
| 3 | |||
| 4 | |||
| 5 | <MediaTemplate /> | ||
| 6 | |||
| 7 | <Feature Id="ProductFeature" Title="HeatProjectFeature"> | ||
| 8 | <ComponentGroupRef Id="SdkStyleCs.Binaries" /> | ||
| 9 | </Feature> | ||
| 10 | </Package> | ||
| 11 | |||
| 12 | <Fragment> | ||
| 13 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 14 | <Directory Id="SdkStyleCs.Binaries" Name="MsiPackage" /> | ||
| 15 | </StandardDirectory> | ||
| 16 | </Fragment> | ||
| 17 | </Wix> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs new file mode 100644 index 00000000..2b2c5be2 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs | |||
| @@ -0,0 +1,8 @@ | |||
| 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 | |||
| 3 | namespace SdkStyleCs | ||
| 4 | { | ||
| 5 | public class SdkStyleCs | ||
| 6 | { | ||
| 7 | } | ||
| 8 | } | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj new file mode 100644 index 00000000..755976bc --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj | |||
| @@ -0,0 +1,8 @@ | |||
| 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 Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>netstandard2.0</TargetFramework> | ||
| 7 | </PropertyGroup> | ||
| 8 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c29a2303 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs | |||
| @@ -0,0 +1,11 @@ | |||
| 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 | |||
| 3 | using System; | ||
| 4 | using System.Reflection; | ||
| 5 | using System.Runtime.InteropServices; | ||
| 6 | |||
| 7 | [assembly: AssemblyTitle("ToolsVersion4Cs")] | ||
| 8 | [assembly: AssemblyDescription("ToolsVersion4Cs")] | ||
| 9 | [assembly: AssemblyProduct("WiX Toolset")] | ||
| 10 | [assembly: AssemblyCompany("WiX Toolset Team")] | ||
| 11 | [assembly: AssemblyCopyright("Copyright (c) .NET Foundation and contributors. All rights reserved.")] | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj new file mode 100644 index 00000000..e5723ea2 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.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 | |||
| 5 | <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| 6 | <PropertyGroup> | ||
| 7 | <ProjectGuid>{8B19578A-816A-48A1-A6C4-58067334EB79}</ProjectGuid> | ||
| 8 | <AssemblyName>ToolsVersion4Cs</AssemblyName> | ||
| 9 | <OutputType>Library</OutputType> | ||
| 10 | <RootNamespace>ToolsVersion4Cs</RootNamespace> | ||
| 11 | <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
| 12 | </PropertyGroup> | ||
| 13 | <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
| 14 | <DebugSymbols>true</DebugSymbols> | ||
| 15 | <Optimize>false</Optimize> | ||
| 16 | <DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants> | ||
| 17 | <OutputPath>bin\Debug\</OutputPath> | ||
| 18 | </PropertyGroup> | ||
| 19 | <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
| 20 | <DebugSymbols>true</DebugSymbols> | ||
| 21 | <Optimize>true</Optimize> | ||
| 22 | <DefineConstants>$(DefineConstants);TRACE</DefineConstants> | ||
| 23 | <OutputPath>bin\Release\</OutputPath> | ||
| 24 | </PropertyGroup> | ||
| 25 | <ItemGroup> | ||
| 26 | <Compile Include="Properties\AssemblyInfo.cs" /> | ||
| 27 | </ItemGroup> | ||
| 28 | <ItemGroup> | ||
| 29 | <Reference Include="System" /> | ||
| 30 | <Reference Include="System.Configuration" /> | ||
| 31 | <Reference Include="System.Data" /> | ||
| 32 | <Reference Include="System.Xml" /> | ||
| 33 | </ItemGroup> | ||
| 34 | |||
| 35 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
| 36 | </Project> \ No newline at end of file | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.csproj b/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.csproj new file mode 100644 index 00000000..c0c7c903 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.csproj | |||
| @@ -0,0 +1,28 @@ | |||
| 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 Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>net472</TargetFramework> | ||
| 7 | <IsPackable>false</IsPackable> | ||
| 8 | <DebugType>embedded</DebugType> | ||
| 9 | <DefaultItemExcludes>TestData\**;$(DefaultItemExcludes)</DefaultItemExcludes> | ||
| 10 | <SignOutput>false</SignOutput> | ||
| 11 | </PropertyGroup> | ||
| 12 | |||
| 13 | <ItemGroup> | ||
| 14 | <Content Include="TestData\**" CopyToOutputDirectory="PreserveNewest" /> | ||
| 15 | <Content Include="..\..\..\..\global.json" CopyToOutputDirectory="PreserveNewest" /> | ||
| 16 | </ItemGroup> | ||
| 17 | |||
| 18 | <ItemGroup> | ||
| 19 | <PackageReference Include="WixBuildTools.TestSupport" /> | ||
| 20 | <PackageReference Include="WixToolset.Core.TestPackage" /> | ||
| 21 | </ItemGroup> | ||
| 22 | |||
| 23 | <ItemGroup> | ||
| 24 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> | ||
| 25 | <PackageReference Include="xunit" /> | ||
| 26 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> | ||
| 27 | </ItemGroup> | ||
| 28 | </Project> | ||
diff --git a/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.v3.ncrunchproject b/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.v3.ncrunchproject new file mode 100644 index 00000000..319cd523 --- /dev/null +++ b/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.v3.ncrunchproject | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | <ProjectConfiguration> | ||
| 2 | <Settings> | ||
| 3 | <IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> | ||
| 4 | </Settings> | ||
| 5 | </ProjectConfiguration> \ No newline at end of file | ||
