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