diff options
Diffstat (limited to 'src/WixToolset.BuildTasks/wix.targets')
-rw-r--r-- | src/WixToolset.BuildTasks/wix.targets | 1356 |
1 files changed, 0 insertions, 1356 deletions
diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets deleted file mode 100644 index c9704094..00000000 --- a/src/WixToolset.BuildTasks/wix.targets +++ /dev/null | |||
@@ -1,1356 +0,0 @@ | |||
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" InitialTargets="_CheckRequiredProperties" DefaultTargets="Build"> | ||
6 | <PropertyGroup> | ||
7 | <WixTargetsImported>true</WixTargetsImported> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <!-- | ||
11 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
12 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
13 | Extension Points | ||
14 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
15 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
16 | --> | ||
17 | |||
18 | <!-- Allow a user-customized targets files to be used as part of the build. --> | ||
19 | <Import Project="$(CustomBeforeWixTargets)" Condition=" '$(CustomBeforeWixTargets)' != '' and Exists('$(CustomBeforeWixTargets)')" /> | ||
20 | |||
21 | <!-- These properties can be overridden to support non-default installations. --> | ||
22 | <PropertyGroup> | ||
23 | <WixBinDir Condition=" '$(WixBinDir)' == ''">$(MSBuildThisFileDirectory)</WixBinDir> | ||
24 | <WixTasksPath Condition=" '$(WixTasksPath)' == '' ">$(WixBinDir)WixToolset.BuildTasks.dll</WixTasksPath> | ||
25 | <WixHarvestTargetsPath Condition=" '$(WixHarvestTargetsPath)' == '' ">$(WixBinDir)wix.harvest.targets</WixHarvestTargetsPath> | ||
26 | <WixSigningTargetsPath Condition=" '$(WixSigningTargetsPath)' == '' ">$(WixBinDir)wix.signing.targets</WixSigningTargetsPath> | ||
27 | <LuxTargetsPath Condition=" '$(LuxTargetsPath)' == '' ">$(WixBinDir)lux.targets</LuxTargetsPath> | ||
28 | <LuxTasksPath Condition=" '$(LuxTasksPath)' == '' ">$(WixBinDir)LuxTasks.dll</LuxTasksPath> | ||
29 | </PropertyGroup> | ||
30 | |||
31 | <!-- This makes the project files a dependency of all targets so that things rebuild if they change --> | ||
32 | <PropertyGroup> | ||
33 | <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> | ||
34 | <MSBuildAllProjects Condition="Exists('$(WixHarvestTargetsPath)')">$(MSBuildAllProjects);$(WixHarvestTargetsPath)</MSBuildAllProjects> | ||
35 | <MSBuildAllProjects Condition="Exists('$(WixSigningTargetsPath)')">$(MSBuildAllProjects);$(WixSigningTargetsPath)</MSBuildAllProjects> | ||
36 | <MSBuildAllProjects Condition="Exists('$(LuxTargetsPath)')">$(MSBuildAllProjects);$(LuxTargetsPath)</MSBuildAllProjects> | ||
37 | <MSBuildAllProjects Condition="Exists('$(CustomBeforeWixTargets)')">$(MSBuildAllProjects);$(CustomBeforeWixTargets)</MSBuildAllProjects> | ||
38 | <MSBuildAllProjects Condition="Exists('$(CustomAfterWixTargets)')">$(MSBuildAllProjects);$(CustomAfterWixTargets)</MSBuildAllProjects> | ||
39 | </PropertyGroup> | ||
40 | |||
41 | <!-- | ||
42 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
43 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
44 | Declarations for Microsoft.Common.targets | ||
45 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
46 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
47 | --> | ||
48 | |||
49 | <PropertyGroup> | ||
50 | <DefaultLanguageSourceExtension>.wxs</DefaultLanguageSourceExtension> | ||
51 | <Language>wix</Language> | ||
52 | <TargetRuntime>Managed</TargetRuntime> | ||
53 | |||
54 | <!-- Use OutputName to set the AssemblyName for Microsoft.Common.targets --> | ||
55 | <OutputName Condition=" '$(OutputName)'=='' ">$(MSBuildProjectName)</OutputName> | ||
56 | <AssemblyName>$(OutputName)</AssemblyName> | ||
57 | |||
58 | <!-- Default the OutputType to a known WiX toolset TYPE. --> | ||
59 | <_OriginalOutputType>$(OutputType)</_OriginalOutputType> | ||
60 | <OutputType Condition=" '$(OutputType)' == '' ">Package</OutputType> | ||
61 | </PropertyGroup> | ||
62 | |||
63 | <!-- | ||
64 | IDE Macros available from both integrated builds and from command line builds. | ||
65 | The following properties are 'macros' that are available via IDE for pre and post build steps. | ||
66 | All of them should be added to WixBuildMacroCollection to ensure that they are shown in the UI. | ||
67 | --> | ||
68 | <PropertyGroup> | ||
69 | <TargetExt Condition=" '$(OutputType)' == 'Package' ">.msi</TargetExt> | ||
70 | <TargetExt Condition=" '$(OutputType)' == 'Module' ">.msm</TargetExt> | ||
71 | <TargetExt Condition=" '$(OutputType)' == 'PatchCreation' ">.pcp</TargetExt> | ||
72 | <TargetExt Condition=" '$(OutputType)' == 'Library' ">.wixlib</TargetExt> | ||
73 | <TargetExt Condition=" '$(OutputType)' == 'Bundle' ">.exe</TargetExt> | ||
74 | </PropertyGroup> | ||
75 | |||
76 | <!-- Provide the correct output name for the .wixpdb --> | ||
77 | <ItemGroup Condition="'$(_DebugSymbolsProduced)' == 'true'"> | ||
78 | <_DebugSymbolsIntermediatePath Include="$(PdbOutputDir)$(TargetPdbName)" Condition=" '@(_DebugSymbolsIntermediatePath)' == '' " /> | ||
79 | </ItemGroup> | ||
80 | |||
81 | <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" /> | ||
82 | |||
83 | <PropertyGroup> | ||
84 | <!-- Default pdb output path to the intermediate output directory --> | ||
85 | <PdbOutputDir Condition=" '$(PdbOutputDir)'=='' ">$(IntermediateOutputPath)</PdbOutputDir> | ||
86 | <PdbOutputDir Condition=" '$(PdbOutputDir)' != '' and !HasTrailingSlash('$(PdbOutputDir)') ">$(PdbOutputDir)\</PdbOutputDir> | ||
87 | |||
88 | <!-- Example, C:\MyProjects\MyProject\bin\debug\ --> | ||
89 | <TargetPdbDir Condition=" '$(PdbOutputDir)'!='' ">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`))</TargetPdbDir> | ||
90 | |||
91 | <!-- Example, MySetup.wixpdb" --> | ||
92 | <TargetPdbName Condition=" '$(TargetPdbName)' == '' ">$(TargetName).wixpdb</TargetPdbName> | ||
93 | |||
94 | <!-- Example, C:\MyProjects\MyProject\bin\debug\MyPackage.wixpdb --> | ||
95 | <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">$(TargetPdbDir)$(TargetPdbName)</TargetPdbPath> | ||
96 | </PropertyGroup> | ||
97 | |||
98 | <!-- | ||
99 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
100 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
101 | Property Declarations | ||
102 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
103 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
104 | --> | ||
105 | |||
106 | <!-- These tasks can be used as general-purpose build tasks. --> | ||
107 | <UsingTask TaskName="Candle" AssemblyFile="$(WixTasksPath)" /> | ||
108 | <UsingTask TaskName="DoIt" AssemblyFile="$(WixTasksPath)" /> | ||
109 | <UsingTask TaskName="Lit" AssemblyFile="$(WixTasksPath)" /> | ||
110 | <UsingTask TaskName="Light" AssemblyFile="$(WixTasksPath)" /> | ||
111 | <UsingTask TaskName="Torch" AssemblyFile="$(WixTasksPath)" /> | ||
112 | |||
113 | <!-- These tasks are specific to the build process defined in this file, and are not considered general-purpose build tasks. --> | ||
114 | <UsingTask TaskName="CreateItemAvoidingInference" AssemblyFile="$(WixTasksPath)" /> | ||
115 | <UsingTask TaskName="CreateProjectReferenceDefineConstants" AssemblyFile="$(WixTasksPath)" /> | ||
116 | <UsingTask TaskName="WixAssignCulture" AssemblyFile="$(WixTasksPath)" /> | ||
117 | <UsingTask TaskName="ResolveWixReferences" AssemblyFile="$(WixTasksPath)"/> | ||
118 | <UsingTask TaskName="ReplaceString" AssemblyFile="$(WixTasksPath)"/> | ||
119 | <UsingTask TaskName="GetCabList" AssemblyFile="$(WixTasksPath)" /> | ||
120 | <UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" /> | ||
121 | <UsingTask TaskName="GenerateCompileWithObjectPath" AssemblyFile="$(WixTasksPath)"/> | ||
122 | |||
123 | <!-- WiX tools are 32bit EXEs, so run them out-of-proc when MSBuild is not 32bit. --> | ||
124 | <PropertyGroup> | ||
125 | <RunWixToolsOutOfProc Condition=" '$(PROCESSOR_ARCHITECTURE)'!='x86' ">true</RunWixToolsOutOfProc> | ||
126 | </PropertyGroup> | ||
127 | |||
128 | <PropertyGroup> | ||
129 | <BindContentsFile Condition=" '$(BindContentsFile)' == '' ">$(MSBuildProjectFile).BindContentsFileList.txt</BindContentsFile> | ||
130 | <BindOutputsFile Condition=" '$(BindOutputsFile)' == '' ">$(MSBuildProjectFile).BindOutputsFileList.txt</BindOutputsFile> | ||
131 | <BindBuiltOutputsFile Condition=" '$(BindBuiltOutputsFile)' == '' ">$(MSBuildProjectFile).BindBuiltOutputsFileList.txt</BindBuiltOutputsFile> | ||
132 | </PropertyGroup> | ||
133 | |||
134 | <PropertyGroup> | ||
135 | <CabinetCachePath Condition=" '$(CabinetCachePath)'=='' and '$(ReuseCabinetCache)'=='true' ">$(IntermediateOutputPath)cabcache\</CabinetCachePath> | ||
136 | </PropertyGroup> | ||
137 | |||
138 | <PropertyGroup> | ||
139 | <WixToolDir Condition=" '$(WixToolDir)' == ''">$(WixBinDir)</WixToolDir> | ||
140 | <WixExtDir Condition=" '$(WixExtDir)' == ''">$(WixToolDir)</WixExtDir> | ||
141 | </PropertyGroup> | ||
142 | |||
143 | <!-- | ||
144 | Set the SignTargetPath item directly when output is a Bundle. The AssignCultures target | ||
145 | sets SignTargetPath item for other output types based on the cultures provided. | ||
146 | --> | ||
147 | <ItemGroup> | ||
148 | <SignTargetPath Include="$(TargetPath)" Condition=" '$(OutputType)' == 'Bundle' AND '$(SignOutput)' == 'true' AND '$(SuppressLayout)' != 'true' " /> | ||
149 | </ItemGroup> | ||
150 | |||
151 | <!-- | ||
152 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
153 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
154 | Default Compiler, Linker, and Librarian Property Declarations | ||
155 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
156 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
157 | --> | ||
158 | |||
159 | <!-- If WixExtension was passed in via the command line, then convert it to an ItemGroup --> | ||
160 | <ItemGroup> | ||
161 | <WixExtension Include="$(WixExtension)" Condition=" '$(WixExtension)' != '' " /> | ||
162 | </ItemGroup> | ||
163 | |||
164 | <!-- Defaut Compiler properties. --> | ||
165 | <PropertyGroup> | ||
166 | <CompilerNoLogo Condition=" '$(CompilerNoLogo)' == '' ">$(NoLogo)</CompilerNoLogo> | ||
167 | <CompilerSuppressAllWarnings Condition=" '$(CompilerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</CompilerSuppressAllWarnings> | ||
168 | <CompilerSuppressSpecificWarnings Condition=" '$(CompilerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</CompilerSuppressSpecificWarnings> | ||
169 | <CompilerTreatWarningsAsErrors Condition=" '$(CompilerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</CompilerTreatWarningsAsErrors> | ||
170 | <CompilerTreatSpecificWarningsAsErrors Condition=" '$(CompilerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</CompilerTreatSpecificWarningsAsErrors> | ||
171 | <CompilerVerboseOutput Condition=" '$(CompilerVerboseOutput)' == '' ">$(VerboseOutput)</CompilerVerboseOutput> | ||
172 | <!-- TODO: This probably doesn't work any longer since Platform won't be defined until Microsoft.Common.targets is included --> | ||
173 | <InstallerPlatform Condition=" '$(InstallerPlatform)' == '' and '$(Platform)' != 'AnyCPU' and '$(Platform)' != 'Any CPU' ">$(Platform)</InstallerPlatform> | ||
174 | </PropertyGroup> | ||
175 | |||
176 | <!-- Default Lib properties. --> | ||
177 | <PropertyGroup> | ||
178 | <LibNoLogo Condition=" '$(LibNoLogo)' == '' ">$(NoLogo)</LibNoLogo> | ||
179 | <LibBindFiles Condition=" '$(LibBindFiles)' == '' ">$(BindFiles)</LibBindFiles> | ||
180 | <LibPedantic Condition=" '$(LibPedantic)' == '' ">$(Pedantic)</LibPedantic> | ||
181 | <LibSuppressAllWarnings Condition=" '$(LibSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LibSuppressAllWarnings> | ||
182 | <LibSuppressSpecificWarnings Condition=" '$(LibSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LibSuppressSpecificWarnings> | ||
183 | <LibSuppressSchemaValidation Condition=" '$(LibSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LibSuppressSchemaValidation> | ||
184 | <LibSuppressIntermediateFileVersionMatching Condition=" '$(LibSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LibSuppressIntermediateFileVersionMatching> | ||
185 | <LibTreatWarningsAsErrors Condition=" '$(LibTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LibTreatWarningsAsErrors> | ||
186 | <LibTreatSpecificWarningsAsErrors Condition=" '$(LibTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LibTreatSpecificWarningsAsErrors> | ||
187 | <LibVerboseOutput Condition=" '$(LibVerboseOutput)' == '' ">$(VerboseOutput)</LibVerboseOutput> | ||
188 | </PropertyGroup> | ||
189 | |||
190 | <!-- Default Linker properties. --> | ||
191 | <PropertyGroup> | ||
192 | <LinkerNoLogo Condition=" '$(LinkerNoLogo)' == '' ">$(NoLogo)</LinkerNoLogo> | ||
193 | <LinkerBindFiles Condition=" '$(LinkerBindFiles)' == '' ">$(BindFiles)</LinkerBindFiles> | ||
194 | <LinkerPedantic Condition=" '$(LinkerPedantic)' == '' ">$(Pedantic)</LinkerPedantic> | ||
195 | <LinkerSuppressAllWarnings Condition=" '$(LinkerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LinkerSuppressAllWarnings> | ||
196 | <LinkerSuppressSpecificWarnings Condition=" '$(LinkerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LinkerSuppressSpecificWarnings> | ||
197 | <LinkerSuppressSchemaValidation Condition=" '$(LinkerSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LinkerSuppressSchemaValidation> | ||
198 | <LinkerSuppressIntermediateFileVersionMatching Condition=" '$(LinkerSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LinkerSuppressIntermediateFileVersionMatching> | ||
199 | <LinkerTreatWarningsAsErrors Condition=" '$(LinkerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LinkerTreatWarningsAsErrors> | ||
200 | <LinkerTreatSpecificWarningsAsErrors Condition=" '$(LinkerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LinkerTreatSpecificWarningsAsErrors> | ||
201 | <LinkerVerboseOutput Condition=" '$(LinkerVerboseOutput)' == '' ">$(VerboseOutput)</LinkerVerboseOutput> | ||
202 | </PropertyGroup> | ||
203 | |||
204 | <!-- If BindInputPaths (or LinkerBindInputPaths) was passed in via the command line, then convert it to an ItemGroup --> | ||
205 | <ItemGroup> | ||
206 | <BindInputPaths Include="$(BindInputPaths)" Condition=" '$(BindInputPaths)' != '' " /> | ||
207 | <LinkerBindInputPaths Include="$(LinkerBindInputPaths)" Condition=" '$(LinkerBindInputPaths)' != '' " /> | ||
208 | </ItemGroup> | ||
209 | |||
210 | <!-- Default Lit and Light "properties" --> | ||
211 | <ItemGroup> | ||
212 | <LinkerBindInputPaths Condition=" '@(LinkerBindInputPaths)' == '' " Include="@(BindInputPaths)" /> | ||
213 | </ItemGroup> | ||
214 | |||
215 | <!-- | ||
216 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
217 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
218 | Initial Targets | ||
219 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
220 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
221 | --> | ||
222 | |||
223 | <!-- | ||
224 | ================================================================================================== | ||
225 | _CheckRequiredProperties | ||
226 | |||
227 | Checks properties that must be set in the main project file or on the command line before | ||
228 | using this .TARGETS file. | ||
229 | |||
230 | [IN] | ||
231 | $(OutputName) - The name of the MSI/MSM/wixlib to build (without the extension) | ||
232 | $(OutputType) - Possible values are 'package', 'PatchCreation', 'module', 'library', 'bundle' | ||
233 | ================================================================================================== | ||
234 | --> | ||
235 | <PropertyGroup> | ||
236 | <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file.</_PleaseSetThisInProjectFile> | ||
237 | <_OutputTypeDescription>The OutputType defines whether a Windows Installer package (.msi), PatchCreation (.pcp), merge module (.msm), wix library (.wixlib), or self-extracting executable (.exe) is being built. $(_PleaseSetThisInProjectFile) Possible values are 'Package', 'Module', 'Library', and 'Bundle'.</_OutputTypeDescription> | ||
238 | </PropertyGroup> | ||
239 | <Target Name="_CheckRequiredProperties"> | ||
240 | |||
241 | <Error | ||
242 | Code="WIXTARGETS100" | ||
243 | Condition=" '$(OutputName)' == '' " | ||
244 | Text="The OutputName property is not set in project "$(MSBuildProjectFile)". The OutputName defines the name of the output without a file extension. $(_PleaseSetThisInProjectFile)" /> | ||
245 | |||
246 | <Warning | ||
247 | Code="WIXTARGETS101" | ||
248 | Condition=" '$(_OriginalOutputType)' == '' " | ||
249 | Text="The OutputType property is not set in project "$(MSBuildProjectFile)". Defaulting to '$(OutputType)'. $(_OutputTypeDescription)" /> | ||
250 | |||
251 | <Error | ||
252 | Code="WIXTARGETS102" | ||
253 | Condition=" '$(OutputType)' != 'Package' and '$(OutputType)' != 'PatchCreation' and '$(OutputType)' != 'Module' and '$(OutputType)' != 'Library' and '$(OutputType)' != 'Bundle' " | ||
254 | Text="The OutputType property '$(OutputType)' is not valid in project "$(MSBuildProjectFile)". $(_OutputTypeDescription)" /> | ||
255 | |||
256 | <Error | ||
257 | Code="WIXTARGETS103" | ||
258 | Condition=" '$(MSBuildToolsVersion)' == '' OR '$(MSBuildToolsVersion)' < '4.0' " | ||
259 | Text="MSBuild v$(MSBuildToolsVersion) is not supported by the project "$(MSBuildProjectFile)". You must use MSBuild v4.0 or later." /> | ||
260 | |||
261 | </Target> | ||
262 | |||
263 | <!-- | ||
264 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
265 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
266 | Build Targets | ||
267 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
268 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
269 | --> | ||
270 | |||
271 | <!-- | ||
272 | ================================================================================================== | ||
273 | CoreBuild - OVERRIDE DependsOn | ||
274 | |||
275 | The core build step calls each of the build targets. | ||
276 | |||
277 | This is where we insert our targets into the build process. | ||
278 | ================================================================================================== | ||
279 | --> | ||
280 | <PropertyGroup> | ||
281 | <CoreBuildDependsOn> | ||
282 | BuildOnlySettings; | ||
283 | PrepareForBuild; | ||
284 | PreBuildEvent; | ||
285 | ResolveReferences; | ||
286 | |||
287 | <!--CompileAndLink;--> | ||
288 | DoIt; | ||
289 | Signing; | ||
290 | |||
291 | GetTargetPath; | ||
292 | PrepareForRun; | ||
293 | IncrementalClean; | ||
294 | PostBuildEvent | ||
295 | </CoreBuildDependsOn> | ||
296 | </PropertyGroup> | ||
297 | |||
298 | |||
299 | <!-- | ||
300 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
301 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
302 | Resolve References Targets | ||
303 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
304 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
305 | --> | ||
306 | |||
307 | <!-- | ||
308 | ================================================================================================== | ||
309 | ResolveReferences - OVERRIDE DependsOn | ||
310 | |||
311 | ================================================================================================== | ||
312 | --> | ||
313 | <PropertyGroup> | ||
314 | <ResolveReferencesDependsOn> | ||
315 | BeforeResolveReferences; | ||
316 | AssignProjectConfiguration; | ||
317 | ResolveProjectReferences; | ||
318 | ResolveWixLibraryReferences; | ||
319 | ResolveWixExtensionReferences; | ||
320 | AfterResolveReferences | ||
321 | </ResolveReferencesDependsOn> | ||
322 | </PropertyGroup> | ||
323 | |||
324 | <!-- | ||
325 | ================================================================================================ | ||
326 | ResolveProjectReferences | ||
327 | |||
328 | Builds all of the referenced projects to get their outputs. | ||
329 | |||
330 | [IN] | ||
331 | @(NonVCProjectReference) - The list of non-VC project references. | ||
332 | |||
333 | [OUT] | ||
334 | @(ProjectReferenceWithConfiguration) - The list of non-VC project references. | ||
335 | @(WixLibProjects) - Paths to any .wixlibs that were built by referenced projects. | ||
336 | ================================================================================================ | ||
337 | --> | ||
338 | <Target | ||
339 | Name="ResolveProjectReferences" | ||
340 | DependsOnTargets="AssignProjectConfiguration;_SplitProjectReferencesByFileExistence" | ||
341 | Condition=" '@(ProjectReferenceWithConfiguration)' != '' "> | ||
342 | |||
343 | <!-- Issue a warning for each non-existent project. --> | ||
344 | <Warning | ||
345 | Text="The referenced project '%(_MSBuildProjectReferenceNonexistent.Identity)' does not exist." | ||
346 | Condition=" '@(_MSBuildProjectReferenceNonexistent)' != '' " /> | ||
347 | |||
348 | <!-- | ||
349 | When building this project from the IDE or when building a .sln from the command line or | ||
350 | when only building .wixlib project references, gather the referenced build outputs. The | ||
351 | code that builds the .sln will already have built the project, so there's no need to do | ||
352 | it again here and when building only .wixlib project references we'll use the results to | ||
353 | determine which projects to build. | ||
354 | |||
355 | The ContinueOnError setting is here so that, during project load, as much information as | ||
356 | possible will be passed to the compilers. | ||
357 | --> | ||
358 | <MSBuild | ||
359 | Projects="@(_MSBuildProjectReferenceExistent)" | ||
360 | Targets="%(_MSBuildProjectReferenceExistent.Targets);GetTargetPath" | ||
361 | Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);%(_MSBuildProjectReferenceExistent.SetPlatform)" | ||
362 | Condition="('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '@(_MSBuildProjectReferenceExistent)' != '' " | ||
363 | ContinueOnError="!$(BuildingProject)"> | ||
364 | |||
365 | <Output TaskParameter="TargetOutputs" ItemName="_GatheredProjectReferencePaths" /> | ||
366 | </MSBuild> | ||
367 | |||
368 | <!-- | ||
369 | Determine which project references should be built. Note: we will not build any project references | ||
370 | if building in the IDE because it builds project references directly. | ||
371 | |||
372 | If BuildProjectReferences is 'true' (the default) then take all MSBuild project references that exist | ||
373 | on disk and add them to the list of things to build. This is the easy case. | ||
374 | --> | ||
375 | <CreateItem | ||
376 | Include="@(_MSBuildProjectReferenceExistent)" | ||
377 | Condition=" '$(BuildProjectReferences)' == 'true' and '$(BuildingInsideVisualStudio)' != 'true' "> | ||
378 | |||
379 | <Output TaskParameter="Include" ItemName="_ProjectReferencesToBuild" /> | ||
380 | </CreateItem> | ||
381 | |||
382 | <!-- | ||
383 | If BuildProjectReferences is 'wixlib' then build only the MSBuild project references that exist and | ||
384 | create a .wixlib file. That requires us to first filter the gathered project references down to only | ||
385 | those that build .wixlibs. | ||
386 | --> | ||
387 | <CreateItem | ||
388 | Include="@(_GatheredProjectReferencePaths)" | ||
389 | Condition=" '$(BuildProjectReferences)' == 'wixlib' and '%(Extension)' == '.wixlib' and '$(BuildingInsideVisualStudio)' != 'true' "> | ||
390 | |||
391 | <Output TaskParameter="Include" ItemName="_ReferencedWixLibPaths" /> | ||
392 | </CreateItem> | ||
393 | |||
394 | <!-- | ||
395 | The second step when building only 'wixlib' project references is to create the list of existing MSBuild | ||
396 | project references that do *not* build a .wixlib. These are the projects that will be skipped. | ||
397 | --> | ||
398 | <CreateItem | ||
399 | Include="@(_MSBuildProjectReferenceExistent->'%(FullPath)')" | ||
400 | Exclude="@(_ReferencedWixLibPaths->'%(MSBuildSourceProjectFile)')" | ||
401 | Condition=" '$(BuildProjectReferences)' == 'wixlib' and '$(BuildingInsideVisualStudio)' != 'true' "> | ||
402 | |||
403 | <Output TaskParameter="Include" ItemName="_ProjectReferencesToSkip" /> | ||
404 | </CreateItem> | ||
405 | |||
406 | <!-- | ||
407 | Finally, when building only 'wixlib' project references, the list of projects to build are naturally the | ||
408 | list of projects *not* being skipped. | ||
409 | --> | ||
410 | <CreateItem | ||
411 | Include="@(_MSBuildProjectReferenceExistent->'%(FullPath)')" | ||
412 | Exclude="@(_ProjectReferencesToSkip)" | ||
413 | Condition=" '$(BuildProjectReferences)' == 'wixlib' and '$(BuildingInsideVisualStudio)' != 'true' "> | ||
414 | |||
415 | <Output TaskParameter="Include" ItemName="_ProjectReferencesToBuild" /> | ||
416 | </CreateItem> | ||
417 | |||
418 | <!-- Display a warning for all projects being skipped. --> | ||
419 | <Warning | ||
420 | Text="BuildProjectReferences set to '$(BuildProjectReferences)'. Skipping the non-Library project: %(_ProjectReferencesToSkip.Identity)" | ||
421 | Condition=" '@(_ProjectReferencesToSkip)' != '' " /> | ||
422 | |||
423 | <Message | ||
424 | Importance="low" | ||
425 | Text="Project reference to build: %(_ProjectReferencesToBuild.Identity), properties: %(_ProjectReferencesToBuild.Properties)" | ||
426 | Condition=" '@(_ProjectReferencesToBuild)' != '' " /> | ||
427 | |||
428 | <!-- | ||
429 | Build referenced projects when building from the command line. | ||
430 | |||
431 | The $(ProjectReferenceBuildTargets) will normally be blank so that the project's default target | ||
432 | is used during a P2P reference. However if a custom build process requires that the referenced | ||
433 | project has a different target to build it can be specified. | ||
434 | --> | ||
435 | <MSBuild | ||
436 | Projects="@(_ProjectReferencesToBuild)" | ||
437 | Targets="$(ProjectReferenceBuildTargets)" | ||
438 | Properties="%(_ProjectReferencesToBuild.SetConfiguration);%(_ProjectReferencesToBuild.SetPlatform)" | ||
439 | Condition=" '@(_ProjectReferencesToBuild)' != '' "> | ||
440 | |||
441 | <Output TaskParameter="TargetOutputs" ItemName="_BuiltProjectReferencePaths" /> | ||
442 | </MSBuild> | ||
443 | |||
444 | <!-- | ||
445 | VC project references must build GetNativeTargetPath because neither GetTargetPath nor the return of the default build | ||
446 | target return the output for a native .vcxproj. | ||
447 | --> | ||
448 | <MSBuild | ||
449 | Projects="@(_MSBuildProjectReferenceExistent)" | ||
450 | Targets="GetNativeTargetPath" | ||
451 | Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);%(_MSBuildProjectReferenceExistent.SetPlatform)" | ||
452 | Condition=" '@(ProjectReferenceWithConfiguration)' != '' and '%(_MSBuildProjectReferenceExistent.Extension)' == '.vcxproj' "> | ||
453 | |||
454 | <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" /> | ||
455 | <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" /> | ||
456 | </MSBuild> | ||
457 | |||
458 | <!-- Assign the unique gathered and built project references to the resolved project | ||
459 | reference paths. --> | ||
460 | <RemoveDuplicates Inputs="@(_GatheredProjectReferencePaths);@(_BuiltProjectReferencePaths)"> | ||
461 | <Output TaskParameter="Filtered" ItemName="_ResolvedProjectReferencePaths" /> | ||
462 | <Output TaskParameter="Filtered" ItemName="_MSBuildResolvedProjectReferencePaths" /> | ||
463 | </RemoveDuplicates> | ||
464 | |||
465 | <!-- Create list of all .wixlib project references. --> | ||
466 | <CreateItem | ||
467 | Include="@(_ResolvedProjectReferencePaths)" | ||
468 | Condition=" '%(Extension)' == '.wixlib' "> | ||
469 | |||
470 | <Output TaskParameter="Include" ItemName="WixLibProjects" /> | ||
471 | </CreateItem> | ||
472 | |||
473 | <Message | ||
474 | Importance="low" | ||
475 | Text="Library from referenced projects: %(WixLibProjects.Identity)" | ||
476 | Condition=" '@(WixLibProjects)' != '' " /> | ||
477 | |||
478 | </Target> | ||
479 | |||
480 | <!-- | ||
481 | ================================================================================================ | ||
482 | ResolveWixLibraryReferences | ||
483 | |||
484 | Resolve the library references to full paths. | ||
485 | |||
486 | [IN] | ||
487 | @(WixLibrary) - The list of .wixlib files. | ||
488 | |||
489 | [OUT] | ||
490 | @(_ResolvedWixLibraryPaths) - Item group with full paths to libraries | ||
491 | ================================================================================================ | ||
492 | --> | ||
493 | <PropertyGroup> | ||
494 | <ResolveWixLibraryReferencesDependsOn></ResolveWixLibraryReferencesDependsOn> | ||
495 | </PropertyGroup> | ||
496 | <Target | ||
497 | Name="ResolveWixLibraryReferences" | ||
498 | DependsOnTargets="$(ResolveWixLibraryReferencesDependsOn)" | ||
499 | Condition=" '@(WixLibrary)' != ''"> | ||
500 | |||
501 | <!-- | ||
502 | The WixLibrarySearchPaths property is set to find assemblies in the following order: | ||
503 | |||
504 | (1) $(ReferencePaths) - the reference paths property, which comes from the .USER file. | ||
505 | (2) The hintpath from the referenced item itself, indicated by {HintPathFromItem}. | ||
506 | (3) Treat the reference's Include as if it were a real file name. | ||
507 | (4) Path specified by the WixExtDir property. | ||
508 | --> | ||
509 | <CreateProperty Condition=" '$(WixLibrarySearchPaths)' == '' " Value=" | ||
510 | $(ReferencePaths); | ||
511 | {HintPathFromItem}; | ||
512 | {RawFileName}; | ||
513 | $(WixExtDir) | ||
514 | "> | ||
515 | <Output TaskParameter="Value" PropertyName="WixLibrarySearchPaths" /> | ||
516 | </CreateProperty> | ||
517 | |||
518 | <ResolveWixReferences | ||
519 | WixReferences="@(WixLibrary)" | ||
520 | SearchPaths="$(WixLibrarySearchPaths)" | ||
521 | SearchFilenameExtensions=".wixlib"> | ||
522 | <Output TaskParameter="ResolvedWixReferences" ItemName="_AllResolvedWixLibraryPaths" /> | ||
523 | </ResolveWixReferences> | ||
524 | |||
525 | <!-- Remove duplicate library items that would cause build errors --> | ||
526 | <RemoveDuplicates Inputs="@(_AllResolvedWixLibraryPaths)"> | ||
527 | <Output TaskParameter="Filtered" ItemName="_ResolvedWixLibraryPaths" /> | ||
528 | </RemoveDuplicates> | ||
529 | |||
530 | </Target> | ||
531 | |||
532 | <!-- | ||
533 | ================================================================================================== | ||
534 | ResolveWixExtensionReferences | ||
535 | |||
536 | Resolves WiX extension references to full paths. Any properties you use | ||
537 | to resolve paths to extensions must be defined before importing this | ||
538 | file or the extensions will be automatically resolved to $(WixExtDir). | ||
539 | |||
540 | [IN] | ||
541 | @(WixExtension) - WixExtension item group | ||
542 | |||
543 | [OUT] | ||
544 | @(_ResolvedWixExtensionPaths) - Item group with full paths to extensions | ||
545 | ================================================================================================== | ||
546 | --> | ||
547 | <PropertyGroup> | ||
548 | <ResolveWixExtensionReferencesDependsOn></ResolveWixExtensionReferencesDependsOn> | ||
549 | </PropertyGroup> | ||
550 | <Target | ||
551 | Name="ResolveWixExtensionReferences" | ||
552 | DependsOnTargets="$(ResolveWixExtensionReferencesDependsOn)" | ||
553 | Condition=" '@(WixExtension)' != ''"> | ||
554 | |||
555 | <!-- | ||
556 | The WixExtensionSearchPaths property is set to find assemblies in the following order: | ||
557 | |||
558 | (1) $(ReferencePaths) - the reference paths property, which comes from the .USER file. | ||
559 | (2) The hintpath from the referenced item itself, indicated by {HintPathFromItem}. | ||
560 | (3) Treat the reference's Include as if it were a real file name. | ||
561 | (4) Path specified by the WixExtDir property. | ||
562 | --> | ||
563 | <CreateProperty Condition=" '$(WixExtensionSearchPaths)' == '' " Value=" | ||
564 | $(ReferencePaths); | ||
565 | {HintPathFromItem}; | ||
566 | {RawFileName}; | ||
567 | $(WixExtDir) | ||
568 | "> | ||
569 | <Output TaskParameter="Value" PropertyName="WixExtensionSearchPaths" /> | ||
570 | </CreateProperty> | ||
571 | |||
572 | <ResolveWixReferences | ||
573 | WixReferences="@(WixExtension)" | ||
574 | SearchPaths="$(WixExtensionSearchPaths)" | ||
575 | SearchFilenameExtensions=".dll"> | ||
576 | <Output TaskParameter="ResolvedWixReferences" ItemName="_AllResolvedWixExtensionPaths" /> | ||
577 | </ResolveWixReferences> | ||
578 | |||
579 | <!-- Remove duplicate extension items that would cause build errors --> | ||
580 | <RemoveDuplicates Inputs="@(_AllResolvedWixExtensionPaths)"> | ||
581 | <Output TaskParameter="Filtered" ItemName="_ResolvedWixExtensionPaths" /> | ||
582 | </RemoveDuplicates> | ||
583 | </Target> | ||
584 | |||
585 | <!-- | ||
586 | ================================================================================================ | ||
587 | GetTargetPath - OVERRIDE DependsOn | ||
588 | |||
589 | This stand-alone target returns the name of the build product (i.e. MSI, MSM) that would be | ||
590 | produced if we built this project. | ||
591 | ================================================================================================ | ||
592 | --> | ||
593 | <PropertyGroup> | ||
594 | <GetTargetPathDependsOn>AssignCultures</GetTargetPathDependsOn> | ||
595 | </PropertyGroup> | ||
596 | |||
597 | |||
598 | <!-- | ||
599 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
600 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
601 | DoIt Targets | ||
602 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
603 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
604 | --> | ||
605 | |||
606 | <!-- | ||
607 | ================================================================================================== | ||
608 | DoIt | ||
609 | ================================================================================================== | ||
610 | --> | ||
611 | <PropertyGroup> | ||
612 | <DoItDependsOn> | ||
613 | PrepareForBuild; | ||
614 | ResolveReferences; | ||
615 | BeforeCompile; | ||
616 | _TimeStampBeforeCompile; | ||
617 | Harvest; | ||
618 | |||
619 | CalculateDefineConstants; | ||
620 | GenerateCompileWithObjectPath; | ||
621 | |||
622 | AssignCultures; | ||
623 | ReadPreviousBindInputsAndBuiltOutputs; | ||
624 | |||
625 | ActuallyDoIt; | ||
626 | |||
627 | UpdateLinkFileWrites; | ||
628 | _TimeStampAfterCompile; | ||
629 | AfterCompile | ||
630 | </DoItDependsOn> | ||
631 | </PropertyGroup> | ||
632 | <Target | ||
633 | Name="DoIt" | ||
634 | DependsOnTargets="$(DoItDependsOn)" /> | ||
635 | |||
636 | <Target | ||
637 | Name="ActuallyDoIt" | ||
638 | |||
639 | Inputs="@(Compile); | ||
640 | @(Content); | ||
641 | @(EmbeddedResource); | ||
642 | @(WixObject); | ||
643 | @(_ResolvedProjectReferencePaths); | ||
644 | @(_ResolvedWixLibraryPaths); | ||
645 | @(_ResolvedWixExtensionPaths); | ||
646 | @(_BindInputs); | ||
647 | $(MSBuildAllProjects)" | ||
648 | Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)" | ||
649 | Condition=" '@(Compile)' != '' "> | ||
650 | |||
651 | <PropertyGroup> | ||
652 | <OutputFile>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)))</OutputFile> | ||
653 | <PdbOutputFile>$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)</PdbOutputFile> | ||
654 | </PropertyGroup> | ||
655 | |||
656 | <DoIt | ||
657 | SourceFiles="@(_CompileWithObjectPath)" | ||
658 | LibraryFiles="@(WixLibProjects);@(_ResolvedWixLibraryPaths)" | ||
659 | LocalizationFiles="@(EmbeddedResource)" | ||
660 | |||
661 | Cultures="%(CultureGroup.Identity)" | ||
662 | |||
663 | ExtensionDirectory="$(WixExtDir)" | ||
664 | Extensions="@(_ResolvedWixExtensionPaths)" | ||
665 | |||
666 | IntermediateDirectory="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)" | ||
667 | |||
668 | OutputFile="$(OutputFile)" | ||
669 | OutputType="$(OutputType)" | ||
670 | PdbOutputFile="$(PdbOutputFile)" | ||
671 | |||
672 | AdditionalOptions="$(CompilerAdditionalOptions) $(LinkerAdditionalOptions)" | ||
673 | DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)" | ||
674 | IncludeSearchPaths="$(IncludeSearchPaths)" | ||
675 | InstallerPlatform="$(InstallerPlatform)" | ||
676 | NoLogo="true" | ||
677 | Pedantic="$(Pedantic)" | ||
678 | ReferencePaths="$(ReferencePaths)" | ||
679 | |||
680 | SuppressSpecificWarnings="$(CompilerSuppressSpecificWarnings);$(LinkerSuppressSpecificWarnings)" | ||
681 | TreatSpecificWarningsAsErrors="$(CompilerTreatSpecificWarningsAsErrors)" | ||
682 | |||
683 | BindInputPaths="@(LinkerBindInputPaths)" | ||
684 | BindFiles="$(LinkerBindFiles)" | ||
685 | BindContentsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)" | ||
686 | BindOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)" | ||
687 | BindBuiltOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)" | ||
688 | |||
689 | CabinetCachePath="$(CabinetCachePath)" | ||
690 | CabinetCreationThreadCount="$(CabinetCreationThreadCount)" | ||
691 | DefaultCompressionLevel="$(DefaultCompressionLevel)" | ||
692 | |||
693 | UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)" | ||
694 | WixProjectFile="$(ProjectPath)" | ||
695 | WixVariables="$(WixVariables)" | ||
696 | |||
697 | SuppressValidation="$(SuppressValidation)" | ||
698 | SuppressIces="$(SuppressIces)" | ||
699 | AdditionalCub="$(AdditionalCub)" /> | ||
700 | |||
701 | <!-- | ||
702 | SuppressAllWarnings="$(CompilerSuppressAllWarnings);$(LinkerSuppressAllWarnings)" | ||
703 | TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors);$(LinkerTreatWarningsAsErrors)" | ||
704 | VerboseOutput="$(CompilerVerboseOutput);$(LinkerVerboseOutput)" | ||
705 | --> | ||
706 | |||
707 | </Target> | ||
708 | |||
709 | |||
710 | <!-- | ||
711 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
712 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
713 | CompileAndLink Targets | ||
714 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
715 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
716 | --> | ||
717 | |||
718 | <!-- | ||
719 | ================================================================================================== | ||
720 | CompileAndLink | ||
721 | ================================================================================================== | ||
722 | --> | ||
723 | <PropertyGroup> | ||
724 | <CompileAndLinkDependsOn> | ||
725 | ResolveReferences; | ||
726 | BeforeCompile; | ||
727 | _TimeStampBeforeCompile; | ||
728 | Harvest; | ||
729 | Compile; | ||
730 | Lib; | ||
731 | Link; | ||
732 | UpdateLinkFileWrites; | ||
733 | _TimeStampAfterCompile; | ||
734 | AfterCompile | ||
735 | </CompileAndLinkDependsOn> | ||
736 | </PropertyGroup> | ||
737 | <Target | ||
738 | Name="CompileAndLink" | ||
739 | DependsOnTargets="$(CompileAndLinkDependsOn)" /> | ||
740 | |||
741 | <!-- | ||
742 | ================================================================================================== | ||
743 | CalculateDefineConstants | ||
744 | |||
745 | Adds project references to the constants passed into the compiler. | ||
746 | |||
747 | [IN] | ||
748 | @(_ResolvedProjectReferencePaths) - paths to projects' outputs | ||
749 | $(VSProjectConfigurations) - map of project names to configurations, provided by VS when building in the IDE | ||
750 | |||
751 | [OUT] | ||
752 | $(ProjectReferenceDefineConstants) - the list of referenced project variables to be passed into the compiler | ||
753 | ================================================================================================== | ||
754 | --> | ||
755 | <PropertyGroup> | ||
756 | <CalculateDefineConstantsDependsOn>ResolveReferences</CalculateDefineConstantsDependsOn> | ||
757 | </PropertyGroup> | ||
758 | <Target | ||
759 | Name="CalculateDefineConstants" | ||
760 | DependsOnTargets="$(CalculateDefineConstantsDependsOn)" | ||
761 | Condition=" '@(_ResolvedProjectReferencePaths)' != '' "> | ||
762 | |||
763 | <PropertyGroup> | ||
764 | <ProjectDefineConstants> | ||
765 | Configuration=$(ConfigurationName); | ||
766 | OutDir=$(OutDir); | ||
767 | Platform=$(PlatformName); | ||
768 | ProjectDir=$(ProjectDir); | ||
769 | ProjectExt=$(ProjectExt); | ||
770 | ProjectFileName=$(ProjectFileName); | ||
771 | ProjectName=$(ProjectName); | ||
772 | ProjectPath=$(ProjectPath); | ||
773 | TargetDir=$(TargetDir); | ||
774 | TargetExt=$(TargetExt); | ||
775 | TargetFileName=$(TargetFileName); | ||
776 | TargetName=$(TargetName); | ||
777 | TargetPath=$(TargetPath); | ||
778 | </ProjectDefineConstants> | ||
779 | </PropertyGroup> | ||
780 | |||
781 | <PropertyGroup> | ||
782 | <SolutionDefineConstants Condition=" '$(DevEnvDir)'!='*Undefined*' ">$(SolutionDefineConstants);DevEnvDir=$(DevEnvDir)</SolutionDefineConstants> | ||
783 | <SolutionDefineConstants Condition=" '$(SolutionDir)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionDir=$(SolutionDir)</SolutionDefineConstants> | ||
784 | <SolutionDefineConstants Condition=" '$(SolutionExt)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionExt=$(SolutionExt)</SolutionDefineConstants> | ||
785 | <SolutionDefineConstants Condition=" '$(SolutionFileName)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionFileName=$(SolutionFileName)</SolutionDefineConstants> | ||
786 | <SolutionDefineConstants Condition=" '$(SolutionName)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionName=$(SolutionName)</SolutionDefineConstants> | ||
787 | <SolutionDefineConstants Condition=" '$(SolutionPath)'!='*Undefined*' ">$(SolutionDefineConstants);SolutionPath=$(SolutionPath)</SolutionDefineConstants> | ||
788 | </PropertyGroup> | ||
789 | |||
790 | <CreateProjectReferenceDefineConstants | ||
791 | ProjectReferencePaths="@(_ResolvedProjectReferencePaths)" | ||
792 | ProjectConfigurations="$(VSProjectConfigurations)"> | ||
793 | |||
794 | <Output TaskParameter="DefineConstants" PropertyName="ProjectReferenceDefineConstants" /> | ||
795 | </CreateProjectReferenceDefineConstants> | ||
796 | |||
797 | <ItemGroup> | ||
798 | <LinkerBindInputPaths Include="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)" /> | ||
799 | </ItemGroup> | ||
800 | </Target> | ||
801 | |||
802 | <!-- | ||
803 | ================================================================================================ | ||
804 | GenerateCompileWithObjectPath | ||
805 | |||
806 | Generates metadata on the for compile output objects. | ||
807 | |||
808 | ================================================================================================ | ||
809 | --> | ||
810 | <PropertyGroup> | ||
811 | <GenerateCompileWithObjectPathDependsOn></GenerateCompileWithObjectPathDependsOn> | ||
812 | </PropertyGroup> | ||
813 | <Target | ||
814 | Name="GenerateCompileWithObjectPath" | ||
815 | Condition=" '@(Compile)' != '' "> | ||
816 | |||
817 | <GenerateCompileWithObjectPath | ||
818 | Compile="@(Compile)" | ||
819 | IntermediateOutputPath="$(IntermediateOutputPath)"> | ||
820 | <Output TaskParameter="CompileWithObjectPath" ItemName="_CompileWithObjectPath" /> | ||
821 | </GenerateCompileWithObjectPath> | ||
822 | |||
823 | </Target> | ||
824 | |||
825 | <!-- | ||
826 | ================================================================================================ | ||
827 | Compile | ||
828 | |||
829 | Compiles the wxs files into wixobj files using candle.exe. | ||
830 | |||
831 | [IN] | ||
832 | @(Compile) - The list of wxs files to compile. | ||
833 | @(Content) - Files that the project uses in the installer. | ||
834 | @(WixExtension) - The list of wixlib or wix dll extensions. | ||
835 | |||
836 | [OUT] | ||
837 | @(CompileObjOutput) - The compiled .wixobj files. | ||
838 | ================================================================================================ | ||
839 | --> | ||
840 | <PropertyGroup> | ||
841 | <CompileDependsOn> | ||
842 | PrepareForBuild; | ||
843 | ResolveReferences; | ||
844 | CalculateDefineConstants; | ||
845 | GenerateCompileWithObjectPath | ||
846 | </CompileDependsOn> | ||
847 | </PropertyGroup> | ||
848 | <Target | ||
849 | Name="Compile" | ||
850 | Inputs="@(Compile); | ||
851 | @(Content); | ||
852 | @(_ResolvedWixExtensionPaths); | ||
853 | @(_ResolvedProjectReferencePaths); | ||
854 | $(MSBuildAllProjects)" | ||
855 | Outputs="@(_CompileWithObjectPath -> '%(ObjectPath)%(Filename).wixobj')" | ||
856 | DependsOnTargets="$(CompileDependsOn)" | ||
857 | Condition=" '@(Compile)' != '' "> | ||
858 | |||
859 | <Candle | ||
860 | SourceFiles="@(_CompileWithObjectPath)" | ||
861 | AdditionalOptions="$(CompilerAdditionalOptions)" | ||
862 | DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)" | ||
863 | ExtensionDirectory="$(WixExtDir)" | ||
864 | Extensions="@(_ResolvedWixExtensionPaths)" | ||
865 | PreprocessToStdOut="$(PreprocessToStdOut)" | ||
866 | PreprocessToFile="$(PreprocessToFile)" | ||
867 | IncludeSearchPaths="$(IncludeSearchPaths)" | ||
868 | InstallerPlatform="$(InstallerPlatform)" | ||
869 | IntermediateDirectory="$(IntermediateOutputPath)" | ||
870 | NoLogo="$(CompilerNoLogo)" | ||
871 | OutputFile="%(_CompileWithObjectPath.ObjectPath)" | ||
872 | Pedantic="$(Pedantic)" | ||
873 | ReferencePaths="$(ReferencePaths)" | ||
874 | RunAsSeparateProcess="$(RunWixToolsOutOfProc)" | ||
875 | SuppressAllWarnings="$(CompilerSuppressAllWarnings)" | ||
876 | SuppressSpecificWarnings="$(CompilerSuppressSpecificWarnings)" | ||
877 | ToolPath="$(WixToolDir)" | ||
878 | TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors)" | ||
879 | TreatSpecificWarningsAsErrors="$(CompilerTreatSpecificWarningsAsErrors)" | ||
880 | VerboseOutput="$(CompilerVerboseOutput)"> | ||
881 | </Candle> | ||
882 | |||
883 | <!-- These will be still be set even if the Compile target is up to date. --> | ||
884 | <ItemGroup> | ||
885 | <CompileObjOutput Include="@(_CompileWithObjectPath -> '%(ObjectPath)%(Filename).wixobj')" /> | ||
886 | <FileWrites Include="@(CompileObjOutput)" /> | ||
887 | </ItemGroup> | ||
888 | </Target> | ||
889 | |||
890 | <!-- | ||
891 | ================================================================================================ | ||
892 | Lib | ||
893 | |||
894 | Links the .wixobj, .wxl, .wixlib, wix extensions into a .wixlib file using lit.exe. | ||
895 | |||
896 | [IN] | ||
897 | @(CompileObjOutput) - The compiled .wixobj file. | ||
898 | @(EmbeddedResource) - The list of wxl files to use for localization. | ||
899 | @(WixObject) - The list of .wixobj files. | ||
900 | @(WixLibrary) - The list of .wixlib files. | ||
901 | @(WixExtension) - The list of wix dll extension files. | ||
902 | |||
903 | [OUT] | ||
904 | $(TargetPath) - The compiled .wixlib file. | ||
905 | ================================================================================================ | ||
906 | --> | ||
907 | <PropertyGroup> | ||
908 | <LibDependsOn> | ||
909 | PrepareForBuild; | ||
910 | ResolveReferences | ||
911 | </LibDependsOn> | ||
912 | </PropertyGroup> | ||
913 | <Target | ||
914 | Name="Lib" | ||
915 | Inputs="@(CompileObjOutput); | ||
916 | @(EmbeddedResource); | ||
917 | @(WixObject); | ||
918 | @(WixLibrary); | ||
919 | @(_ResolvedWixExtensionPaths); | ||
920 | $(MSBuildAllProjects)" | ||
921 | Outputs="$(TargetPath)" | ||
922 | DependsOnTargets="$(LibDependsOn)" | ||
923 | Condition=" '$(OutputType)' == 'Library' "> | ||
924 | |||
925 | <Lit | ||
926 | ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(WixLibrary)" | ||
927 | AdditionalOptions="$(LibAdditionalOptions)" | ||
928 | BindInputPaths="@(LinkerBindInputPaths)" | ||
929 | BindFiles="$(LibBindFiles)" | ||
930 | ExtensionDirectory="$(WixExtDir)" | ||
931 | Extensions="@(_ResolvedWixExtensionPaths)" | ||
932 | LocalizationFiles="@(EmbeddedResource)" | ||
933 | NoLogo="$(LibNoLogo)" | ||
934 | OutputFile="$(TargetPath)" | ||
935 | Pedantic="$(LibPedantic)" | ||
936 | ReferencePaths="$(ReferencePaths)" | ||
937 | RunAsSeparateProcess="$(RunWixToolsOutOfProc)" | ||
938 | SuppressAllWarnings="$(LibSuppressAllWarnings)" | ||
939 | SuppressIntermediateFileVersionMatching="$(LibSuppressIntermediateFileVersionMatching)" | ||
940 | SuppressSchemaValidation="$(LibSuppressSchemaValidation)" | ||
941 | SuppressSpecificWarnings="$(LibSuppressSpecificWarnings)" | ||
942 | ToolPath="$(WixToolDir)" | ||
943 | TreatWarningsAsErrors="$(LibTreatWarningsAsErrors)" | ||
944 | VerboseOutput="$(LibVerboseOutput)" /> | ||
945 | </Target> | ||
946 | |||
947 | <!-- | ||
948 | ================================================================================================ | ||
949 | AssignCultures | ||
950 | |||
951 | Determines the final list of culture groups to build based on either the Cultures property or | ||
952 | those specified in .wxl files. | ||
953 | |||
954 | Culture groups specified in the Cultures property must be specified as a semi-colon | ||
955 | delimited list of groups, with comma-delimited cultures within a group. | ||
956 | For example: | ||
957 | <Cultures>en-US,en;en-GB,en</Cultures> | ||
958 | This will build 2 targets, outputing to en-US and en-GB sub-folders. Light will first look | ||
959 | for strings in the first culture (en-US or en-GB) then the second (en). | ||
960 | |||
961 | Cultures of .wxl files will be used when the Culture property is not set. The culture of a | ||
962 | .wxl file is determined by the Culture attribute in the WixLocalization element in the file | ||
963 | |||
964 | Sets the OutputFolder metadata on each culture group. In most cases this is the same as the | ||
965 | first culture in the culture group. When the Culture's property is unspecified and no .wxl | ||
966 | files are provided this is the same as the output directory. When the Culture's property | ||
967 | specifies a single culture group and no .wxl files are provided this is the same as the output | ||
968 | directory. | ||
969 | |||
970 | Updates the TargetPath and TargetPdbPath properties to be used in subsequent targets. | ||
971 | |||
972 | [IN] | ||
973 | @(EmbeddedResource) - The list of wxl files to use for localization. | ||
974 | $(Cultures) - The list of culture groups to build. | ||
975 | |||
976 | [OUT] | ||
977 | @(CultureGroup) - The list of culture group strings with OutputFolder metadata | ||
978 | $(TargetPath) - Property list of target link output MSIs/MSMs | ||
979 | $(TargetPdbPath) - Property list of target output pdbs | ||
980 | @(SignTargetPath) - The list of target to be signed | ||
981 | |||
982 | ================================================================================================ | ||
983 | --> | ||
984 | <Target | ||
985 | Name="AssignCultures" | ||
986 | Condition=" '$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' "> | ||
987 | |||
988 | <WixAssignCulture | ||
989 | Cultures="$(Cultures)" | ||
990 | Files="@(EmbeddedResource)"> | ||
991 | |||
992 | <Output TaskParameter="CultureGroups" ItemName="CultureGroup" /> | ||
993 | </WixAssignCulture> | ||
994 | |||
995 | <!-- Build an itemgroup of outputs --> | ||
996 | <ItemGroup> | ||
997 | <_TargetPathItems Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)" /> | ||
998 | <_TargetPdbPathItems Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)" /> | ||
999 | </ItemGroup> | ||
1000 | |||
1001 | <!-- Convert the itemgroup to a semicolon-delimited property --> | ||
1002 | <PropertyGroup> | ||
1003 | <TargetPath>@(_TargetPathItems)</TargetPath> | ||
1004 | <TargetPdbPath>@(_TargetPdbPathItems)</TargetPdbPath> | ||
1005 | </PropertyGroup> | ||
1006 | |||
1007 | <!-- Set the sign target items, if we're signing output. --> | ||
1008 | <ItemGroup Condition=" '$(SignOutput)' == 'true' AND '$(SuppressLayout)' != 'true' "> | ||
1009 | <SignTargetPath Include="@(_TargetPathItems)" /> | ||
1010 | </ItemGroup> | ||
1011 | </Target> | ||
1012 | |||
1013 | <!-- | ||
1014 | ================================================================================================ | ||
1015 | ReadPreviousBindInputsAndBuiltOutputs | ||
1016 | |||
1017 | Reads a previous build's Bind contents and built outputs file into @(_BindInputs) and | ||
1018 | @(_BindBuiltOutputs) respectively. | ||
1019 | |||
1020 | Note: Only the *built* outputs are used because using files copied to output folder | ||
1021 | can cause perpetual incremental build. | ||
1022 | |||
1023 | Imagine the case where you have: Msi.wixproj -> Lib.wixproj -> Exe.csproj. The | ||
1024 | Exe.csproj cannot be both an input to Lib.wixproj and an output of Msi.wixproj | ||
1025 | (as an uncompressed file) because the Lib.wixproj will always newer than the | ||
1026 | Exe.csproj. | ||
1027 | |||
1028 | [IN] | ||
1029 | |||
1030 | [OUT] | ||
1031 | @(_BindInputs) - the content files required to bind (i.e. the Binary/@SourceFile and File/@Source files). | ||
1032 | @(_BindBuiltOutputs) - the previously built .msi, .msm, .pcp, .exe .wixpdb, .cabs, etc. | ||
1033 | Does not include content copied to output folder. | ||
1034 | ================================================================================================ | ||
1035 | --> | ||
1036 | <Target | ||
1037 | Name="ReadPreviousBindInputsAndBuiltOutputs"> | ||
1038 | |||
1039 | <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)"> | ||
1040 | <Output TaskParameter="Lines" ItemName="_BindInputs" /> | ||
1041 | </ReadLinesFromFile> | ||
1042 | |||
1043 | <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)"> | ||
1044 | <Output TaskParameter="Lines" ItemName="_BindBuiltOutputs" /> | ||
1045 | </ReadLinesFromFile> | ||
1046 | |||
1047 | <Message Importance="low" Text="Previous bind inputs: @(_BindInputs)" /> | ||
1048 | <Message Importance="low" Text="Previous bind outputs: @(_BindBuiltOutputs)" /> | ||
1049 | </Target> | ||
1050 | |||
1051 | <!-- | ||
1052 | ================================================================================================ | ||
1053 | Link | ||
1054 | |||
1055 | Links the .wixobj, .wxl, .wixlib, wix extensions into an .msi or .msm file using light.exe, | ||
1056 | once per culture group. All WXL files are passed into light and the culture switch determines | ||
1057 | which are used | ||
1058 | |||
1059 | [IN] | ||
1060 | @(CompileObjOutput) - The compiled .wixobj file. | ||
1061 | @(CultureGroup) - The cultures to build | ||
1062 | @(EmbeddedResource) - The list of wxl files to use for localization. | ||
1063 | @(WixObject) - The list of .wixobj files. | ||
1064 | @(WixLibrary) - The list of .wixlib files. | ||
1065 | @(WixExtension) - The list of wix dll extension files. | ||
1066 | |||
1067 | [OUT] | ||
1068 | $(TargetDir)\%(Culture)\$(TargetName)$(TargetExt) - The compiled .msi, .msm, or .exe files. | ||
1069 | ================================================================================================ | ||
1070 | --> | ||
1071 | <PropertyGroup> | ||
1072 | <LinkDependsOn> | ||
1073 | PrepareForBuild; | ||
1074 | ResolveReferences; | ||
1075 | AssignCultures; | ||
1076 | ReadPreviousBindInputsAndBuiltOutputs; | ||
1077 | </LinkDependsOn> | ||
1078 | </PropertyGroup> | ||
1079 | <Target | ||
1080 | Name="Link" | ||
1081 | Inputs="@(CompileObjOutput); | ||
1082 | @(EmbeddedResource); | ||
1083 | @(WixObject); | ||
1084 | @(_ResolvedProjectReferencePaths); | ||
1085 | @(_ResolvedWixLibraryPaths); | ||
1086 | @(_ResolvedWixExtensionPaths); | ||
1087 | $(MSBuildAllProjects); | ||
1088 | @(_BindInputs)" | ||
1089 | Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)" | ||
1090 | DependsOnTargets="$(LinkDependsOn)" | ||
1091 | Condition=" '$(OutputType)' == 'Bundle' or '$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' "> | ||
1092 | |||
1093 | <PropertyGroup> | ||
1094 | <PdbOutputFile>$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)</PdbOutputFile> | ||
1095 | </PropertyGroup> | ||
1096 | |||
1097 | <!-- Call light using the culture subdirectory for output --> | ||
1098 | <Light | ||
1099 | ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(_ResolvedWixLibraryPaths)" | ||
1100 | AdditionalOptions="$(LinkerAdditionalOptions)" | ||
1101 | AllowIdenticalRows="$(AllowIdenticalRows)" | ||
1102 | AllowUnresolvedReferences="$(AllowUnresolvedReferences)" | ||
1103 | AdditionalCub="$(AdditionalCub)" | ||
1104 | BackwardsCompatibleGuidGeneration="$(BackwardsCompatibleGuidGeneration)" | ||
1105 | BindInputPaths="@(LinkerBindInputPaths)" | ||
1106 | BindFiles="$(LinkerBindFiles)" | ||
1107 | BindContentsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)" | ||
1108 | BindOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)" | ||
1109 | BindBuiltOutputsFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)" | ||
1110 | CabinetCachePath="$(CabinetCachePath)" | ||
1111 | CabinetCreationThreadCount="$(CabinetCreationThreadCount)" | ||
1112 | Cultures="%(CultureGroup.Identity)" | ||
1113 | CustomBinder="$(CustomBinder)" | ||
1114 | DefaultCompressionLevel="$(DefaultCompressionLevel)" | ||
1115 | DropUnrealTables="$(DropUnrealTables)" | ||
1116 | ExactAssemblyVersions="$(ExactAssemblyVersions)" | ||
1117 | ExtensionDirectory="$(WixExtDir)" | ||
1118 | Extensions="@(_ResolvedWixExtensionPaths)" | ||
1119 | Ices="$(Ices)" | ||
1120 | LeaveTemporaryFiles="$(LeaveTemporaryFiles)" | ||
1121 | LocalizationFiles="@(EmbeddedResource)" | ||
1122 | NoLogo="$(LinkerNoLogo)" | ||
1123 | OutputAsXml="$(OutputAsXml)" | ||
1124 | OutputFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)" | ||
1125 | PdbOutputFile="$(PdbOutputFile)" | ||
1126 | Pedantic="$(LinkerPedantic)" | ||
1127 | ReferencePaths="$(ReferencePaths)" | ||
1128 | ReuseCabinetCache="$(ReuseCabinetCache)" | ||
1129 | RunAsSeparateProcess="$(RunWixToolsOutOfProc)" | ||
1130 | SuppressAclReset="$(SuppressAclReset)" | ||
1131 | SuppressAllWarnings="$(LinkerSuppressAllWarnings)" | ||
1132 | SuppressAssemblies="$(SuppressAssemblies)" | ||
1133 | SuppressDefaultAdminSequenceActions="$(SuppressDefaultAdminSequenceActions)" | ||
1134 | SuppressDefaultAdvSequenceActions="$(SuppressDefaultAdvSequenceActions)" | ||
1135 | SuppressDefaultUISequenceActions="$(SuppressDefaultUISequenceActions)" | ||
1136 | SuppressFileHashAndInfo="$(SuppressFileHashAndInfo)" | ||
1137 | SuppressFiles="$(SuppressFiles)" | ||
1138 | SuppressIntermediateFileVersionMatching="$(LinkerSuppressIntermediateFileVersionMatching)" | ||
1139 | SuppressIces="$(SuppressIces)" | ||
1140 | SuppressLayout="$(SuppressLayout)" | ||
1141 | SuppressLocalization="$(SuppressLocalization)" | ||
1142 | SuppressMsiAssemblyTableProcessing="$(SuppressMsiAssemblyTableProcessing)" | ||
1143 | SuppressPdbOutput="$(SuppressPdbOutput)" | ||
1144 | SuppressSchemaValidation="$(LinkerSuppressSchemaValidation)" | ||
1145 | SuppressValidation="$(SuppressValidation)" | ||
1146 | SuppressSpecificWarnings="$(LinkerSuppressSpecificWarnings)" | ||
1147 | SuppressTagSectionIdAttributeOnTuples="$(SuppressTagSectionIdAttributeOnTuples)" | ||
1148 | ToolPath="$(WixToolDir)" | ||
1149 | TreatWarningsAsErrors="$(LinkerTreatWarningsAsErrors)" | ||
1150 | UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)" | ||
1151 | VerboseOutput="$(LinkerVerboseOutput)" | ||
1152 | WixProjectFile="$(ProjectPath)" | ||
1153 | WixVariables="$(WixVariables)" /> | ||
1154 | </Target> | ||
1155 | |||
1156 | <!-- | ||
1157 | ================================================================================================ | ||
1158 | UpdateLinkFileWrites | ||
1159 | |||
1160 | Reads the bind outputs file(s) output generated during Link to correctly set the @(FileWrites) | ||
1161 | item. Most targets have it easy because they can do a static mapping from inputs to the outputs. | ||
1162 | However, the Link target outputs are determined after a rather complex calculation we call | ||
1163 | linking and binding! | ||
1164 | |||
1165 | This target runs independently after Link to ensure that @(FileWrites) is updated even if the | ||
1166 | "Light" task fails. | ||
1167 | |||
1168 | [IN] | ||
1169 | Path to bind outputs file(s). | ||
1170 | |||
1171 | [OUT] | ||
1172 | @(FileWrites) updated with outputs from bind. | ||
1173 | ================================================================================================ | ||
1174 | --> | ||
1175 | <Target | ||
1176 | Name="UpdateLinkFileWrites"> | ||
1177 | |||
1178 | <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"> | ||
1179 | <Output TaskParameter="Lines" ItemName="FileWrites"/> | ||
1180 | </ReadLinesFromFile> | ||
1181 | |||
1182 | <ItemGroup> | ||
1183 | <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindContentsFile)') " /> | ||
1184 | <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)') " /> | ||
1185 | <FileWrites Include="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)" Condition=" Exists('$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile)') " /> | ||
1186 | </ItemGroup> | ||
1187 | |||
1188 | <Message Importance="low" Text="Build files after link: @(FileWrites)" /> | ||
1189 | </Target> | ||
1190 | |||
1191 | <!-- | ||
1192 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
1193 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
1194 | AllProjectOutputGroups Section | ||
1195 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
1196 | ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
1197 | --> | ||
1198 | |||
1199 | <!-- | ||
1200 | ================================================================================================== | ||
1201 | AllProjectOutputGroups - OVERRIDE Target | ||
1202 | |||
1203 | ================================================================================================== | ||
1204 | --> | ||
1205 | <Target | ||
1206 | Name="AllProjectOutputGroups" | ||
1207 | DependsOnTargets=" | ||
1208 | BuiltProjectOutputGroup; | ||
1209 | DebugSymbolsProjectOutputGroup; | ||
1210 | SourceFilesProjectOutputGroup; | ||
1211 | ContentFilesProjectOutputGroup" /> | ||
1212 | |||
1213 | <!-- | ||
1214 | This is the key output for the BuiltProjectOutputGroup and is meant to be read directly from the IDE. | ||
1215 | Reading an item is faster than invoking a target. | ||
1216 | --> | ||
1217 | <ItemGroup> | ||
1218 | <BuiltProjectOutputGroupKeyOutput Include="$(TargetPath)"> | ||
1219 | <IsKeyOutput>true</IsKeyOutput> | ||
1220 | <FinalOutputPath>$(TargetPath)</FinalOutputPath> | ||
1221 | <TargetPath>$(TargetFileName)</TargetPath> | ||
1222 | </BuiltProjectOutputGroupKeyOutput> | ||
1223 | </ItemGroup> | ||
1224 | |||
1225 | <!-- | ||
1226 | ================================================================================================== | ||
1227 | BuiltProjectOutputGroup - OVERRIDE Target | ||
1228 | ================================================================================================== | ||
1229 | --> | ||
1230 | <PropertyGroup> | ||
1231 | <BuiltProjectOutputGroupDependsOn>PrepareForBuild;AssignCultures</BuiltProjectOutputGroupDependsOn> | ||
1232 | </PropertyGroup> | ||
1233 | <Target | ||
1234 | Name="BuiltProjectOutputGroup" | ||
1235 | Outputs="@(BuiltProjectOutputGroupOutput)" | ||
1236 | DependsOnTargets="$(BuiltProjectOutputGroupDependsOn)"> | ||
1237 | |||
1238 | <!-- Don't add BuiltProjectOutputGroupKeyOutput - to avoid duplicates, we only want to get the updated list of TargetPaths from the TargetPath property below --> | ||
1239 | |||
1240 | <!-- Try to read the outputs from the bind outputs text file since that's the output list straight from linker. --> | ||
1241 | <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"> | ||
1242 | <Output TaskParameter="Lines" ItemName="_BuiltProjectOutputGroupOutputIntermediate"/> | ||
1243 | </ReadLinesFromFile> | ||
1244 | |||
1245 | <!-- If we didn't get anything from the bind outputs text file, default to the target path. --> | ||
1246 | <ItemGroup Condition=" '@(_BuiltProjectOutputGroupOutputIntermediate)'=='' "> | ||
1247 | <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> | ||
1248 | </ItemGroup> | ||
1249 | |||
1250 | <!-- Convert intermediate items into final items; this way we can get the full path for each item --> | ||
1251 | <ItemGroup> | ||
1252 | <BuiltProjectOutputGroupOutput Include="@(_BuiltProjectOutputGroupOutputIntermediate->'%(FullPath)')"> | ||
1253 | <!-- For compatibility with 2.0 --> | ||
1254 | <OriginalItemSpec Condition="'%(_BuiltProjectOutputGroupOutputIntermediate.OriginalItemSpec)' == ''">%(_BuiltProjectOutputGroupOutputIntermediate.FullPath)</OriginalItemSpec> | ||
1255 | </BuiltProjectOutputGroupOutput> | ||
1256 | </ItemGroup> | ||
1257 | </Target> | ||
1258 | |||
1259 | <!-- | ||
1260 | ================================================================================================== | ||
1261 | DebugSymbolsProjectOutputGroup | ||
1262 | |||
1263 | Populates the Debug Symbols project output group. | ||
1264 | ================================================================================================== | ||
1265 | --> | ||
1266 | <PropertyGroup> | ||
1267 | <DebugSymbolsProjectOutputGroupDependsOn>AssignCultures</DebugSymbolsProjectOutputGroupDependsOn> | ||
1268 | </PropertyGroup> | ||
1269 | <Target | ||
1270 | Name="DebugSymbolsProjectOutputGroup" | ||
1271 | Outputs="@(DebugSymbolsProjectOutputGroupOutput)" | ||
1272 | DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)"> | ||
1273 | |||
1274 | <!-- Include build output pdb(s). Different than predefined itemgroup since AssignCultures target may change --> | ||
1275 | <ItemGroup> | ||
1276 | <DebugSymbolsProjectOutputGroupOutput Include="$(TargetPdbPath)" Condition=" '$(SuppressPdbOutput)' != 'true' "/> | ||
1277 | </ItemGroup> | ||
1278 | </Target> | ||
1279 | |||
1280 | |||
1281 | <!-- | ||
1282 | ================================================================================================== | ||
1283 | CopyFilesToOutputDirectory - OVERRIDE Target | ||
1284 | |||
1285 | Copy all build outputs, satellites and other necessary files to the final directory. | ||
1286 | ============================================================ | ||
1287 | --> | ||
1288 | <Target | ||
1289 | Name="CopyFilesToOutputDirectory"> | ||
1290 | |||
1291 | <PropertyGroup> | ||
1292 | <!-- By default we're using hard links to copy to the output directory, disabling this could slow the build significantly --> | ||
1293 | <CreateHardLinksForCopyFilesToOutputDirectoryIfPossible Condition=" '$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)' == '' ">true</CreateHardLinksForCopyFilesToOutputDirectoryIfPossible> | ||
1294 | </PropertyGroup> | ||
1295 | |||
1296 | <PropertyGroup> | ||
1297 | <CopyBuildOutputToOutputDirectory Condition="'$(CopyBuildOutputToOutputDirectory)'==''">true</CopyBuildOutputToOutputDirectory> | ||
1298 | <CopyOutputSymbolsToOutputDirectory Condition="'$(CopyOutputSymbolsToOutputDirectory)'==''">true</CopyOutputSymbolsToOutputDirectory> | ||
1299 | <FullIntermediateOutputPath>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)))</FullIntermediateOutputPath> | ||
1300 | </PropertyGroup> | ||
1301 | |||
1302 | <!-- Copy the bound files. --> | ||
1303 | <ReadLinesFromFile File="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindOutputsFile)"> | ||
1304 | <Output TaskParameter="Lines" ItemName="_FullPathToCopy"/> | ||
1305 | </ReadLinesFromFile> | ||
1306 | |||
1307 | <ItemGroup> | ||
1308 | <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> | ||
1309 | <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> | ||
1310 | </ItemGroup> | ||
1311 | |||
1312 | <Copy | ||
1313 | SourceFiles="@(_RelativePath->'$(IntermediateOutputPath)%(Identity)')" | ||
1314 | DestinationFiles="@(_RelativePath->'$(OutDir)%(Identity)')" | ||
1315 | SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" | ||
1316 | OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" | ||
1317 | Retries="$(CopyRetryCount)" | ||
1318 | RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" | ||
1319 | UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)" | ||
1320 | Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'" | ||
1321 | > | ||
1322 | |||
1323 | <Output TaskParameter="DestinationFiles" ItemName="MainAssembly"/> | ||
1324 | <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> | ||
1325 | |||
1326 | </Copy> | ||
1327 | |||
1328 | <Message Importance="High" Text="$(MSBuildProjectName) -> $(TargetPath)" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)'!='true'" /> | ||
1329 | <!--<Message Importance="High" Text="$(MSBuildProjectName) -> @(MainAssembly->'%(FullPath)')" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)'!='true'" />--> | ||
1330 | |||
1331 | <!-- Copy the debug information file (.pdb), if any | ||
1332 | <Copy | ||
1333 | SourceFiles="@(_DebugSymbolsIntermediatePath)" | ||
1334 | DestinationFiles="@(_DebugSymbolsOutputPath)" | ||
1335 | SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" | ||
1336 | OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" | ||
1337 | Retries="$(CopyRetryCount)" | ||
1338 | RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" | ||
1339 | UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)" | ||
1340 | Condition="'$(_DebugSymbolsProduced)'=='true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true' and '$(CopyOutputSymbolsToOutputDirectory)'=='true'"> | ||
1341 | |||
1342 | <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> | ||
1343 | |||
1344 | </Copy> | ||
1345 | --> | ||
1346 | </Target> | ||
1347 | |||
1348 | |||
1349 | <Import Project="$(WixHarvestTargetsPath)" Condition=" '$(WixHarvestTargetsPath)' != '' and Exists('$(WixHarvestTargetsPath)')" /> | ||
1350 | <Import Project="$(WixSigningTargetsPath)" Condition=" '$(WixSigningTargetsPath)' != '' and Exists('$(WixSigningTargetsPath)')" /> | ||
1351 | <Import Project="$(LuxTargetsPath)" Condition=" '$(LuxTargetsPath)' != '' and Exists('$(LuxTargetsPath)')" /> | ||
1352 | |||
1353 | <!-- Extension point: Define CustomAfterWixTargets to a .targets file that you want to include after this file. --> | ||
1354 | <Import Project="$(CustomAfterWixTargets)" Condition=" '$(CustomAfterWixTargets)' != '' and Exists('$(CustomAfterWixTargets)')" /> | ||
1355 | |||
1356 | </Project> | ||