@joebigelow / wix-1 / commits / 9e3d7c0c

Move to a single tracking file for all bind inputs and outputs

A single tracking file can be enhanced more easily than continuing to introduce specialized tracking files. In this case, we now include output files that are copied and can differentiate them from the built output files.

Rob Mensching committed Jan 2, 2022 at 13:13 UTC 9e3d7c0c4c7000ef51c2959b4e04c2323d1dac31
14 files changed +185 -206
src/api/wix/WixToolset.Extensibility/Data/ILayoutContext.cs
+2 -12
@@ -31,25 +31,15 @@ namespace WixToolset.Extensibility.Data
31 /// </summary>
32 IReadOnlyCollection<IFileTransfer> FileTransfers { get; set; }
33
34 - /// <summary>
35 - /// File to capture list of content files.
36 - /// </summary>
37 - string ContentsFile { get; set; }
38 -
39 - /// <summary>
40 - /// File to capture list of output files.
41 - /// </summary>
42 - string OutputsFile { get; set; }
43 -
34 /// <summary>
35 /// Intermediate folder.
36 /// </summary>
37 string IntermediateFolder { get; set; }
38
39 /// <summary>
50 - /// List of built output files.
40 + /// File to capture list of content, built output and copied output files.
41 /// </summary>
52 - string BuiltOutputsFile { get; set; }
42 + string TrackingFile { get; set; }
43
44 /// <summary>
45 /// Reset ACLs on file transfers.
src/api/wix/WixToolset.Extensibility/Data/TrackedFileType.cs
+9 -3
@@ -25,9 +25,15 @@ namespace WixToolset.Extensibility.Data
25 Intermediate,
26
27 /// <summary>
28 - /// Final output (like a .msi, .cab or .wixpdb).
29 - /// These are the whole point of the build process.
28 + /// Output created by the build process itself (like a .msi, .cab or .wixpdb).
29 + /// These files can be recreated in the final output location by building again.
30 /// </summary>
31 - Final,
31 + BuiltOutput,
32 +
33 + /// <summary>
34 + /// Output copied by the build process (like external files in an .msi).
35 + /// These files are not created by the build process but are copied to the final output location.
36 + /// </summary>
37 + CopiedOutput,
38 }
39 }
src/wix/WixToolset.BuildTasks/ReadTracking.cs new
+97
@@ -0,0 +1,97 @@
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 WixToolset.BuildTasks
4 +{
5 + using System;
6 + using System.Collections.Generic;
7 + using System.Linq;
8 + using Microsoft.Build.Framework;
9 + using Microsoft.Build.Utilities;
10 +
11 + /// <summary>
12 + /// Read the contents of the tracking file produced by the build command.
13 + /// </summary>
14 + public class ReadTracking : Task
15 + {
16 + private const string TrackedTypeMetadataName = "TrackedType";
17 + private static readonly char[] TrackedLineTypePathSeparator = new[] { '\t' };
18 +
19 + /// <summary>
20 + /// The path to the tracking file.
21 + /// </summary>
22 + [Required]
23 + public ITaskItem File { get; set; }
24 +
25 + /// <summary>
26 + /// All tracked files.
27 + /// </summary>
28 + [Output]
29 + public ITaskItem[] All { get; private set; }
30 +
31 + /// <summary>
32 + /// The tracked built outputs.
33 + /// </summary>
34 + [Output]
35 + public ITaskItem[] BuiltOutputs { get; private set; }
36 +
37 + /// <summary>
38 + /// The tracked copied outputs.
39 + /// </summary>
40 + [Output]
41 + public ITaskItem[] CopiedOutputs { get; private set; }
42 +
43 + /// <summary>
44 + /// The tracked inputs.
45 + /// </summary>
46 + [Output]
47 + public ITaskItem[] Inputs { get; private set; }
48 +
49 + /// <summary>
50 + /// All tracked outputs.
51 + /// </summary>
52 + [Output]
53 + public ITaskItem[] Outputs { get; private set; }
54 +
55 + /// <summary>
56 + /// Gets a complete list of external cabs referenced by the given installer database file.
57 + /// </summary>
58 + /// <returns>True upon completion of the task execution.</returns>
59 + public override bool Execute()
60 + {
61 + var all = new List<ITaskItem>();
62 + var path = this.File.ItemSpec;
63 +
64 + if (System.IO.File.Exists(path))
65 + {
66 + var lines = System.IO.File.ReadAllLines(path);
67 +
68 + foreach (var line in lines)
69 + {
70 + var split = line.Split(TrackedLineTypePathSeparator, 2, StringSplitOptions.RemoveEmptyEntries);
71 +
72 + if (split.Length == 2)
73 + {
74 + all.Add(new TaskItem(split[1], new Dictionary<string, string>() { [TrackedTypeMetadataName] = split[0] }));
75 + }
76 + else
77 + {
78 + this.Log.LogError($"Failed to parse tracked line: {line}");
79 + }
80 + }
81 + }
82 +
83 + this.All = all.ToArray();
84 + this.BuiltOutputs = all.Where(t => FilterByTrackedType(t, "BuiltOutput")).ToArray();
85 + this.CopiedOutputs = all.Where(t => FilterByTrackedType(t, "CopiedOutput")).ToArray();
86 + this.Inputs = all.Where(t => FilterByTrackedType(t, "Input")).ToArray();
87 + this.Outputs = all.Where(t => FilterByTrackedType(t, "BuiltOutput") || FilterByTrackedType(t, "CopiedOutput")).ToArray();
88 +
89 + return true;
90 + }
91 +
92 + private static bool FilterByTrackedType(ITaskItem item, string type)
93 + {
94 + return item.GetMetadata(TrackedTypeMetadataName).Equals(type, StringComparison.OrdinalIgnoreCase);
95 + }
96 + }
97 +}
src/wix/WixToolset.BuildTasks/WixBuild.cs
+2 -8
@@ -52,11 +52,7 @@ namespace WixToolset.BuildTasks
52
53 public bool BindFiles { get; set; }
54
55 - public ITaskItem BindContentsFile { get; set; }
56 -
57 - public ITaskItem BindOutputsFile { get; set; }
58 -
59 - public ITaskItem BindBuiltOutputsFile { get; set; }
55 + public ITaskItem BindTrackingFile { get; set; }
56
57 public string CabinetCachePath { get; set; }
58
@@ -96,9 +92,7 @@ namespace WixToolset.BuildTasks
92 commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile);
93 commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath);
94 commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory);
99 - commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile);
100 - commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile);
101 - commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile);
95 + commandLineBuilder.AppendSwitchIfNotNull("-trackingfile ", this.BindTrackingFile);
96 commandLineBuilder.AppendSwitchIfNotNull("-defaultcompressionlevel ", this.DefaultCompressionLevel);
97
98 base.BuildCommandLine(commandLineBuilder);
src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
+2 -2
@@ -483,7 +483,7 @@ namespace WixToolset.Core.Burn
483 command.Execute();
484
485 fileTransfers.Add(command.Transfer);
486 - trackedFiles.Add(this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final));
486 + trackedFiles.Add(this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.BuiltOutput));
487 }
488
489 #if TODO // does this need to come back, or do they only need to be in TrackedFiles?
@@ -504,7 +504,7 @@ namespace WixToolset.Core.Burn
504 }
505 else
506 {
507 - var trackPdb = this.BackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.Final);
507 + var trackPdb = this.BackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.BuiltOutput);
508 trackedFiles.Add(trackPdb);
509
510 wixout = WixOutput.Create(trackPdb.Path);
src/wix/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+2 -2
@@ -478,7 +478,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
478 {
479 this.Messaging.Write(VerboseMessages.GeneratingDatabase());
480
481 - var trackMsi = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final);
481 + var trackMsi = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPath, TrackedFileType.BuiltOutput);
482 trackedFiles.Add(trackMsi);
483
484 var command = new GenerateDatabaseCommand(this.Messaging, this.WindowsInstallerBackendHelper, this.FileSystemManager, data, trackMsi.Path, tableDefinitions, this.IntermediateFolder, keepAddedColumns: false, this.SuppressAddingValidationRows, useSubdirectory: false);
@@ -595,7 +595,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
595 }
596 else
597 {
598 - var trackPdb = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.Final);
598 + var trackPdb = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPdbPath, TrackedFileType.BuiltOutput);
599 trackedFiles.Add(trackPdb);
600
601 wixout = WixOutput.Create(trackPdb.Path);
src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
+1 -1
@@ -225,7 +225,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
225 }
226 else
227 {
228 - var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaSymbol.Cabinet), TrackedFileType.Final, mediaSymbol.SourceLineNumbers);
228 + var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaSymbol.Cabinet), TrackedFileType.BuiltOutput, mediaSymbol.SourceLineNumbers);
229 this.trackedFiles.Add(trackDestination);
230
231 var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaSymbol.SourceLineNumbers);
src/wix/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
+1 -1
@@ -109,7 +109,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
109 // because if the source and destination of the transfer is the same, we
110 // don't want to clean the file because we'd be deleting the original
111 // (and that would be bad).
112 - var tracked = this.BackendHelper.TrackFile(transfer.Destination, TrackedFileType.Final, facade.SourceLineNumber);
112 + var tracked = this.BackendHelper.TrackFile(transfer.Destination, TrackedFileType.BuiltOutput, facade.SourceLineNumber);
113 tracked.Clean = !transfer.Redundant;
114
115 trackedFiles.Add(tracked);
src/wix/WixToolset.Core/CommandLine/BuildCommand.cs
+6 -28
@@ -52,11 +52,7 @@ namespace WixToolset.Core.CommandLine
52
53 private CompressionLevel? DefaultCompressionLevel { get; set; }
54
55 - private string ContentsFile { get; set; }
56 -
57 - private string OutputsFile { get; set; }
58 -
59 - private string BuiltOutputsFile { get; set; }
55 + private string TrackingFile { get; set; }
56
57 public Task<int> ExecuteAsync(CancellationToken cancellationToken)
58 {
@@ -78,11 +74,7 @@ namespace WixToolset.Core.CommandLine
74
75 this.Platform = this.commandLine.Platform;
76
81 - this.ContentsFile = this.commandLine.ContentsFile;
82 -
83 - this.OutputsFile = this.commandLine.OutputsFile;
84 -
85 - this.BuiltOutputsFile = this.commandLine.BuiltOutputsFile;
77 + this.TrackingFile = this.commandLine.TrackingFile;
78
79 this.DefaultCompressionLevel = this.commandLine.DefaultCompressionLevel;
80
@@ -371,9 +363,7 @@ namespace WixToolset.Core.CommandLine
363 context.TrackedFiles = bindResult.TrackedFiles;
364 context.FileTransfers = bindResult.FileTransfers;
365 context.IntermediateFolder = intermediateFolder;
374 - context.ContentsFile = this.ContentsFile;
375 - context.OutputsFile = this.OutputsFile;
376 - context.BuiltOutputsFile = this.BuiltOutputsFile;
366 + context.TrackingFile = this.TrackingFile;
367 context.ResetAcls = this.commandLine.ResetAcls;
368 context.CancellationToken = cancellationToken;
369
@@ -537,11 +527,7 @@ namespace WixToolset.Core.CommandLine
527
528 public CompressionLevel? DefaultCompressionLevel { get; private set; }
529
540 - public string ContentsFile { get; private set; }
541 -
542 - public string OutputsFile { get; private set; }
543 -
544 - public string BuiltOutputsFile { get; private set; }
530 + public string TrackingFile { get; private set; }
531
532 public List<string> Ices { get; } = new List<string>();
533
@@ -610,16 +596,8 @@ namespace WixToolset.Core.CommandLine
596 parser.GetNextArgumentOrError(arg, this.Cultures);
597 return true;
598
613 - case "contentsfile":
614 - this.ContentsFile = parser.GetNextArgumentAsFilePathOrError(arg);
615 - return true;
616 -
617 - case "outputsfile":
618 - this.OutputsFile = parser.GetNextArgumentAsFilePathOrError(arg);
619 - return true;
620 -
621 - case "builtoutputsfile":
622 - this.BuiltOutputsFile = parser.GetNextArgumentAsFilePathOrError(arg);
599 + case "trackingfile":
600 + this.TrackingFile = parser.GetNextArgumentAsFilePathOrError(arg);
601 return true;
602
603 case "d":
src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs
+1 -1
@@ -12,7 +12,7 @@ namespace WixToolset.Core.ExtensibilityServices
12 this.Path = path;
13 this.Type = type;
14 this.SourceLineNumbers = sourceLineNumbers;
15 - this.Clean = (type == TrackedFileType.Intermediate || type == TrackedFileType.Final);
15 + this.Clean = (type == TrackedFileType.Intermediate || type == TrackedFileType.BuiltOutput || type == TrackedFileType.CopiedOutput);
16 }
17
18 public bool Clean { get; set; }
src/wix/WixToolset.Core/LayoutContext.cs
+1 -5
@@ -27,11 +27,7 @@ namespace WixToolset.Core
27
28 public string IntermediateFolder { get; set; }
29
30 - public string ContentsFile { get; set; }
31 -
32 - public string OutputsFile { get; set; }
33 -
34 - public string BuiltOutputsFile { get; set; }
30 + public string TrackingFile { get; set; }
31
32 public bool ResetAcls { get; set; }
33
src/wix/WixToolset.Core/LayoutCreator.cs
+17 -80
@@ -16,6 +16,8 @@ namespace WixToolset.Core
16 /// </summary>
17 internal class LayoutCreator : ILayoutCreator
18 {
19 + private const string TrackedLineTypePathSeparator = "\t";
20 +
21 internal LayoutCreator(IServiceProvider serviceProvider)
22 {
23 this.Messaging = serviceProvider.GetService<IMessaging>();
@@ -51,22 +53,9 @@ namespace WixToolset.Core
53 }
54 finally
55 {
54 - if (context.TrackedFiles != null)
56 + if (context.TrackedFiles != null && !String.IsNullOrEmpty(context.TrackingFile))
57 {
56 - if (!String.IsNullOrEmpty(context.ContentsFile))
57 - {
58 - this.CreateContentsFile(context.ContentsFile, context.TrackedFiles);
59 - }
60 -
61 - if (!String.IsNullOrEmpty(context.OutputsFile))
62 - {
63 - this.CreateOutputsFile(context.OutputsFile, context.TrackedFiles);
64 - }
65 -
66 - if (!String.IsNullOrEmpty(context.BuiltOutputsFile))
67 - {
68 - this.CreateBuiltOutputsFile(context.BuiltOutputsFile, context.TrackedFiles);
69 - }
58 + this.CreateTrackingFile(context.TrackingFile, context.TrackedFiles);
59 }
60 }
61
@@ -78,72 +67,15 @@ namespace WixToolset.Core
67 }
68
69 /// <summary>
81 - /// Writes the paths to the content files to a text file.
82 - /// </summary>
83 - /// <param name="path">Path to write file.</param>
84 - /// <param name="trackedFiles">Collection of paths to content files that will be written to file.</param>
85 - private void CreateContentsFile(string path, IEnumerable<ITrackedFile> trackedFiles)
86 - {
87 - var uniqueInputFilePaths = new SortedSet<string>(trackedFiles.Where(t => t.Type == TrackedFileType.Input).Select(t => t.Path), StringComparer.OrdinalIgnoreCase);
88 -
89 - if (!uniqueInputFilePaths.Any())
90 - {
91 - return;
92 - }
93 -
94 - var directory = Path.GetDirectoryName(path);
95 - Directory.CreateDirectory(directory);
96 -
97 - using (var contents = new StreamWriter(path, false))
98 - {
99 - foreach (var inputPath in uniqueInputFilePaths)
100 - {
101 - contents.WriteLine(inputPath);
102 - }
103 - }
104 - }
105 -
106 - /// <summary>
107 - /// Writes the paths to the output files to a text file.
108 - /// </summary>
109 - /// <param name="path">Path to write file.</param>
110 - /// <param name="trackedFiles">Collection of files that were transferred to the output directory.</param>
111 - private void CreateOutputsFile(string path, IEnumerable<ITrackedFile> trackedFiles)
112 - {
113 - var uniqueOutputPaths = new SortedSet<string>(trackedFiles.Where(t => t.Clean).Select(t => t.Path), StringComparer.OrdinalIgnoreCase);
114 -
115 - if (!uniqueOutputPaths.Any())
116 - {
117 - return;
118 - }
119 -
120 - var directory = Path.GetDirectoryName(path);
121 - Directory.CreateDirectory(directory);
122 -
123 - using (var outputs = new StreamWriter(path, false))
124 - {
125 - //// Don't list files where the source is the same as the destination since
126 - //// that might be the only place the file exists. The outputs file is often
127 - //// used to delete stuff and losing the original source would be bad.
128 - //var uniqueOutputPaths = new SortedSet<string>(fileTransfers.Where(ft => !ft.Redundant).Select(ft => ft.Destination), StringComparer.OrdinalIgnoreCase);
129 -
130 - foreach (var outputPath in uniqueOutputPaths)
131 - {
132 - outputs.WriteLine(outputPath);
133 - }
134 - }
135 - }
136 -
137 - /// <summary>
138 - /// Writes the paths to the built output files to a text file.
70 + /// Writes the paths of the track files to a text file.
71 /// </summary>
72 /// <param name="path">Path to write file.</param>
141 - /// <param name="trackedFiles">Collection of files that were transferred to the output directory.</param>
142 - private void CreateBuiltOutputsFile(string path, IEnumerable<ITrackedFile> trackedFiles)
73 + /// <param name="trackedFiles">Collection of files that were tracked.</param>
74 + private void CreateTrackingFile(string path, IEnumerable<ITrackedFile> trackedFiles)
75 {
144 - var uniqueBuiltPaths = new SortedSet<string>(trackedFiles.Where(t => t.Type == TrackedFileType.Final).Select(t => t.Path), StringComparer.OrdinalIgnoreCase);
76 + var uniqueTrackingLines = new SortedSet<string>(trackedFiles.Where(t => t.Type != TrackedFileType.Temporary).Select(TrackedFileLine), StringComparer.OrdinalIgnoreCase);
77
146 - if (!uniqueBuiltPaths.Any())
78 + if (!uniqueTrackingLines.Any())
79 {
80 return;
81 }
@@ -151,11 +83,11 @@ namespace WixToolset.Core
83 var directory = Path.GetDirectoryName(path);
84 Directory.CreateDirectory(directory);
85
154 - using (var outputs = new StreamWriter(path, false))
86 + using (var stream = new StreamWriter(path, false))
87 {
156 - foreach (var builtPath in uniqueBuiltPaths)
88 + foreach (var trackingLine in uniqueTrackingLines)
89 {
158 - outputs.WriteLine(builtPath);
90 + stream.WriteLine(trackingLine);
91 }
92 }
93 }
@@ -219,5 +151,10 @@ namespace WixToolset.Core
151 }
152 }
153 }
154 +
155 + private static string TrackedFileLine(ITrackedFile trackedFile)
156 + {
157 + return trackedFile.Type + TrackedLineTypePathSeparator + trackedFile.Path;
158 + }
159 }
160 }
src/wix/WixToolset.Sdk/tools/wix.targets
+43 -61
@@ -112,18 +112,20 @@
112 <PropertyGroup>
113 <!-- Default pdb output path to the intermediate output directory -->
114 <PdbOutputDir Condition=" '$(PdbOutputDir)'=='' ">$(TargetDir)</PdbOutputDir>
115 - <PdbOutputDir Condition=" !HasTrailingSlash('$(PdbOutputDir)') ">$(PdbOutputDir)\</PdbOutputDir>
116 -
117 - <!-- Example, C:\MyProjects\MyProject\bin\debug\ -->
118 - <TargetPdbDir Condition=" '$(PdbOutputDir)'!='' ">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`))</TargetPdbDir>
119 -
120 - <!-- Example, MySetup.wixpdb" -->
115 + <TargetPdbDir Condition=" '$(PdbOutputDir)'!='' ">$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory), $(PdbOutputDir)))</TargetPdbDir>
116 <TargetPdbFileName Condition=" '$(TargetPdbFileName)' == '' ">$(TargetName).wixpdb</TargetPdbFileName>
122 -
123 - <!-- Example, C:\MyProjects\MyProject\bin\debug\MyPackage.wixpdb -->
117 <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">$(TargetPdbDir)$(TargetPdbFileName)</TargetPdbPath>
118 </PropertyGroup>
119
120 + <PropertyGroup>
121 + <WixExtDir Condition=" '$(WixExtDir)' == ''">$(WixBinDir)</WixExtDir>
122 + </PropertyGroup>
123 +
124 + <PropertyGroup>
125 + <BindTrackingFilePrefix Condition=" '$(BindTrackingFilePrefix)' == '' ">$(MSBuildProjectFile).BindTracking</BindTrackingFilePrefix>
126 + <BindTrackingFileExtension Condition=" '$(BindTrackingFileExtension)' == '' ">.txt</BindTrackingFileExtension>
127 + </PropertyGroup>
128 +
129 <!--
130 ***********************************************************************************************
131 ***********************************************************************************************
@@ -154,24 +156,14 @@
156 <UsingTask TaskName="WixAssignCulture" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
157 <UsingTask TaskName="WixAssignCulture" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
158
159 + <UsingTask TaskName="ReadTracking" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
160 + <UsingTask TaskName="ReadTracking" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
161 + <UsingTask TaskName="ReadTracking" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
162 +
163 <UsingTask TaskName="ResolveWixReferences" Condition=" '$(WixTasksPath64)' == '' " AssemblyFile="$(WixTasksPath)" />
164 <UsingTask TaskName="ResolveWixReferences" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath)" Architecture="x86" />
165 <UsingTask TaskName="ResolveWixReferences" Condition=" '$(WixTasksPath64)' != '' " AssemblyFile="$(WixTasksPath64)" Architecture="x64" />
166
161 - <PropertyGroup>
162 - <BindContentsFile Condition=" '$(BindContentsFile)' == '' ">$(MSBuildProjectFile).BindContentsFileList.txt</BindContentsFile>
163 - <BindOutputsFile Condition=" '$(BindOutputsFile)' == '' ">$(MSBuildProjectFile).BindOutputsFileList.txt</BindOutputsFile>
164 - <BindBuiltOutputsFile Condition=" '$(BindBuiltOutputsFile)' == '' ">$(MSBuildProjectFile).BindBuiltOutputsFileList.txt</BindBuiltOutputsFile>
165 - </PropertyGroup>
166 -
167 - <PropertyGroup>
168 - <CabinetCachePath Condition=" '$(CabinetCachePath)'=='' and '$(ReuseCabinetCache)'=='true' ">$(IntermediateOutputPath)cabcache\</CabinetCachePath>
169 - </PropertyGroup>
170 -
171 - <PropertyGroup>
172 - <WixExtDir Condition=" '$(WixExtDir)' == ''">$(WixBinDir)</WixExtDir>
173 - </PropertyGroup>
174 -
167 <!--
168 ***********************************************************************************************
169 ***********************************************************************************************
@@ -552,6 +544,9 @@
544 <PropertyGroup>
545 <TargetPath>@(_CulturedTargetPath)</TargetPath>
546 <TargetPdbPath>@(_CulturedTargetPdbPath)</TargetPdbPath>
547 +
548 + <!-- Update bind tracking filename prefix so cultures appended to the filename will be separated by a "-" -->
549 + <BindTrackingFilePrefix>$(BindTrackingFilePrefix)-</BindTrackingFilePrefix>
550 </PropertyGroup>
551 </Target>
552
@@ -615,18 +610,17 @@
610 Inputs="@(Compile);
611 @(Content);
612 @(_WixLocalizationFile);
618 - @(WixObject);
613 @(_WixReferencedProjectOutputs);
614 @(_ResolvedWixLibraryPaths);
615 @(_ResolvedWixExtensionPaths);
616 @(_BindInputs)"
623 - Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)"
617 + Outputs="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension);@(_BindBuiltOutputs)"
618 DependsOnTargets="$(CoreCompileDependsOn)"
619 Condition=" '@(Compile)' != '' ">
620
621 <PropertyGroup>
628 - <OutputFile>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)))</OutputFile>
629 - <PdbOutputFile>$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName)</PdbOutputFile>
622 + <CabinetCachePath Condition=" '$(CabinetCachePath)'=='' and '$(ReuseCabinetCache)'=='true' ">$(IntermediateOutputPath)cabcache\</CabinetCachePath>
623 + <_WixBuildCabinetCachePath Condition=" '$(CabinetCachePath)'!='' ">$([MSBuild]::NormalizeDirectory($(CabinetCachePath), %(CultureGroup.OutputFolder)))</_WixBuildCabinetCachePath>
624 </PropertyGroup>
625
626 <WixBuild
@@ -641,9 +635,9 @@
635
636 IntermediateDirectory="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)"
637
644 - OutputFile="$(OutputFile)"
638 + OutputFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)"
639 OutputType="$(OutputType)"
646 - PdbFile="$(PdbOutputFile)"
640 + PdbFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName)"
641 PdbType="$(WixPdbType)"
642
643 AdditionalOptions="$(CompilerAdditionalOptions) $(LinkerAdditionalOptions)"
@@ -659,11 +653,9 @@
653
654 BindInputPaths="@(LinkerBindInputPaths)"
655 BindFiles="$(LinkerBindFiles)"
662 - BindContentsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)"
663 - BindOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"
664 - BindBuiltOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)"
656 + BindTrackingFile="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)"
657
666 - CabinetCachePath="$(CabinetCachePath)"
658 + CabinetCachePath="$(_WixBuildCabinetCachePath)"
659 CabinetCreationThreadCount="$(CabinetCreationThreadCount)"
660 DefaultCompressionLevel="$(DefaultCompressionLevel)"
661
@@ -754,16 +746,10 @@
746 <Target
747 Name="ReadPreviousBindInputsAndBuiltOutputs">
748
757 - <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)">
758 - <Output TaskParameter="Lines" ItemName="_BindInputs" />
759 - </ReadLinesFromFile>
760 -
761 - <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
762 - <Output TaskParameter="Lines" ItemName="_BindBuiltOutputs" />
763 - </ReadLinesFromFile>
764 -
765 - <Message Importance="low" Text="Previous bind inputs: @(_BindInputs)" />
766 - <Message Importance="low" Text="Previous bind outputs: @(_BindBuiltOutputs)" />
749 + <ReadTracking File="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)">
750 + <Output TaskParameter="Inputs" ItemName="_BindInputs" />
751 + <Output TaskParameter="BuiltOutputs" ItemName="_BindBuiltOutputs" />
752 + </ReadTracking>
753 </Target>
754
755 <!--
@@ -789,17 +775,13 @@
775 Name="UpdateFileWritesWithBindInformation"
776 AfterTargets="CoreCompile">
777
792 - <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)">
793 - <Output TaskParameter="Lines" ItemName="FileWrites"/>
794 - </ReadLinesFromFile>
778 + <ReadTracking File="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)">
779 + <Output TaskParameter="Outputs" ItemName="FileWrites" />
780 + </ReadTracking>
781
782 <ItemGroup>
797 - <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)') " />
798 - <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)') " />
799 - <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)') " />
783 + <FileWrites Include="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)" Condition=" Exists('$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)') " />
784 </ItemGroup>
801 -
802 - <Message Importance="low" Text="Build files after link: @(FileWrites)" />
785 </Target>
786
787 <!--
@@ -862,10 +844,10 @@
844
845 <!-- Don't add BuiltProjectOutputGroupKeyOutput - to avoid duplicates, we only want to get the updated list of TargetPaths from the TargetPath property below -->
846
865 - <!-- Try to read the outputs from the bind outputs text file since that's the output list straight from compiler. -->
866 - <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
867 - <Output TaskParameter="Lines" ItemName="_BuiltProjectOutputGroupOutputIntermediate"/>
868 - </ReadLinesFromFile>
847 + <!-- Try to read the outputs from the bind tracking text file since that's the output list straight from compiler. -->
848 + <ReadTracking File="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)">
849 + <Output TaskParameter="Outputs" ItemName="_BuiltProjectOutputGroupOutputIntermediate" />
850 + </ReadTracking>
851
852 <!-- If we didn't get anything from the bind outputs text file, default to the target path. -->
853 <ItemGroup Condition=" '@(_BuiltProjectOutputGroupOutputIntermediate)'=='' ">
@@ -930,17 +912,17 @@
912 <PropertyGroup>
913 <CopyBuildOutputToOutputDirectory Condition="'$(CopyBuildOutputToOutputDirectory)'==''">true</CopyBuildOutputToOutputDirectory>
914 <CopyOutputSymbolsToOutputDirectory Condition="'$(CopyOutputSymbolsToOutputDirectory)'==''">true</CopyOutputSymbolsToOutputDirectory>
933 - <FullIntermediateOutputPath>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)))</FullIntermediateOutputPath>
915 + <FullIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath)))</FullIntermediateOutputPath>
916 </PropertyGroup>
917
936 - <!-- Copy the bound files. -->
937 - <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)">
938 - <Output TaskParameter="Lines" ItemName="_FullPathToCopy"/>
939 - </ReadLinesFromFile>
918 + <!-- Copy the bound output files. -->
919 + <ReadTracking File="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.Identity)$(BindTrackingFileExtension)">
920 + <Output TaskParameter="Outputs" ItemName="_FullPathToCopy" />
921 + </ReadTracking>
922
923 <ItemGroup>
942 - <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " />
943 - <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" />
924 + <_FullPathToCopy Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)" Condition=" '@(_FullPathToCopy)'=='' " />
925 + <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.FullPath)))" />
926 </ItemGroup>
927
928 <Copy
src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj
+1 -2
@@ -19,8 +19,7 @@
19 </ItemGroup>
20
21 <ItemGroup>
22 - <!-- <PackageReference Include="WixBuildTools.TestSupport" /> -->
23 - <ProjectReference Include="..\..\..\internal\WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj" />
22 + <PackageReference Include="WixBuildTools.TestSupport" />
23 </ItemGroup>
24
25 <ItemGroup>