summaryrefslogtreecommitdiff
path: root/src/tools/WixToolset.Heat/WixToolset.Heat.targets
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/WixToolset.Heat/WixToolset.Heat.targets')
-rw-r--r--src/tools/WixToolset.Heat/WixToolset.Heat.targets516
1 files changed, 516 insertions, 0 deletions
diff --git a/src/tools/WixToolset.Heat/WixToolset.Heat.targets b/src/tools/WixToolset.Heat/WixToolset.Heat.targets
new file mode 100644
index 00000000..ba854459
--- /dev/null
+++ b/src/tools/WixToolset.Heat/WixToolset.Heat.targets
@@ -0,0 +1,516 @@
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 xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6 <!-- These properties can be overridden to support non-default installations. -->
7 <PropertyGroup>
8 <WixHeatBinDir Condition=" '$(WixHeatBinDir)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">$(MSBuildThisFileDirectory)..\tools\netcoreapp3.1\</WixHeatBinDir>
9 <WixHeatBinDir Condition=" '$(WixHeatBinDir)' == '' ">$(MSBuildThisFileDirectory)..\tools\net472\</WixHeatBinDir>
10 <WixHeatTasksPath Condition=" '$(WixHeatTasksPath)' == '' ">$(WixHeatBinDir)WixToolset.HeatTasks.dll</WixHeatTasksPath>
11
12 <!--
13 For backwards compatibility, the MSBuild tasks always default to the x86 heat.exe even though a x64 heat.exe is available.
14 For "dotnet.exe build" the Heat tasks calculate the command-line to start heat.dll in .NET Core.
15 -->
16 <HeatToolDir Condition=" '$(HeatToolDir)' == '' and '$(MSBuildRuntimeType)' != 'Core' ">$(MSBuildThisFileDirectory)..\tools\net472\x86\</HeatToolDir>
17
18 <HeatExe Condition=" '$(HeatExe)' == '' ">$(MSBuildThisFileDirectory)..\tools\net472\x86\heat.exe</HeatExe>
19 <HeatExe64 Condition=" '$(HeatExe64)' == '' ">$(MSBuildThisFileDirectory)..\tools\net472\x64\heat.exe</HeatExe64>
20 </PropertyGroup>
21
22 <!-- These tasks are extensions for harvesting WiX source code from other sources. -->
23 <UsingTask TaskName="HeatFile" AssemblyFile="$(WixHeatTasksPath)" />
24 <UsingTask TaskName="HeatDirectory" AssemblyFile="$(WixHeatTasksPath)" />
25 <UsingTask TaskName="HeatProject" AssemblyFile="$(WixHeatTasksPath)" />
26
27 <UsingTask TaskName="RefreshGeneratedFile" AssemblyFile="$(WixHeatTasksPath)"/>
28 <UsingTask TaskName="RefreshBundleGeneratedFile" AssemblyFile="$(WixHeatTasksPath)"/>
29
30 <!-- Default Harvester properties-->
31 <PropertyGroup>
32 <HarvestNoLogo Condition=" '$(HarvestNoLogo)' == '' ">$(NoLogo)</HarvestNoLogo>
33 <HarvestSuppressAllWarnings Condition=" '$(HarvestSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</HarvestSuppressAllWarnings>
34 <HarvestSuppressSpecificWarnings Condition=" '$(HarvestSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</HarvestSuppressSpecificWarnings>
35 <HarvestTreatWarningsAsErrors Condition=" '$(HarvestTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</HarvestTreatWarningsAsErrors>
36 <HarvestTreatSpecificWarningsAsErrors Condition=" '$(HarvestTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</HarvestTreatSpecificWarningsAsErrors>
37 <HarvestVerboseOutput Condition=" '$(HarvestVerboseOutput)' == '' ">$(VerboseOutput)</HarvestVerboseOutput>
38 <HarvestAutogenerateGuids Condition=" '$(HarvestAutogenerateGuids)' == '' ">true</HarvestAutogenerateGuids>
39 <HarvestGenerateGuidsNow Condition=" '$(HarvestGenerateGuidsNow)' == '' ">false</HarvestGenerateGuidsNow>
40 <HarvestSuppressFragments Condition=" '$(HarvestSuppressFragments)' == '' ">true</HarvestSuppressFragments>
41 <HarvestSuppressUniqueIds Condition=" '$(HarvestSuppressUniqueIds)' == '' ">false</HarvestSuppressUniqueIds>
42 </PropertyGroup>
43
44 <!-- Default HarvestProjects properties -->
45 <PropertyGroup>
46 <!-- Project harvesting is defaulted to off until it works more consistently. -->
47 <EnableProjectHarvesting Condition=" '$(EnableProjectHarvesting)'=='' ">false</EnableProjectHarvesting>
48
49 <HarvestProjectsNoLogo Condition=" '$(HarvestProjectsNoLogo)' == '' ">$(HarvestNoLogo)</HarvestProjectsNoLogo>
50 <HarvestProjectsSuppressAllWarnings Condition=" '$(HarvestProjectsSuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestProjectsSuppressAllWarnings>
51 <HarvestProjectsSuppressSpecificWarnings Condition=" '$(HarvestProjectsSuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestProjectsSuppressSpecificWarnings>
52 <HarvestProjectsTreatWarningsAsErrors Condition=" '$(HarvestProjectsTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestProjectsTreatWarningsAsErrors>
53 <HarvestProjectsTreatSpecificWarningsAsErrors Condition=" '$(HarvestProjectsTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestProjectsTreatSpecificWarningsAsErrors>
54 <HarvestProjectsVerboseOutput Condition=" '$(HarvestProjectsVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestProjectsVerboseOutput>
55 <HarvestProjectsAutogenerateGuids Condition=" '$(HarvestProjectsAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestProjectsAutogenerateGuids>
56 <HarvestProjectsGenerateGuidsNow Condition=" '$(HarvestProjectsGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestProjectsGenerateGuidsNow>
57 <HarvestProjectsSuppressFragments Condition=" '$(HarvestProjectsSuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestProjectsSuppressFragments>
58 <HarvestProjectsSuppressUniqueIds Condition=" '$(HarvestProjectsSuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestProjectsSuppressUniqueIds>
59 <HarvestProjectsTransforms Condition=" '$(HarvestProjectsTransforms)' == '' ">$(HarvestTransforms)</HarvestProjectsTransforms>
60 <HarvestProjectsGeneratedFile Condition=" '$(HarvestProjectsGeneratedFile)' == '' and '$(OutputType)' != 'Bundle' ">$(IntermediateOutputPath)Product.Generated.wxs</HarvestProjectsGeneratedFile>
61 <HarvestProjectsGeneratedFile Condition=" '$(HarvestProjectsGeneratedFile)' == '' and '$(OutputType)' == 'Bundle' ">$(IntermediateOutputPath)Bundle.Generated.wxs</HarvestProjectsGeneratedFile>
62 <HarvestProjectsMsbuildBinPath Condition=" '$(HarvestProjectsMsbuildBinPath)' == '' ">$(MSBuildBinPath)</HarvestProjectsMsbuildBinPath>
63 </PropertyGroup>
64
65 <!-- Default HarvestDirectory properties -->
66 <PropertyGroup>
67 <HarvestDirectoryNoLogo Condition=" '$(HarvestDirectoryNoLogo)' == '' ">$(HarvestNoLogo)</HarvestDirectoryNoLogo>
68 <HarvestDirectorySuppressAllWarnings Condition=" '$(HarvestDirectorySuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestDirectorySuppressAllWarnings>
69 <HarvestDirectorySuppressSpecificWarnings Condition=" '$(HarvestDirectorySuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestDirectorySuppressSpecificWarnings>
70 <HarvestDirectoryTreatWarningsAsErrors Condition=" '$(HarvestDirectoryTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestDirectoryTreatWarningsAsErrors>
71 <HarvestDirectoryTreatSpecificWarningsAsErrors Condition=" '$(HarvestDirectoryTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestDirectoryTreatSpecificWarningsAsErrors>
72 <HarvestDirectoryVerboseOutput Condition=" '$(HarvestDirectoryVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestDirectoryVerboseOutput>
73 <HarvestDirectoryAutogenerateGuids Condition=" '$(HarvestDirectoryAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestDirectoryAutogenerateGuids>
74 <HarvestDirectoryGenerateGuidsNow Condition=" '$(HarvestDirectoryGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestDirectoryGenerateGuidsNow>
75 <HarvestDirectorySuppressFragments Condition=" '$(HarvestDirectorySuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestDirectorySuppressFragments>
76 <HarvestDirectorySuppressUniqueIds Condition=" '$(HarvestDirectorySuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestDirectorySuppressUniqueIds>
77 <HarvestDirectoryTransforms Condition=" '$(HarvestDirectoryTransforms)' == '' ">$(HarvestTransforms)</HarvestDirectoryTransforms>
78 </PropertyGroup>
79
80 <!-- Default HarvestFile properties -->
81 <PropertyGroup>
82 <HarvestFileNoLogo Condition=" '$(HarvestFileNoLogo)' == '' ">$(HarvestNoLogo)</HarvestFileNoLogo>
83 <HarvestFileSuppressAllWarnings Condition=" '$(HarvestFileSuppressAllWarnings)' == '' ">$(HarvestSuppressAllWarnings)</HarvestFileSuppressAllWarnings>
84 <HarvestFileSuppressSpecificWarnings Condition=" '$(HarvestFileSuppressSpecificWarnings)' == '' ">$(HarvestSuppressSpecificWarnings)</HarvestFileSuppressSpecificWarnings>
85 <HarvestFileTreatWarningsAsErrors Condition=" '$(HarvestFileTreatWarningsAsErrors)' == '' ">$(HarvestTreatWarningsAsErrors)</HarvestFileTreatWarningsAsErrors>
86 <HarvestFileTreatSpecificWarningsAsErrors Condition=" '$(HarvestFileTreatSpecificWarningsAsErrors)' == '' ">$(HarvestTreatSpecificWarningsAsErrors)</HarvestFileTreatSpecificWarningsAsErrors>
87 <HarvestFileVerboseOutput Condition=" '$(HarvestFileVerboseOutput)' == '' ">$(HarvestVerboseOutput)</HarvestFileVerboseOutput>
88 <HarvestFileAutogenerateGuids Condition=" '$(HarvestFileAutogenerateGuids)' == '' ">$(HarvestAutogenerateGuids)</HarvestFileAutogenerateGuids>
89 <HarvestFileGenerateGuidsNow Condition=" '$(HarvestFileGenerateGuidsNow)' == '' ">$(HarvestGenerateGuidsNow)</HarvestFileGenerateGuidsNow>
90 <HarvestFileSuppressFragments Condition=" '$(HarvestFileSuppressFragments)' == '' ">$(HarvestSuppressFragments)</HarvestFileSuppressFragments>
91 <HarvestFileSuppressUniqueIds Condition=" '$(HarvestFileSuppressUniqueIds)' == '' ">$(HarvestSuppressUniqueIds)</HarvestFileSuppressUniqueIds>
92 <HarvestFileTransforms Condition=" '$(HarvestFileTransforms)' == '' ">$(HarvestTransforms)</HarvestFileTransforms>
93 </PropertyGroup>
94
95 <!--
96 ==================================================================================================
97 Harvest
98 ==================================================================================================
99 -->
100 <PropertyGroup>
101 <CoreCompileDependsOn>
102 $(CoreCompileDependsOn);
103 Harvest
104 </CoreCompileDependsOn>
105 <HarvestDependsOn>
106 ConvertReferences;
107 ConvertBundleReferences;
108 HarvestProjects;
109 HarvestDirectory;
110 HarvestFile;
111 GenerateCode;
112 </HarvestDependsOn>
113 </PropertyGroup>
114 <Target
115 Name="Harvest"
116 DependsOnTargets="$(HarvestDependsOn)" />
117
118 <!--
119 ==================================================================================================
120 GenerateCode
121 ==================================================================================================
122 -->
123 <PropertyGroup>
124 <GenerateCodeDependsOn>
125 RefreshGeneratedFile;
126 RefreshBundleGeneratedFile
127 </GenerateCodeDependsOn>
128 </PropertyGroup>
129 <Target
130 Name="GenerateCode"
131 DependsOnTargets="$(GenerateCodeDependsOn)" />
132
133 <!--
134 ================================================================================================
135 ConvertReferences
136
137 Converts project references to HeatProject items to auto generate authoring.
138 ================================================================================================
139 -->
140 <Target
141 Name="ConvertReferences"
142 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module') ">
143
144 <ItemGroup>
145 <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' ">
146 <DirectoryIds>%(_MSBuildProjectReferenceExistent.RefTargetDir)</DirectoryIds>
147 <ProjectOutputGroups>Binaries;Symbols;Sources;Content;Satellites;Documents</ProjectOutputGroups>
148 <ProjectName>%(_MSBuildProjectReferenceExistent.Name)</ProjectName>
149 <HeatOutput>$(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs</HeatOutput>
150 </_HeatProjectReference>
151 <HeatProject Include="@(_HeatProjectReference)" />
152 </ItemGroup>
153
154 <ItemGroup>
155 <!-- Unconditionally generate Compile items so they are always linked in. -->
156 <Compile Include="$(HarvestProjectsGeneratedFile)" />
157 <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" />
158 </ItemGroup>
159
160 </Target>
161
162 <!--
163 ================================================================================================
164 ConvertBundleReferences
165
166 Converts project references in Bundle projects to HeatProject items to auto generate authoring.
167 ================================================================================================
168 -->
169 <Target
170 Name="ConvertBundleReferences"
171 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Bundle') ">
172
173 <ItemGroup>
174 <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' ">
175 <ProjectOutputGroups>Binaries;Symbols;Sources;Content;Satellites;Documents</ProjectOutputGroups>
176 <GenerateType>payloadgroup</GenerateType>
177 <HeatOutput>$(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs</HeatOutput>
178 </_HeatProjectReference>
179 <HeatProject Include="@(_HeatProjectReference)" />
180 </ItemGroup>
181
182 <ItemGroup>
183 <!-- Unconditionally generate Compile items so they are always linked in. -->
184 <Compile Include="$(HarvestProjectsGeneratedFile)" />
185 <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" />
186 </ItemGroup>
187
188 </Target>
189
190 <!--
191 ================================================================================================
192 CombineHarvestProjects
193
194 Combines HeatProject and HarvestProject items together and ensures each has HeatOutput metadata.
195 ================================================================================================
196 -->
197 <Target
198 Name="CombineHarvestProjects"
199 Condition=" '@(HeatProject)' != '' or '@(HarvestProject)' != '' ">
200
201 <!-- Add default HeatOutputs for those without one specified -->
202 <CreateItem Include="@(HeatProject)" Condition= " '%(HeatProject.HeatOutput)' == '' "
203 AdditionalMetadata="HeatOutput=$(IntermediateOutputPath)_%(HeatProject.Filename).wxs">
204 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
205 </CreateItem>
206 <CreateItem Include="@(HarvestProject)" Condition= " '%(HarvestProject.HeatOutput)' == '' "
207 AdditionalMetadata="HeatOutput=$(IntermediateOutputPath)_%(HarvestProject.Filename).wxs">
208 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
209 </CreateItem>
210
211
212 <CreateItem Include="@(HeatProject)" Condition= " '%(HeatProject.HeatOutput)' != '' ">
213 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
214 </CreateItem>
215 <CreateItem Include="@(HarvestProject)" Condition= " '%(HarvestProject.HeatOutput)' != '' ">
216 <Output TaskParameter="Include" ItemName="_AllHeatProjects" />
217 </CreateItem>
218
219 </Target>
220
221 <!--
222 ================================================================================================
223 HarvestProjects
224
225 Harvests outputs of other MSBuild projects files using the VS project extension to heat.exe.
226
227 [IN]
228 @(HarvestProject)
229 @(HeatProject)
230 - The list of projects to harvest. HeatProject is provided for backward compatibility.
231 You should use HarvestProject instead.
232
233 %(HarvestProject.Transforms)
234 %(HeatProject.Transforms)
235 - XSL transforms to apply to the harvested WiX.
236
237 %(HarvestProject.ProjectOutputGroups)
238 %(HeatProjects.ProjectOutputGroups)
239 - The project output groups to harvest
240
241 [OUT]
242 %(HeatOutput)
243 - The generated .wxs files which are added to the @(Compile) item list.
244 ================================================================================================
245 -->
246 <ItemDefinitionGroup>
247 <HeatProject>
248 <Transforms>$(HarvestProjectsTransforms)</Transforms>
249 <ProjectOutputGroups>$(HarvestProjectsProjectOutputGroups)</ProjectOutputGroups>
250 <DirectoryIds>$(HarvestProjectsDirectoryIds)</DirectoryIds>
251 </HeatProject>
252 <HarvestProject>
253 <Transforms>$(HarvestProjectsTransforms)</Transforms>
254 <ProjectOutputGroups>$(HarvestProjectsProjectOutputGroups)</ProjectOutputGroups>
255 <DirectoryIds>$(HarvestProjectsDirectoryIds)</DirectoryIds>
256 </HarvestProject>
257 </ItemDefinitionGroup>
258
259 <PropertyGroup>
260 <HarvestProjectsDependsOn>CombineHarvestProjects</HarvestProjectsDependsOn>
261 </PropertyGroup>
262 <Target Name="HarvestProjects"
263 DependsOnTargets="$(HarvestProjectsDependsOn)"
264 Inputs="@(_AllHeatProjects);%(_AllHeatProjects.Transforms);$(ProjectPath)"
265 Outputs="@(_AllHeatProjects -> '%(HeatOutput)')"
266 Condition=" $(EnableProjectHarvesting) and ('@(HeatProject)' != '' or '@(HarvestProject)' != '') ">
267
268 <HeatProject
269 NoLogo="true"
270 SuppressAllWarnings="$(HarvestProjectsSuppressAllWarnings)"
271 SuppressSpecificWarnings="$(HarvestProjectsSuppressSpecificWarnings)"
272 TreatWarningsAsErrors="$(HarvestProjectsTreatWarningsAsErrors)"
273 TreatSpecificWarningsAsErrors="$(HarvestProjectsTreatSpecificWarningsAsErrors)"
274 VerboseOutput="$(HarvestProjectsVerboseOutput)"
275 AutogenerateGuids="$(HarvestProjectsAutogenerateGuids)"
276 GenerateGuidsNow="$(HarvestProjectsGenerateGuidsNow)"
277 OutputFile="%(_AllHeatProjects.HeatOutput)"
278 SuppressFragments="$(HarvestProjectsSuppressFragments)"
279 SuppressUniqueIds="$(HarvestProjectsSuppressUniqueIds)"
280 Transforms="%(_AllHeatProjects.Transforms)"
281 Project="%(_AllHeatProjects.FullPath)"
282 ProjectOutputGroups="%(_AllHeatProjects.ProjectOutputGroups)"
283 GenerateType="%(_AllHeatProjects.GenerateType)"
284 MsbuildBinPath="$(HarvestProjectsMsbuildBinPath)"
285 DirectoryIds="%(_AllHeatProjects.DirectoryIds)"
286 ProjectName="%(_AllHeatProjects.ProjectName)"
287 Configuration="%(_AllHeatProjects.Configuration)"
288 Platform="%(_AllHeatProjects.Platform)"
289 GenerateWixVariables="$(HarvestProjectsGenerateWixVariables)"
290 UseToolsVersion="$(HarvestProjectsUseToolsVersion)"
291 AdditionalOptions="$(HarvestProjectsAdditionalOptions)"
292 ToolPath="$(HeatToolDir)">
293
294 <Output TaskParameter="OutputFile" ItemName="Compile" />
295 <Output TaskParameter="OutputFile" ItemName="FileWrites" />
296
297 </HeatProject>
298
299 </Target>
300
301 <!--
302 ================================================================================================
303 HarvestDirectory
304
305 Harvests directories using heat.exe.
306
307 [IN]
308 @(HarvestDirectory) - The list of directories to harvest.
309 %(HarvestDirectory.Transforms) - XSL transforms to apply to the harvested WiX.
310 %(HarvestDirectory.ComponentGroupName) - The name of the ComponentGroup to create.
311 %(HarvestDirectory.DirectoryRefId) - The ID of the directory to reference instead of TARGETDIR.
312 %(HarvestDirectory.KeepEmptyDirectories) - Whether to create Directory entries for empty directories.
313 %(HarvestDirectory.PreprocessorVariable) - Substitute SourceDir for another variable name (ex: var.Dir).
314 %(HarvestDirectory.SuppressCom) - Suppress COM elements.
315 %(HarvestDirectory.SuppressRootDirectory) - Suppress a Directory element for the root directory.
316 $(HarvestDirectory.SuppressRegistry) - Suppress registry harvesting.
317
318 [OUT]
319 $(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs
320 - The generated .wxs files which are added to the @(Compile) item list.
321 ================================================================================================
322 -->
323
324 <ItemDefinitionGroup>
325 <HarvestDirectory>
326 <Transforms>$(HarvestDirectoryTransforms)</Transforms>
327 <ComponentGroupName>$(HarvestDirectoryComponentGroupName)</ComponentGroupName>
328 <DirectoryRefId>$(HarvestDirectoryDirectoryRefId)</DirectoryRefId>
329 <KeepEmptyDirectories>$(HarvestDirectoryKeepEmptyDirectories)</KeepEmptyDirectories>
330 <PreprocessorVariable>$(HarvestDirectoryPreprocessorVariable)</PreprocessorVariable>
331 <SuppressCom>$(HarvestDirectorySuppressCom)</SuppressCom>
332 <SuppressRootDirectory>$(HarvestDirectorySuppressRootDirectory)</SuppressRootDirectory>
333 <SuppressRegistry>$(HarvestDirectorySuppressRegistry)</SuppressRegistry>
334 </HarvestDirectory>
335 </ItemDefinitionGroup>
336
337 <PropertyGroup>
338 <HarvestDirectoryDependsOn>
339 GetHarvestDirectoryContent
340 </HarvestDirectoryDependsOn>
341 </PropertyGroup>
342
343 <!-- Creates items to include content since wildcards will not work in Target/@Inputs. -->
344 <Target Name="GetHarvestDirectoryContent">
345 <CreateItem Include="@(HarvestDirectory->'%(FullPath)\**\*')">
346 <Output TaskParameter="Include" ItemName="_HarvestDirectoryContent" />
347 </CreateItem>
348 </Target>
349
350 <Target Name="HarvestDirectory"
351 DependsOnTargets="$(HarvestDirectoryDependsOn)"
352 Inputs="@(_HarvestDirectoryContent);%(HarvestDirectory.Transforms)"
353 Outputs="$(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs"
354 Condition=" '@(HarvestDirectory)' != '' ">
355
356 <HeatDirectory
357 NoLogo="true"
358 SuppressAllWarnings="$(HarvestDirectorySuppressAllWarnings)"
359 SuppressSpecificWarnings="$(HarvestDirectorySuppressSpecificWarnings)"
360 TreatWarningsAsErrors="$(HarvestDirectoryTreatWarningsAsErrors)"
361 TreatSpecificWarningsAsErrors="$(HarvestDirectoryTreatSpecificWarningsAsErrors)"
362 VerboseOutput="$(HarvestDirectoryVerboseOutput)"
363 AutogenerateGuids="$(HarvestDirectoryAutogenerateGuids)"
364 GenerateGuidsNow="$(HarvestDirectoryGenerateGuidsNow)"
365 OutputFile="$(IntermediateOutputPath)_%(HarvestDirectory.ComponentGroupName)_dir.wxs"
366 SuppressFragments="$(HarvestDirectorySuppressFragments)"
367 SuppressUniqueIds="$(HarvestDirectorySuppressUniqueIds)"
368 Transforms="%(HarvestDirectory.Transforms)"
369 Directory="@(HarvestDirectory)"
370 ComponentGroupName="%(HarvestDirectory.ComponentGroupName)"
371 DirectoryRefId="%(HarvestDirectory.DirectoryRefId)"
372 KeepEmptyDirectories="%(HarvestDirectory.KeepEmptyDirectories)"
373 PreprocessorVariable="%(HarvestDirectory.PreprocessorVariable)"
374 SuppressCom="%(HarvestDirectory.SuppressCom)"
375 SuppressRootDirectory="%(HarvestDirectory.SuppressRootDirectory)"
376 SuppressRegistry="%(HarvestDirectory.SuppressRegistry)"
377 AdditionalOptions="$(HarvestDirectoryAdditionalOptions)"
378 ToolPath="$(HeatToolDir)">
379
380 <Output TaskParameter="OutputFile" ItemName="Compile" />
381 <Output TaskParameter="OutputFile" ItemName="FileWrites" />
382
383 </HeatDirectory>
384
385 </Target>
386
387 <!--
388 ================================================================================================
389 HarvestFile
390
391 Harvests files of different types using heat.exe. This can harvest registry from
392 self-registering files, files with typelibs, and more.
393
394 [IN]
395 @(HarvestFile) - The list of files to harvest.
396 %(HarvestFile.Transforms) - XSL transforms to apply to the harvested WiX.
397 %(HarvestFile.ComponentGroupName) - The name of the ComponentGroup to create.
398 %(HarvestFile.DirectoryRefId) - The ID of the directory to reference instead of TARGETDIR.
399 %(HarvestFile.PreprocessorVariable) - Substitute SourceDir for another variable name (ex: var.Dir).
400 %(HarvestFile.SuppressCom) - Suppress COM elements.
401 %(HarvestFile.SuppressRootDirectory) - Suppress a Directory element for the root directory.
402 $(HarvestFile.SuppressRegistry) - Suppress registry harvesting.
403
404 [OUT]
405 $(IntermediateOutputPath)_%(HarvestFile.Filename)_file.wxs
406 - The generated .wxs files which are added to the @(Compile) item list.
407 ================================================================================================
408 -->
409
410 <ItemDefinitionGroup>
411 <HarvestFile>
412 <Transforms>$(HarvestFileTransforms)</Transforms>
413 <ComponentGroupName>$(HarvestFileComponentGroupName)</ComponentGroupName>
414 <DirectoryRefId>$(HarvestFileDirectoryRefId)</DirectoryRefId>
415 <PreprocessorVariable>$(HarvestFilePreprocessorVariable)</PreprocessorVariable>
416 <SuppressCom>$(HarvestFileSuppressCom)</SuppressCom>
417 <SuppressRegistry>$(HarvestFileSuppressRegistry)</SuppressRegistry>
418 <SuppressRootDirectory>$(HarvestFileSuppressRootDirectory)</SuppressRootDirectory>
419 </HarvestFile>
420 </ItemDefinitionGroup>
421
422 <PropertyGroup>
423 <HarvestFileDependsOn></HarvestFileDependsOn>
424 </PropertyGroup>
425 <Target Name="HarvestFile"
426 DependsOnTargets="$(HarvestFileDependsOn)"
427 Inputs="@(HarvestFile);%(HarvestFile.Transforms)"
428 Outputs="@(HarvestFile->'$(IntermediateOutputPath)_%(ComponentGroupName)_%(DirectoryRefId)_%(Filename)%(Extension)_file.wxs')"
429 Condition=" '@(HarvestFile)' != '' ">
430
431 <HeatFile
432 NoLogo="true"
433 SuppressAllWarnings="$(HarvestFileSuppressAllWarnings)"
434 SuppressSpecificWarnings="$(HarvestFileSuppressSpecificWarnings)"
435 TreatWarningsAsErrors="$(HarvestFileTreatWarningsAsErrors)"
436 TreatSpecificWarningsAsErrors="$(HarvestFileTreatSpecificWarningsAsErrors)"
437 VerboseOutput="$(HarvestFileVerboseOutput)"
438 AutogenerateGuids="$(HarvestFileAutogenerateGuids)"
439 GenerateGuidsNow="$(HarvestFileGenerateGuidsNow)"
440 OutputFile="$(IntermediateOutputPath)_%(HarvestFile.ComponentGroupName)_%(HarvestFile.DirectoryRefId)_%(HarvestFile.Filename)%(HarvestFile.Extension)_file.wxs"
441 SuppressFragments="$(HarvestFileSuppressFragments)"
442 SuppressUniqueIds="$(HarvestFileSuppressUniqueIds)"
443 Transforms="%(HarvestFile.Transforms)"
444 File="@(HarvestFile)"
445 ComponentGroupName="%(HarvestFile.ComponentGroupName)"
446 DirectoryRefId="%(HarvestFile.DirectoryRefId)"
447 PreprocessorVariable="%(HarvestFile.PreprocessorVariable)"
448 SuppressCom="%(HarvestFile.SuppressCom)"
449 SuppressRegistry="%(HarvestFile.SuppressRegistry)"
450 SuppressRootDirectory="%(HarvestFile.SuppressRootDirectory)"
451 AdditionalOptions="$(HarvestFileAdditionalOptions)"
452 ToolPath="$(HeatToolDir)">
453
454 <Output TaskParameter="OutputFile" ItemName="Compile" />
455 <Output TaskParameter="OutputFile" ItemName="FileWrites" />
456
457 </HeatFile>
458
459 </Target>
460
461 <!--
462 ================================================================================================
463 RefreshGeneratedFile
464
465 Generates code based on metadata defined in project references.
466
467 [IN]
468 @(_MSBuildResolvedProjectReferencePaths) - The list of MSBuildable project references.
469
470 [OUT]
471 @(_GeneratedFiles) - The generated source file.
472 ================================================================================================
473 -->
474 <PropertyGroup>
475 <RefreshGeneratedFileDependsOn></RefreshGeneratedFileDependsOn>
476 </PropertyGroup>
477 <Target Name="RefreshGeneratedFile"
478 DependsOnTargets="$(RefreshGeneratedFileDependsOn)"
479 Inputs="@(_MSBuildResolvedProjectReferencePaths);@(Compile);$(ProjectPath)"
480 Outputs="@(_GeneratedFiles)"
481 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module') and '@(_GeneratedFiles)' != '' ">
482
483 <RefreshGeneratedFile
484 GeneratedFiles="@(_GeneratedFiles)"
485 ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" />
486
487 </Target>
488
489 <!--
490 ================================================================================================
491 RefreshBundleGeneratedFile
492
493 Generates code for bundle projects based on metadata defined in project references.
494
495 [IN]
496 @(_MSBuildResolvedProjectReferencePaths) - The list of MSBuildable project references.
497
498 [OUT]
499 @(_GeneratedFiles) - The generated source file.
500 ================================================================================================
501 -->
502 <PropertyGroup>
503 <RefreshBundleGeneratedFileDependsOn></RefreshBundleGeneratedFileDependsOn>
504 </PropertyGroup>
505 <Target Name="RefreshBundleGeneratedFile"
506 DependsOnTargets="$(RefreshBundleGeneratedFileDependsOn)"
507 Inputs="@(_MSBuildResolvedProjectReferencePaths);@(Compile);$(ProjectPath)"
508 Outputs="@(_GeneratedFiles)"
509 Condition=" $(EnableProjectHarvesting) and ('$(OutputType)' == 'Bundle' and '@(_GeneratedFiles)' != '') ">
510
511 <RefreshBundleGeneratedFile
512 GeneratedFiles="@(_GeneratedFiles)"
513 ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" />
514 </Target>
515
516</Project>