~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to tools/MutantBuild/Originals/Microsoft.Common.targets

  • Committer: jcansdale
  • Date: 2004-10-09 13:02:14 UTC
  • Revision ID: vcs-imports@canonical.com-20041009130214-5liblibdfltxqlwa
Tool for building VS2003 projects with MSBuild.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
2
 
 
3
    <UsingTask TaskName="Microsoft.Build.Tasks.FormatUrl" AssemblyName="Microsoft.Build.Tasks, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
 
4
    <UsingTask TaskName="Microsoft.Build.Tasks.FormatVersion" AssemblyName="Microsoft.Build.Tasks, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
 
5
    <UsingTask TaskName="Microsoft.Build.Tasks.ResolveManifestFiles" AssemblyName="Microsoft.Build.Tasks, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
 
6
    <UsingTask TaskName="Microsoft.Build.Tasks.UpdateManifest" AssemblyName="Microsoft.Build.Tasks, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
 
7
    <UsingTask TaskName="Microsoft.Build.Tasks.AssignTargetPath" AssemblyName="Microsoft.Build.Tasks, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
 
8
    <UsingTask TaskName="Microsoft.VisualStudio.EnterpriseTools.MappingTool.CompileTime.ObjectRelationalValidator" AssemblyName="Microsoft.VisualStudio.EnterpriseTools.MappingTool"/>
 
9
    <UsingTask TaskName="Microsoft.Build.Tasks.FxCop" AssemblyName="Microsoft.Build.Tasks, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>  
 
10
 
 
11
 
 
12
    <Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/>
 
13
 
 
14
    <!-- Several properties must be set in the main project file, before using this .TARGETS file -->
 
15
 
 
16
    <Error  Condition="'$(AssemblyName)'==''"
 
17
            Text="The &quot;AssemblyName&quot; property is not set in project &quot;$(MSBuildProjectFile)&quot;.  Please set this in the project file before the &lt;Import&gt; of the .Targets file."/>
 
18
 
 
19
    <PropertyGroup>
 
20
        <Configuration Condition=" '$(Configuration)'=='' ">Debug</Configuration>      
 
21
        <DebugSymbols Condition=" '$(Configuration)_$(DebugSymbols)_$(DebugType)'=='Debug__'">true</DebugSymbols>
 
22
        <OutputType Condition=" '$(OutputType)' == '' ">exe</OutputType>
 
23
        <OutputPath Condition=" '$(OutputPath)' == '' ">bin\$(Configuration)\</OutputPath>
 
24
    </PropertyGroup>
 
25
 
 
26
    <!--
 
27
    Visual Studio Macros available from both integrated builds and from command line builds.
 
28
 
 
29
    The following properties are 'macros' that are available via Visual Studio for
 
30
    pre and post build steps.
 
31
    -->
 
32
    <PropertyGroup>
 
33
        <TargetExt Condition="'$(OutputType)'=='exe'">.exe</TargetExt>
 
34
        <TargetExt Condition="'$(OutputType)'=='winexe'">.exe</TargetExt>
 
35
        <TargetExt Condition="'$(OutputType)'=='library'">.dll</TargetExt>
 
36
        <TargetExt Condition="'$(OutputType)'=='module'">.netmodule</TargetExt>
 
37
    </PropertyGroup>
 
38
 
 
39
    <PropertyGroup>
 
40
        <OutDir Condition=" '$(OutDir)' == '' ">$(OutputPath)</OutDir>                                          <!-- Example, bin\Debug\ -->
 
41
        <ConfigurationName Condition=" '$(ConfigurationName)' == '' ">$(Configuration)</ConfigurationName>      <!-- Example, Debug -->
 
42
        <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>                   <!-- Example, MyProject -->
 
43
        <TargetName Condition=" '$(TargetName)' == '' ">$(AssemblyName)</TargetName>                            <!-- Example, MyAssembly -->
 
44
        <ProjectFileName Condition=" '$(ProjectFileName)' == '' ">$(MSBuildProjectFile)</ProjectFileName>       <!-- Example, MyProject.csproj -->
 
45
        <ProjectExt Condition=" '$(ProjectExt)' == '' ">$(MSBuildProjectExtension)</ProjectExt>                 <!-- Example, .csproj -->
 
46
        <TargetFileName Condition=" '$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName>      <!-- Example, MyAssembly.dll -->
 
47
    </PropertyGroup>
 
48
 
 
49
    <PropertyGroup>
 
50
        <TargetApplicationManifestFileName Condition="'$(OutputType)'=='library'">Native.$(AssemblyName).manifest</TargetApplicationManifestFileName>                       <!-- Example, Native.MyAssembly.manifest -->
 
51
        <TargetApplicationManifestFileName Condition="'$(OutputType)'=='winexe'">$(TargetFileName).manifest</TargetApplicationManifestFileName>                             <!-- Example, MyAssembly.exe.manifest -->
 
52
        <TargetApplicationManifestFileName Condition="'$(OutputType)'=='exe'">$(TargetFileName).manifest</TargetApplicationManifestFileName>                                <!-- Example, MyAssembly.exe.manifest -->
 
53
        <TargetDeployManifestFileName Condition="'$(TargetDeployManifestFileName)' == ''">$(AssemblyName).application</TargetDeployManifestFileName>  <!-- Example, MyAssembly.application -->
 
54
        <GenerateClickOnceManifests>$(GenerateManifests)</GenerateClickOnceManifests>
 
55
 
 
56
        <ManifestIdentitity>$(AssemblyName)</ManifestIdentitity>
 
57
        <ApplicationManifestIdentitity Condition="'$(OutputType)'=='library'">Native.$(AssemblyName)</ApplicationManifestIdentitity>
 
58
        <ApplicationManifestIdentitity Condition="'$(OutputType)'=='winexe'">$(ManifestIdentitity).exe</ApplicationManifestIdentitity>
 
59
        <ApplicationManifestIdentitity Condition="'$(OutputType)'=='exe'">$(ManifestIdentitity).exe</ApplicationManifestIdentitity>
 
60
        <DeployManifestIdentitity>$(ManifestIdentitity).application</DeployManifestIdentitity>
 
61
    </PropertyGroup>
 
62
    
 
63
     <!-- Create the output path as an item so that we can use %(FullPath) on it. -->
 
64
    <ItemGroup>
 
65
        <OutputPathItem Include="$(OutputPath)">
 
66
            <InProject>false</InProject>
 
67
        </OutputPathItem>
 
68
    </ItemGroup>
 
69
 
 
70
    <PropertyGroup>
 
71
        <!-- Example, c:\MyProjects\MyProject\bin\debug\ -->
 
72
        <!-- UNDONE.  Condition intentionally omitted on this one, because it causes problems
 
73
             when we pick up the value of an environment variable named TargetDir -->
 
74
        <TargetDir>@(OutputPathItem->'%(FullPath)')</TargetDir>
 
75
 
 
76
        <!-- Example, c:\MyProjects\MyProject\bin\debug\MyAssembly.dll -->
 
77
        <TargetPath Condition=" '$(TargetPath)' == '' ">@(OutputPathItem->'%(FullPath)$(TargetFileName)')</TargetPath>
 
78
 
 
79
        <!-- Example, c:\MyProjects\MyProject\ -->
 
80
        <ProjectDir Condition=" '$(ProjectDir)' == '' ">$(MSBuildProjectDirectory)\</ProjectDir>
 
81
 
 
82
        <!-- Example, c:\MyProjects\MyProject\MyProject.csproj -->
 
83
        <ProjectPath Condition=" '$(ProjectPath)' == '' ">$(ProjectDir)$(ProjectFileName)</ProjectPath>
 
84
 
 
85
        <!-- Example, .NET -->
 
86
        <PlatformName Condition=" '$(PlatformName)' == '' ">.NET</PlatformName>
 
87
    </PropertyGroup>
 
88
 
 
89
    <!--
 
90
    Visual Studio Macros available only from integrated builds.
 
91
 
 
92
    The following properties are 'macros' that are available via Visual Studio for
 
93
    pre and post build steps. However, they are not defined when building from
 
94
    the command line.
 
95
    -->
 
96
    <PropertyGroup>
 
97
        <DevEnvDir Condition="'$(DevEnvDir)'==''">*Undefined*</DevEnvDir>
 
98
        <SolutionName Condition="'$(SolutionName)'==''">*Undefined*</SolutionName>              <!-- Example, MySolution -->
 
99
        <SolutionFileName Condition="'$(SolutionFileName)'==''">*Undefined*</SolutionFileName>  <!-- Example, MySolution.sln -->
 
100
        <SolutionPath Condition="'$(SolutionPath)'==''">*Undefined*</SolutionPath>              <!-- Example, f:\MySolutions\MySolution\MySolution.sln -->
 
101
        <SolutionDir Condition="'$(SolutionDir)'==''">*Undefined*</SolutionDir>                 <!-- Example, f:\MySolutions\MySolution\ -->
 
102
        <SolutionExt Condition="'$(SolutionExt)'==''">*Undefined*</SolutionExt>                 <!-- Example, .sln -->
 
103
        <FxCopDir Condition="'$(FxCopDir)'==''">*Undefined*</FxCopDir>
 
104
    </PropertyGroup>
 
105
 
 
106
    <!--
 
107
    The following properties and items are used internally by this targets file.
 
108
    -->
 
109
    <PropertyGroup>
 
110
        <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
 
111
        <AutoUnifyAssemblyReferences Condition="'$(OutputType)'=='exe'">false</AutoUnifyAssemblyReferences>
 
112
        <AutoUnifyAssemblyReferences Condition="'$(OutputType)'=='winexe'">false</AutoUnifyAssemblyReferences>
 
113
        <BaseOutputPath Condition="'$(BaseOutputPath)'==''">obj\</BaseOutputPath>
 
114
        <IntermediateOutputPath Condition="'$(IntermediateOutputPath)'==''">$(BaseOutputPath)$(Configuration)\</IntermediateOutputPath>
 
115
        <RootNamespaceDot Condition="'$(RootNamespace)'!=''">$(RootNamespace).</RootNamespaceDot>
 
116
    </PropertyGroup>
 
117
 
 
118
    <ItemGroup>
 
119
        <IntermediateAssembly Include="$(IntermediateOutputPath)$(TargetName)$(TargetExt)">
 
120
            <InProject>false</InProject>
 
121
        </IntermediateAssembly>
 
122
 
 
123
        <DocFileItem Include="$(DocFile)"  Condition="'$(DocFile)'!=''">
 
124
            <InProject>false</InProject>
 
125
        </DocFileItem>
 
126
 
 
127
        <FinalDocFile Include="@(DocFileItem->'$(OutDir)%(Filename)%(Extension)')">
 
128
            <InProject>false</InProject>
 
129
        </FinalDocFile>
 
130
    </ItemGroup>
 
131
 
 
132
    <ItemGroup>
 
133
        <!-- Create an item list for the trust licenses to be used in the ClickOnce deploy manifest -->
 
134
        <TrustLicenses Include="$(TrustLicenseFile)">
 
135
            <InProject>false</InProject>
 
136
        </TrustLicenses>
 
137
 
 
138
        <!-- Create an item for entry point of the ClickOnce application (Example: WindowsApplication1.exe) -->
 
139
        <ManifestEntryPoint Include="@(IntermediateAssembly)" Condition="'$(GenerateClickOnceManifests)'=='true'">
 
140
            <TargetPath>$(TargetFileName)</TargetPath>
 
141
            <InProject>false</InProject>
 
142
        </ManifestEntryPoint>
 
143
 
 
144
        <!-- Create an item for the application icon if one exists in the project (Example: app.ico) -->
 
145
        <ManifestIconFile Include="$(ApplicationIcon)" Condition="Exists('$(ApplicationIcon)')">
 
146
            <TargetPath>$(ApplicationIcon)</TargetPath>
 
147
            <InProject>false</InProject>
 
148
        </ManifestIconFile>
 
149
 
 
150
        <!-- Create an item for the output application manifest (Example: WindowsApplication1.exe.manifeset) -->
 
151
        <ApplicationManifest Include="$(IntermediateOutputPath)$(TargetApplicationManifestFileName)">
 
152
            <TargetPath>$(TargetApplicationManifestFileName)</TargetPath>
 
153
            <InProject>false</InProject>
 
154
        </ApplicationManifest>
 
155
 
 
156
        <!-- Create an item for the output deploy manifest (Example: WindowsApplication1.application) -->
 
157
        <DeployManifest Include="$(IntermediateOutputPath)$(TargetDeployManifestFileName)">
 
158
            <TargetPath>$(TargetDeployManifestFileName)</TargetPath>
 
159
            <InProject>false</InProject>
 
160
        </DeployManifest>
 
161
    </ItemGroup>
 
162
 
 
163
    <!--
 
164
    Determine the target URL for ClickOnce deployment.
 
165
    Prefer the UpdateUrl, falling back to InstallUrl or PublishUrl if blank
 
166
    -->
 
167
    <PropertyGroup>
 
168
        <TargetUrl>$(UpdateUrl)</TargetUrl>
 
169
        <TargetUrl Condition="'$(TargetUrl)'==''">$(InstallUrl)</TargetUrl>
 
170
        <TargetUrl Condition="'$(TargetUrl)'==''">$(PublishUrl)</TargetUrl>
 
171
        <TargetUrl Condition="'$(TargetUrl)'!=''">$(TargetUrl)/$(TargetDeployManifestFileName)</TargetUrl>
 
172
    </PropertyGroup>
 
173
 
 
174
    <!--
 
175
    Determine the URLs for the bootstrapper
 
176
    -->
 
177
    <PropertyGroup>
 
178
        <ApplicationUrl Condition="'$(IsWebBootstrapper)'=='true'">$(InstallUrl)</ApplicationUrl>
 
179
        <ApplicationUrl Condition="'$(IsWebBootstrapper)_$(InstallUrl)'=='true_'">$(PublishUrl)</ApplicationUrl>
 
180
        <ComponentsUrl Condition="'$(BootstrapperComponentsUrlEnabled)'=='true'">$(BootstrapperComponentsUrl)</ComponentsUrl>
 
181
    </PropertyGroup>
 
182
 
 
183
    <!--
 
184
    Output location for publish target.
 
185
    -->
 
186
    <PropertyGroup>
 
187
        <PublishDir Condition="'$(PublishDir)'==''">publish\</PublishDir>
 
188
    </PropertyGroup>
 
189
 
 
190
    <!--
 
191
    Determine the target OS version for ClickOnce deployment.
 
192
    If using regfree COM (i.e. one or more manifest references) then the minimum OS
 
193
    version is Windows XP RTM.
 
194
    However, this can be overriden if an explicit OSVersion is specified in the project.
 
195
    -->
 
196
    <PropertyGroup>
 
197
        <TargetOSVersion Condition="'@(NativeReference)'!=''">5.1.2600.0</TargetOSVersion>
 
198
        <TargetOSVersion Condition="'$(OSVersion)'!=''">$(OSVersion)</TargetOSVersion>
 
199
    </PropertyGroup>
 
200
 
 
201
    <!--
 
202
    Platform is the target Processor Architecture. For example, x86, IA64 or AMD64.
 
203
    -->
 
204
    <PropertyGroup>
 
205
        <ProcessorArchitecture Condition="'$(ProcessorArchitecture)'==''">x86</ProcessorArchitecture>
 
206
    </PropertyGroup>
 
207
 
 
208
    <!--
 
209
    AvailablePlatforms is the list of platform targets available.
 
210
    -->
 
211
    <PropertyGroup>
 
212
        <AvailablePlatforms>Any CPU,x86,x64,Itanium</AvailablePlatforms>
 
213
    </PropertyGroup>
 
214
 
 
215
    <!--
 
216
    The default for compilers is to not delay-sign. If $(DelaySign) is false, let the compiler
 
217
    use its default rather than forcing a no-delay-sign flag to be passed in. This is so that
 
218
    attributes in the source code can override this decision.
 
219
    -->
 
220
    <PropertyGroup>
 
221
        <DelaySign Condition="'$(DelaySign)'!='true'"></DelaySign>
 
222
    </PropertyGroup>
 
223
 
 
224
    <!--
 
225
    These properties control web reference proxy generation.
 
226
    -->
 
227
    <PropertyGroup>
 
228
        <WebReference_EnableProperties Condition=" '$(WebReference_EnableProperties)' == '' ">true</WebReference_EnableProperties>
 
229
        <WebReference_EnableSQLTypes Condition=" '$(WebReference_EnableSQLTypes)' == '' ">true</WebReference_EnableSQLTypes>
 
230
        <WebReference_EnableLegacyEventingModel Condition=" '$(WebReference_EnableLegacyEventingModel)' == '' ">false</WebReference_EnableLegacyEventingModel>
 
231
    </PropertyGroup>
 
232
 
 
233
    <!--
 
234
    Default set of FxCop rules.  Can be overridden in project file.
 
235
    -->
 
236
    <PropertyGroup>
 
237
        <FxCopRules Condition="'$(FxCopRules)'==''">ComRules.dll;DesignRules.dll;GlobalizationRules.dll;MaintainabilityRules.dll;NamingRules.dll;PerformanceRules.dll;ReliabilityRules.dll;SecurityRules.dll;UsageRules.dll</FxCopRules>
 
238
        <FxCopExclusionsFile Condition="'$(FxCopExclusionsFile)'==''">Exclusions.FxCop</FxCopExclusionsFile>
 
239
    </PropertyGroup>
 
240
 
 
241
    <PropertyGroup>
 
242
        <MSBuildAllProjects>$(MSBuildProjectFullPath);$(MSBuildBinPath)\Microsoft.Common.targets</MSBuildAllProjects>
 
243
        <MSBuildAllProjects Condition="Exists('$(MSBuildProjectFullPath).user')">$(MSBuildAllProjects);$(MSBuildProjectFullPath).user</MSBuildAllProjects>
 
244
    </PropertyGroup>
 
245
 
 
246
    <!--
 
247
    These parameters control where to look in the registry for directories to search for
 
248
    assemblies in the assembly resolution tasks.
 
249
    -->
 
250
    <PropertyGroup>
 
251
        <FrameworkRegistryBase Condition=" '$(FrameworkRegistryBase)' == '' ">Software\Microsoft\.NetFramework</FrameworkRegistryBase>
 
252
        <TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' ">v2.0</TargetFrameworkVersion>
 
253
        <AssemblyFoldersSuffix Condition=" '$(AssemblyFoldersSuffix)' == '' ">AssemblyFoldersEx</AssemblyFoldersSuffix>
 
254
    </PropertyGroup>
 
255
 
 
256
    <!--
 
257
    The SearchPaths property is set to find assemblies in the following order:
 
258
 
 
259
        (1) Files from current project - indicated by {CandidateAssemblyFiles}
 
260
        (2) $(ReferencePath) - the reference path property, which comes from the .USER file.
 
261
        (3) The directory of MSBuild's "target" runtime from GetFrameworkPath.
 
262
             The "target" runtime folder is the folder of the runtime that MSBuild is a part of.
 
263
        (4) Registered assembly folders, indicated by {Registry:*,*,*}
 
264
        (5) Legacy registered assembly folders, indicated by {AssemblyFolders}
 
265
        (6) $(HintPath) - the hintpath from the referenced item itself, indicated by {HintPath}.
 
266
        (7) Resolve to the GAC.
 
267
        (8) Treat the reference's Include as if it were a real file name.
 
268
    -->
 
269
    <PropertyGroup>
 
270
        <AssemblySearchPaths Condition=" '$(AssemblySearchPaths)' == '' ">
 
271
            {CandidateAssemblyFiles};
 
272
            $(ReferencePath);
 
273
            {HintPathFromItem};
 
274
            {TargetFrameworkDirectory};
 
275
            {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)};
 
276
            {AssemblyFolders};
 
277
            {GAC};
 
278
            {RawFileName}
 
279
        </AssemblySearchPaths>
 
280
    </PropertyGroup>
 
281
 
 
282
    <PropertyGroup>
 
283
        <BuildDependsOn>
 
284
            CoreBuild;
 
285
            CoreBuildSucceeded
 
286
        </BuildDependsOn>
 
287
    </PropertyGroup>
 
288
    <Target
 
289
        Name="Build"
 
290
        Outputs="$(TargetPath)"
 
291
        DependsOnTargets="$(BuildDependsOn)"
 
292
        />
 
293
 
 
294
    <!--
 
295
    This target creates <TargetPath> tags for items. <TargetPath> is a relative folder plus filename
 
296
    for the destination of this item.
 
297
    -->
 
298
    <Target
 
299
        Name="AssignTargetPaths"
 
300
        >
 
301
 
 
302
        <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
 
303
            <Output TaskParameter="AssignedFiles" ItemName="EmbeddedResourceWithTargetPath" />
 
304
        </AssignTargetPath>
 
305
        
 
306
        <AssignTargetPath Files="@(EmbeddedMappingSchemaFile)" RootFolder="$(MSBuildProjectDirectory)">
 
307
            <Output TaskParameter="AssignedFiles" ItemName="EmbeddedMappingSchemaFileWithTargetPath" />
 
308
        </AssignTargetPath>             
 
309
        
 
310
        <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)">
 
311
            <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath" />
 
312
        </AssignTargetPath>
 
313
 
 
314
        <AssignTargetPath Files="@(Compile)" RootFolder="$(MSBuildProjectDirectory)">
 
315
            <Output TaskParameter="AssignedFiles" ItemName="CompileWithTargetPath" />
 
316
        </AssignTargetPath>
 
317
 
 
318
        <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
 
319
            <Output TaskParameter="AssignedFiles" ItemName="NoneWithTargetPath" />
 
320
        </AssignTargetPath>
 
321
 
 
322
        <CreateItem
 
323
            Include="@(None);@(Content)"
 
324
            Condition="'%(Filename)%(Extension)' == 'App.Config'"
 
325
            AddAttributeName="TargetPath"
 
326
            AddAttributeValue="$(TargetFileName).config"
 
327
            >
 
328
            <Output TaskParameter="Include" ItemName="AppConfigWithTargetPath" />
 
329
        </CreateItem>
 
330
 
 
331
        <AssignTargetPath
 
332
            Files="@(None)"
 
333
            RootFolder="$(MSBuildProjectDirectory)"
 
334
            Condition="'%(Extension)' == '.manifest'"
 
335
            >
 
336
            <Output TaskParameter="AssignedFiles" ItemName="BaseManifestWithTargetPath" />
 
337
        </AssignTargetPath>   
 
338
        
 
339
        <CreateProperty
 
340
            Value="$(TargetDir)">
 
341
            <Output TaskParameter="Value" PropertyName="TargetDir" />
 
342
        </CreateProperty>
 
343
        
 
344
        <CreateProperty
 
345
            Value="$(TargetPath)">
 
346
            <Output TaskParameter="Value" PropertyName="TargetPath" />
 
347
        </CreateProperty>        
 
348
        
 
349
    </Target>    
 
350
 
 
351
    <!--
 
352
    This target is called only when doing a real build or checking whether a build is required.
 
353
    It is specifically not called during project load.
 
354
    -->
 
355
    <PropertyGroup>
 
356
        <BuildOnlySettings></BuildOnlySettings>
 
357
        <BuildingProject>false</BuildingProject>
 
358
    </PropertyGroup>
 
359
    <Target
 
360
        Name="BuildOnlySettings">
 
361
 
 
362
        <CreateProperty Value="true">
 
363
            <Output TaskParameter="Value" PropertyName="BuildingProject" />
 
364
        </CreateProperty>
 
365
 
 
366
    </Target>
 
367
 
 
368
    <!--
 
369
    Prepare the prerequisites for building.
 
370
    -->
 
371
    <PropertyGroup>
 
372
        <PrepareForBuildDependsOn>GetFrameworkPaths;AssignTargetPaths</PrepareForBuildDependsOn>
 
373
    </PropertyGroup>
 
374
    <Target
 
375
        Name="PrepareForBuild"
 
376
        DependsOnTargets="$(PrepareForBuildDependsOn)"
 
377
        >
 
378
 
 
379
        <!-- Create the directories for intermediate and final build products. -->
 
380
        <MakeDir
 
381
              Directories="$(OutDir);$(IntermediateOutputPath);@(DocFileItem->'%(RelativeDir)')"/>
 
382
 
 
383
        <!--
 
384
        We support building libraries even when there are no source files.
 
385
        If no source file is specified in the project file, then we generate
 
386
        an empty one here with an extension of $(DefaultLanguageSourceExtension).
 
387
        -->
 
388
        <Touch
 
389
              Condition="'@(Compile)'==''"
 
390
              AlwaysCreate="true"
 
391
              Files="$(IntermediateOutputPath)VisualStudio.Empty$(DefaultLanguageSourceExtension)">
 
392
 
 
393
            <Output TaskParameter="TouchedFiles" ItemName="Compile" Condition=" '$(BuildingInsideVisualStudio)' != 'true' "/>
 
394
        </Touch>
 
395
 
 
396
 
 
397
    </Target>
 
398
 
 
399
    <!--
 
400
    Get the Frameworks and Platform SDK paths.
 
401
    -->
 
402
    <PropertyGroup>
 
403
        <GetFrameworkPathsDependsOn></GetFrameworkPathsDependsOn>
 
404
    </PropertyGroup>
 
405
    <Target
 
406
        Name="GetFrameworkPaths"
 
407
        DependsOnTargets="$(GetFrameworkPathsDependsOn)"
 
408
        >
 
409
 
 
410
        <!-- Get the path to the target .NET framework directory. -->
 
411
        <GetFrameworkPath>
 
412
            <Output TaskParameter="Path" PropertyName="TargetFrameworkDirectory"/>
 
413
        </GetFrameworkPath>
 
414
 
 
415
        <!-- Get the path to the target .NET framework SDK directory. -->
 
416
        <GetFrameworkSDKPath>
 
417
            <Output TaskParameter="Path" PropertyName="TargetFrameworkSDKDirectory"/>
 
418
        </GetFrameworkSDKPath>
 
419
 
 
420
    </Target>
 
421
 
 
422
    <!--
 
423
    Run the pre-build event if there is one.
 
424
    -->
 
425
    <PropertyGroup>
 
426
        <PreBuildEventDependsOn></PreBuildEventDependsOn>
 
427
    </PropertyGroup>
 
428
    <Target
 
429
        Name="PreBuildEvent"
 
430
        Condition="'$(PreBuildEvent)'!=''"
 
431
        DependsOnTargets="$(PreBuildEventDependsOn)"
 
432
        >
 
433
 
 
434
        <Exec
 
435
              WorkingDirectory="$(OutDir)"
 
436
              Command="$(PreBuildEvent)" />
 
437
 
 
438
    </Target>
 
439
 
 
440
    <PropertyGroup>
 
441
        <UnmanagedUnregistrationDependsOn></UnmanagedUnregistrationDependsOn>
 
442
    </PropertyGroup>
 
443
    <Target
 
444
        Name="UnmanagedUnregistration"
 
445
        Condition="'$(RegisterForComInterop)_and_$(OutputType)'=='true_and_library'"
 
446
        DependsOnTargets="$(UnmanagedUnregistrationDependsOn)"
 
447
        >
 
448
 
 
449
        <UnregisterAssembly
 
450
            Condition="Exists('$(OutputPath)$(TargetFileName)')"
 
451
            Assemblies="$(OutputPath)$(TargetFileName)"
 
452
        />
 
453
 
 
454
    </Target>
 
455
 
 
456
    <!--
 
457
    Determine the strong name key source.
 
458
        [IN]
 
459
        $(AssemblyKeyContainerName)   - The key file
 
460
        $(AssemblyOriginatorKeyFile)  - The key file type (.snk or .pfx)
 
461
 
 
462
        [OUT]
 
463
        $(KeyContainerName)  - Use a container
 
464
        $(KeyOriginatorFile) - Use a file contining the key definition (.snk).
 
465
    -->
 
466
    <Target
 
467
        Name="ResolveKeySource"
 
468
        Condition="'$(AssemblyKeyContainerName)$(AssemblyOriginatorKeyFile)'!=''"
 
469
        >
 
470
 
 
471
        <ResolveKeySource
 
472
              KeyContainer="$(AssemblyKeyContainerName)"
 
473
              KeyFile="$(AssemblyOriginatorKeyFile)"
 
474
              SuppressAutoClosePasswordPrompt="$(BuildingInsideVisualStudio)"
 
475
              >
 
476
 
 
477
            <Output TaskParameter="ResolvedKeyContainer" PropertyName="ManifestKeyContainerName"/>
 
478
            <Output TaskParameter="ResolvedKeyFile" PropertyName="ManifestKeyOriginatorFile"/>
 
479
        </ResolveKeySource>
 
480
 
 
481
        <CreateProperty
 
482
            Value="$(ManifestKeyContainerName)"
 
483
            Condition=" '$(SignAssembly)' == 'true' ">
 
484
 
 
485
            <Output TaskParameter="Value" PropertyName="KeyContainerName" />
 
486
        </CreateProperty>
 
487
 
 
488
        <CreateProperty
 
489
            Value="$(ManifestKeyOriginatorFile)"
 
490
            Condition=" '$(SignAssembly)' == 'true' ">
 
491
 
 
492
            <Output TaskParameter="Value" PropertyName="KeyOriginatorFile" />
 
493
        </CreateProperty>
 
494
 
 
495
        <CreateProperty
 
496
            Value="$(AssemblyKeyProviderName)" >
 
497
 
 
498
            <Output TaskParameter="Value" PropertyName="KeyProviderName" />
 
499
        </CreateProperty>
 
500
 
 
501
 
 
502
        <Message Text="(out) KeySources: Container:'$(KeyContainerName)' File:'$(KeyOriginatorFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
503
        <Message Text="(out) KeySources: ManifestContainer:'$(ManifestKeyContainerName)' ManifestFile:'$(ManifestKeyOriginatorFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
504
 
 
505
    </Target>
 
506
 
 
507
 
 
508
    <!--
 
509
    Resolve native references
 
510
 
 
511
        [IN]
 
512
        @(NativeReference) - The manifest reference (or list of manifest references)
 
513
 
 
514
        [OUT]
 
515
        @(NativeReferenceFile)  - List of manifest files referenced.
 
516
        @(NetAssemblyReference) - List of .NET assemblies contained in the manifest.
 
517
        @(COMComponents)        - List of COM components contained in the manifest.
 
518
        @(TypeLibraries)        - List of type libraries contained in the manifest.
 
519
        @(COMFileReference)     - List of loose files contained in the manifest.
 
520
        @(LooseManifestFile)    - List of loose files contained in the manifest.
 
521
    -->
 
522
    <Target
 
523
        Name="ResolveNativeReferences"
 
524
        Condition="'@(NativeReference)'!=''"
 
525
        >
 
526
 
 
527
        <Message Text="(in) Native References: '@(NativeReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
528
 
 
529
        <ResolveNativeReference
 
530
              NativeReferences="@(NativeReference)"
 
531
              >
 
532
 
 
533
            <Output TaskParameter="ContainingReferenceFiles" ItemName="NativeReferenceFile"/>
 
534
            <Output TaskParameter="ContainedNetAssemblies" ItemName="NetAssemblyReference"/>
 
535
            <Output TaskParameter="ContainedComComponents" ItemName="ComClassReference"/>
 
536
            <Output TaskParameter="ContainedTypeLibraries" ItemName="COMReference"/>
 
537
            <Output TaskParameter="ContainedLooseTlbFiles" ItemName="COMFileReference"/>
 
538
            <Output TaskParameter="ContainedLooseEtcFiles" ItemName="LooseManifestFile"/>
 
539
 
 
540
        </ResolveNativeReference>
 
541
 
 
542
        <Message Text="(out) NativeReferenceFile: '@(NativeReferenceFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
543
        <Message Text="(out) NetAssemblyReference: '@(NetAssemblyReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
544
        <Message Text="(out) ComClassReference: '@(ComClassReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
545
        <Message Text="(out) COMReference: '@(COMReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
546
        <Message Text="(out) COMFileReference: '@(COMFileReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
547
        <Message Text="(out) LooseManifestFile: '@(LooseManifestFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
548
 
 
549
    </Target>
 
550
 
 
551
    <!--
 
552
    Resolve COM references
 
553
 
 
554
        [IN]
 
555
        @(COMReference) - The list of COM references
 
556
        $(BaseOutputPath) - The output directory in which to generate wrapper assemblies
 
557
 
 
558
        [OUT]
 
559
        @(ReferencePath) - Paths to referenced wrappers.
 
560
 
 
561
        NOTE: If ResolveComReferences is invoked from the IDE, PrepareForBuild may need to run to create directories,
 
562
                so don't remove the PrepareForBuild target from the DependsOnTargets below!
 
563
    -->
 
564
    <Target
 
565
        Name="ResolveComReferences"
 
566
        Condition="'@(COMReference)_@(COMFileReference)'!='_'"
 
567
        DependsOnTargets="PrepareForBuild;ResolveKeySource;ResolveAssemblyReferences"
 
568
        >
 
569
 
 
570
        <Message Text="(in) COM References: '@(COMReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
571
        <Message Text="(in) COM File References: '@(COMFileReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
572
 
 
573
 
 
574
        <ResolveComReference
 
575
              TypeLibNames="@(COMReference)"
 
576
              TypeLibFiles="@(COMFileReference)"
 
577
              ResolvedAssemblyReferences="@(ReferencePath)"
 
578
              WrapperOutputDirectory="$(BaseOutputPath)"
 
579
              KeyContainer="$(KeyContainerName)"
 
580
              KeyFile="$(KeyOriginatorFile)"
 
581
              DelaySign="$(DelaySign)"
 
582
              >
 
583
 
 
584
            <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
 
585
 
 
586
            <Output TaskParameter="ResolvedFiles" ItemName="ReferenceComWrappersToCopyLocal"/>
 
587
 
 
588
            <Output TaskParameter="ResolvedModules" ItemName="ResolvedIsolatedComModules"
 
589
                Condition=" '%(COMReference.Isolated)' == 'true' "/>
 
590
 
 
591
        </ResolveComReference>
 
592
 
 
593
        <Message Text="(out) ResolvedReferencePaths: '@(ReferencePath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
594
    </Target>
 
595
 
 
596
    <!--
 
597
    Split project references into two lists: VC project references and others (handled by the MSBuild engine)
 
598
 
 
599
        [IN]
 
600
        @(ProjectReference) - the list of all project references
 
601
 
 
602
        [OUT]
 
603
        @(VCProjectReference) - the list of VC (managed VC++ to be exact) project references
 
604
        @(MSBuildProjectReference) - the list of MSBuild project references
 
605
    -->
 
606
    <Target
 
607
        Name="SplitProjectReferencesByType"
 
608
        Condition="'@(ProjectReference)'!=''">
 
609
 
 
610
        <Message Text="(in) All Project References: '@(ProjectReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
611
 
 
612
        <!-- Copy all VC project references to the VCProjectReference item list (using the VC package GUID) -->
 
613
        <CreateItem
 
614
            Include="@(ProjectReference)"
 
615
            Condition="'%(ProjectReference.Package)'=='{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'">
 
616
 
 
617
            <Output TaskParameter="Include" ItemName="VCProjectReference"/>
 
618
        </CreateItem>
 
619
 
 
620
        <!-- Copy the rest of the project references to the MSBuildProjectReference item list -->
 
621
        <CreateItem
 
622
            Include="@(ProjectReference)"
 
623
            Condition="'%(ProjectReference.Package)'!='{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'">
 
624
 
 
625
            <Output TaskParameter="Include" ItemName="MSBuildProjectReference"/>
 
626
        </CreateItem>
 
627
 
 
628
        <Message Text="(out) VC Project References: '@(VCProjectReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
629
        <Message Text="(out) MSBuild Project References: '@(MSBuildProjectReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
630
    </Target>
 
631
 
 
632
    <!--
 
633
    Find outputs of referenced VC projects (currently we never build VC projects ourselves)
 
634
 
 
635
        [IN]
 
636
        @(VCProjectReference) - the list of VC project references
 
637
 
 
638
        [OUT]
 
639
        @(ResolvedProjectReferencePaths) - paths to projects' outputs
 
640
    -->
 
641
 
 
642
    <!--
 
643
    This is a simplified way to guess the configuration we should look up in the VC project.
 
644
    This will go away once we implement solution configurations properly
 
645
    -->
 
646
    <PropertyGroup Condition="'$(BuildingInsideVisualStudio)'!='true'">
 
647
        <VCConfiguration>$(Configuration)|Win32</VCConfiguration>
 
648
    </PropertyGroup>
 
649
    <Target
 
650
        Name="ResolveVCProjectReferences"
 
651
        Condition="'@(VCProjectReference)'!=''"
 
652
        DependsOnTargets="SplitProjectReferencesByType">
 
653
 
 
654
        <Message Text="(in) VC Project References: '@(VCProjectReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
655
 
 
656
        <!-- This property is prepopulated with VC project outputs by VS if we're building inside the IDE -->
 
657
        <Message Text="(in) Resolved VC References: '$(ResolvedVCProjectOutputs)'" Condition="'$(MSBuildTargetsVerbose)$(BuildingInsideVisualStudio)'=='truetrue'"/>
 
658
 
 
659
        <ResolveVCProjectOutput
 
660
            ProjectReferences="@(VCProjectReference)"
 
661
            PreresolvedVCOutputs="$(ResolvedVCProjectOutputs)"
 
662
            Condition="'$(BuildingInsideVisualStudio)'=='true'">
 
663
 
 
664
            <Output TaskParameter="ResolvedOutputPaths" ItemName="ResolvedProjectReferencePaths"/>
 
665
 
 
666
        </ResolveVCProjectOutput>
 
667
 
 
668
        <ResolveVCProjectOutput
 
669
            ProjectReferences="@(VCProjectReference)"
 
670
            Configuration="$(VCConfiguration)"
 
671
            Condition="'$(BuildingInsideVisualStudio)'!='true'">
 
672
 
 
673
            <Output TaskParameter="ResolvedOutputPaths" ItemName="ResolvedProjectReferencePaths"/>
 
674
 
 
675
        </ResolveVCProjectOutput>
 
676
 
 
677
        <Message Text="(out) ReferencePaths: '@(ResolvedProjectReferencePaths)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
678
 
 
679
    </Target>
 
680
 
 
681
    <!--
 
682
    Build referenced projects:
 
683
 
 
684
        [IN]
 
685
        @(MSBuildProjectReference) - The list of project references.
 
686
 
 
687
        [OUT]
 
688
        @(ResolvedProjectReferencePaths) - Paths to referenced projects.
 
689
    -->
 
690
    <Target
 
691
        Name="ResolveProjectReferences"
 
692
        Condition="'@(MSBuildProjectReference)'!=''"
 
693
        DependsOnTargets="SplitProjectReferencesByType">
 
694
 
 
695
        <Message Text="(in) MSBuild Project References: '@(MSBuildProjectReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
696
 
 
697
        <!--
 
698
        Build referenced projects when doing an integrated build from VisualStudio.
 
699
        When building from VisualStudio, just gather the referenced build outputs.
 
700
        Visual studio will already have built the project, so there's no need to
 
701
        do it again here.
 
702
 
 
703
        We have ContinueOnError="true" because we don't want to block the build if
 
704
        one of the referenced projects doesn't exist or contains syntax errors.
 
705
        -->
 
706
        <MSBuild
 
707
              Projects="@(MSBuildProjectReference)"
 
708
              Targets="MainBuiltProjectOutputGroup"
 
709
              Condition="'$(BuildingInsideVisualStudio)'=='true'"
 
710
              ContinueOnError="!$(BuildingProject)">
 
711
 
 
712
             <Output TaskParameter="TargetOutputs" ItemName="ResolvedProjectReferencePaths"/>
 
713
 
 
714
        </MSBuild>
 
715
 
 
716
        <!--
 
717
        Build referenced projects when building from the command line.
 
718
        When building from the command line, always build the referenced projects.
 
719
        -->
 
720
        <MSBuild
 
721
              Projects="@(MSBuildProjectReference)"
 
722
              Condition="'$(BuildingInsideVisualStudio)'!='true'">
 
723
 
 
724
             <Output TaskParameter="TargetOutputs" ItemName="ResolvedProjectReferencePaths"/>
 
725
 
 
726
        </MSBuild>
 
727
 
 
728
        <Message Text="(out) ReferencePaths: '@(ResolvedProjectReferencePaths)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
729
 
 
730
    </Target>
 
731
 
 
732
    <!--
 
733
    Split EmbeddedResource and EmbeddedMappingSchemaFile into five lists based on whether
 
734
    they are resx files, licx files or other resources and whether they should be localized.
 
735
 
 
736
        [IN]
 
737
        @(EmbeddedResourceWithTargetPath) - The raw list of resources.
 
738
        @(EmbeddedMappingSchemaFileWithTargetPath) - The raw list of embedded mapping schema file resources.
 
739
 
 
740
        [INTERMEDIATES]
 
741
        @(MixedResourceWithNoCulture) - The EmbeddedResource items that have no Culture property.
 
742
        @(MixedResourceWithCulture) - The EmbeddedResource items that have a Culture property.
 
743
 
 
744
        [OUT]
 
745
        @(LicxFile) - The EmbeddedResource items with extension equal to '.licx'.
 
746
        @(ResxWithNoCulture) - Those with no culture that should be passed through the ResGen task.
 
747
        @(ResxWithCulture) - Those with culture that should be passed through the ResGen task.
 
748
        @(NonResxWithNoCulture) - Those that should be passed directly into the compiler.
 
749
        @(NonResxWithCulture) - Those that should be passed directly into AL for the satellite assemblies.
 
750
    -->
 
751
    <Target
 
752
        Name="SplitResourcesByCulture"
 
753
        DependsOnTargets="AssignTargetPaths"
 
754
        >
 
755
 
 
756
        <Message Text="(in) Resources: '@(EmbeddedResourceWithTargetPath)@(EmbeddedMappingSchemaFileWithTargetPath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
757
 
 
758
        <CreateItem
 
759
            Condition="'%(Extension)'=='.licx'"
 
760
            Include="@(EmbeddedResourceWithTargetPath)">
 
761
 
 
762
            <Output TaskParameter="Include" ItemName="LicxFile"/>
 
763
        </CreateItem>
 
764
 
 
765
        <Message Text="(out) LicxFile: '@(LicxFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
766
 
 
767
        <AssignCulture
 
768
              Condition="'%(Extension)'!='.licx'"
 
769
              Files="@(EmbeddedResourceWithTargetPath);@(EmbeddedMappingSchemaFileWithTargetPath)">
 
770
 
 
771
            <!-- Create the list of culture resx and embedded resource files -->
 
772
            <Output TaskParameter="AssignedFilesWithCulture" ItemName="MixedResourceWithCulture"/>
 
773
            <!-- Create the list of non-culture resx and embedded resource files -->
 
774
            <Output TaskParameter="AssignedFilesWithNoCulture" ItemName="MixedResourceWithNoCulture"/>
 
775
        </AssignCulture>
 
776
 
 
777
 
 
778
        <Message Text="(intermediate) EmbeddedResource files with no culture: '@(MixedResourceWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
779
        <Message Text="(intermediate) EmbeddedResource files with culture: '@(MixedResourceWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
780
 
 
781
        <CreateItem
 
782
              Condition="'%(Extension)'=='.resx'"
 
783
              Include="@(MixedResourceWithNoCulture)">
 
784
 
 
785
            <Output TaskParameter="Include" ItemName="ResxWithNoCulture"/>
 
786
        </CreateItem>
 
787
        <CreateItem
 
788
              Condition="'%(Extension)'!='.resx'"
 
789
              Include="@(MixedResourceWithNoCulture)">
 
790
            <Output TaskParameter="Include" ItemName="NonResxWithNoCulture"/>
 
791
        </CreateItem>
 
792
 
 
793
        <Message Text="(out) Non *.resx files with no culture: '@(NonResxWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
794
        <Message Text="(out) Resx files with no culture: '@(ResxWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
795
 
 
796
        <CreateItem
 
797
              Condition="'%(Extension)'=='.resx'"
 
798
              Include="@(MixedResourceWithCulture)">
 
799
 
 
800
            <Output TaskParameter="Include" ItemName="ResxWithCulture"/>
 
801
        </CreateItem>
 
802
        <CreateItem
 
803
              Condition="'%(Extension)'!='.resx'"
 
804
              Include="@(MixedResourceWithCulture)">
 
805
 
 
806
            <Output TaskParameter="Include" ItemName="NonResxWithCulture"/>
 
807
        </CreateItem>
 
808
 
 
809
        <Message Text="(out) Non *.resx files with culture: '@(NonResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
810
        <Message Text="(out) Resx files with culture: '@(ResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
811
 
 
812
    </Target>
 
813
 
 
814
    <!--
 
815
    Copy non-resx resource files from their original name to the manifest resource name.
 
816
    This is so that the file will be in the location expected by the compiler.
 
817
 
 
818
    UNDONE-RG.  This target should go away entirely.  We shouldn't need to copy the non-RESXs
 
819
    to their manifest name.  Instead, just stick a "LogicalName" attribute on it, and it should
 
820
    be taken care of by the compiler automatically.
 
821
 
 
822
        [IN]
 
823
        @(NonResxWithNoCulture) - The list of non-culture non-resx resource files to copy.
 
824
        @(NonResxWithCulture) - The list of culture non-resx resource files to copy.
 
825
        @(ManifestNonResxWithNoCulture) - The manifest resource name of non-culture non-resx resource files.
 
826
        @(ManifestNonResxWithCulture) - The manifest resource name of culture non-resx resource files.
 
827
 
 
828
        [OUT]
 
829
        @(ManifestNonResxWithNoCultureOnDisk) - The final location on disk of the non-culture non-resx resource files.
 
830
        @(ManifestNonResxWithCultureOnDisk) - The final location on disk of the culture non-resx resource files.
 
831
    -->
 
832
    <Target
 
833
        Name="CopyNonResxEmbeddedResources"
 
834
        Condition="'@(NonResxWithNoCulture)@(NonResxWithCulture)@(ManifestNonResxWithNoCulture)@(ManifestNonResxWithCulture)'!=''"
 
835
        >
 
836
 
 
837
        <Message Text="(in) The names of the non-RESX files to copy from: '@(NonResxWithNoCulture);@(NonResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
838
        <Message Text="(in) Manifest-named non *.resx files to copy to: '@(ManifestNonResxWithNoCulture);@(ManifestNonResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
839
 
 
840
        <Copy
 
841
            SourceFiles="@(NonResxWithNoCulture)"
 
842
            DestinationFiles="@(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)')"
 
843
            SkipUnchangedFiles="true"
 
844
            Condition="'@(NonResxWithNoCulture)'!=''"
 
845
            >
 
846
 
 
847
            <Output
 
848
                TaskParameter="DestinationFiles"
 
849
                ItemName="ManifestNonResxWithNoCultureOnDisk"/>
 
850
 
 
851
        </Copy>
 
852
 
 
853
        <MakeDir
 
854
            Directories="$(IntermediateOutputPath)%(ManifestNonResxWithCulture.Culture)"
 
855
            />
 
856
 
 
857
        <Copy
 
858
            SourceFiles="@(NonResxWithCulture)"
 
859
            DestinationFiles="@(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)')"
 
860
            SkipUnchangedFiles="true"
 
861
            Condition="'@(NonResxWithCulture)'!=''"
 
862
            >
 
863
 
 
864
            <Output
 
865
                TaskParameter="DestinationFiles"
 
866
                ItemName="ManifestNonResxWithCultureOnDisk"/>
 
867
 
 
868
        </Copy>
 
869
 
 
870
    </Target>
 
871
 
 
872
    <!--
 
873
    Run resgen on the given resx files.
 
874
 
 
875
    This task checks timestamps internally for the .resx files as well as any linked files that are
 
876
    referenced in the .resx file against the .resources file, so it does not need to specify Inputs
 
877
    or Outputs in the Target.
 
878
 
 
879
        [IN]
 
880
        @(ResxWithNoCulture) - The names the non-culture .RESX files.
 
881
        @(ResxWithCulture) - The names the culture .RESX files.
 
882
        @(ManifestResourceWithNoCultureName) - The corresponding manifest resource name (.RESOURCE)
 
883
        @(ManifestResourceWithCultureName) - The corresponding manifest resource name (.RESOURCE)
 
884
 
 
885
        [OUT]
 
886
        @(ManifestResourceWithNoCulture) - The path to the corresponding .RESOURCE  files
 
887
        @(ManifestResourceWithCulture) - The path to the corresponding .RESOURCE  files
 
888
    -->
 
889
    <PropertyGroup>
 
890
        <ResGenDependsOn>ResolveAssemblyReferences</ResGenDependsOn>
 
891
        <UseSourcePath Condition="'$(UseSourcePath)'==''">true</UseSourcePath>
 
892
    </PropertyGroup>
 
893
    <Target
 
894
        Name="ResGen"
 
895
        Condition="'@(ResxWithNoCulture)@(ResxWithCulture)'!=''"
 
896
        DependsOnTargets="$(ResGenDependsOn)"
 
897
        >
 
898
 
 
899
        <Message Text="(in) The names the non-culture .RESX files: '@(ResxWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
900
        <Message Text="(in) The names the culture .RESX files: '@(ResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
901
        <Message Text="(in) Manifest-named resx files files with no culture: '@(ManifestResourceWithNoCultureName)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
902
        <Message Text="(in) Manifest-named resx files with culture: '@(ManifestResourceWithCultureName)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
903
 
 
904
        <ResGen
 
905
            Sources="@(ResxWithNoCulture)"
 
906
            Condition=" '@(ResxWithNoCulture)' != '' "
 
907
            References="@(ReferencePath)"
 
908
            UseSourcePath="$(UseSourcePath)"
 
909
            StateFile="$(IntermediateOutputPath)ResGen.cache"
 
910
            OutputResources="@(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
 
911
            ToolPath="$(ResGenToolPath)">
 
912
 
 
913
            <Output
 
914
                TaskParameter="OutputResources"
 
915
                ItemName="ManifestResourceWithNoCulture"/>
 
916
        </ResGen>
 
917
 
 
918
        <ResGen
 
919
            Sources="@(ResxWithCulture)"
 
920
            Condition=" '@(ResxWithCulture)' != '' "
 
921
            References="@(ReferencePath)"
 
922
            UseSourcePath="$(UseSourcePath)"
 
923
            OutputResources="@(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
 
924
            ToolPath="$(ResGenToolPath)">
 
925
 
 
926
            <Output
 
927
                TaskParameter="OutputResources"
 
928
                ItemName="ManifestResourceWithCulture"/>
 
929
        </ResGen>
 
930
 
 
931
        <Message Text="(out) The path to the corresponding non-culture .RESOURCE files: '@(ManifestResourceWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
932
        <Message Text="(out) The path to the corresponding culture .RESOURCE  files: '@(ManifestResourceWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
933
 
 
934
    </Target>
 
935
 
 
936
    <!--
 
937
    Create one satellite assembly for every unique culture in the resources.
 
938
 
 
939
        [IN]
 
940
        @(ManifestResourceWithCulture) - The list of culture-specific resource (.RESOURCE) files.
 
941
        @(ManifestNonResxWithCultureOnDisk) - The list of culture-specific non-.RESX resource files.
 
942
 
 
943
        [OUT]
 
944
        @(SatelliteAssemblies) - Those with no culture that should be passed through the ResGen task.
 
945
    -->
 
946
    <PropertyGroup>
 
947
        <CreateSatelliteAssembliesDependsOn></CreateSatelliteAssembliesDependsOn>
 
948
    </PropertyGroup>
 
949
    <Target
 
950
        Name="CreateSatelliteAssemblies"
 
951
        Condition="'@(ManifestResourceWithCulture)@(ManifestNonResxWithCultureOnDisk)'!=''"
 
952
        Inputs="@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk);@(IntermediateAssembly)"
 
953
        Outputs="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
 
954
        DependsOnTargets="$(CreateSatelliteAssembliesDependsOn)"
 
955
     >
 
956
        <Message Text="(in) The list of locale-specific resource files: '@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
957
 
 
958
        <MakeDir
 
959
            Directories="$(IntermediateOutputPath)%(ManifestResourceWithCulture.Culture)"
 
960
            Condition=" '@(ManifestResourceWithCulture)' != '' "
 
961
            />
 
962
 
 
963
        <MakeDir
 
964
            Directories="$(IntermediateOutputPath)%(ManifestNonResxWithCultureOnDisk.Culture)"
 
965
            Condition=" '@(ManifestNonResxWithCultureOnDisk)' != '' "
 
966
            />
 
967
 
 
968
        <AL
 
969
            EmbedResources="@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
 
970
            Culture="%(Culture)"
 
971
            TemplateFile="@(IntermediateAssembly)"
 
972
            KeyContainer="$(KeyContainerName)"
 
973
            KeyFile="$(KeyOriginatorFile)"
 
974
            DelaySign="$(DelaySign)"
 
975
            OutputAssembly="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll">
 
976
 
 
977
            <Output TaskParameter="OutputAssembly"
 
978
                    ItemName="SatelliteAssemblies"/>
 
979
        </AL>
 
980
 
 
981
        <Message Text="(out) The list of satellite assemblies: '@(SatelliteAssemblies)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
982
    </Target>
 
983
 
 
984
    <!--
 
985
    Given the list of assemblies, find the closure of all assemblies that they depend on. These are
 
986
    what we need to copy to the output directory.
 
987
 
 
988
        [IN]
 
989
        @(Reference) - List of assembly references as fusion names.
 
990
        @(NetAssemblyReference) - List of assembly references from manifests.
 
991
        @(ResolvedProjectReferencePaths) - List of project references produced by projects that this project depends on.
 
992
 
 
993
            The 'Private' attribute on the reference corresponds to corresponds to the Copy Local flag in VS.
 
994
            The 'Private' flag can have three possible values:
 
995
                - 'True' means the reference should be Copied Local
 
996
                - 'False' means the reference should not be Copied Local
 
997
                - [Missing] means this task will decide whether to treat this reference as CopyLocal or not.
 
998
 
 
999
        [OUT]
 
1000
        @(ReferencePath) - Paths to resolved primary files.
 
1001
        @(ReferenceDependencyPaths) - Paths to resolved dependency files.
 
1002
        @(ReferenceRelatedPaths) - Paths to .xmls and .pdbs.
 
1003
        @(ReferenceSatellitePaths) - Paths to satellites.
 
1004
        @(ReferenceCopyLocalPaths) - Paths to files that should be copied to the local directory.
 
1005
    -->
 
1006
    <PropertyGroup>
 
1007
        <ResolveAssemblyReferencesDependsOn>GetFrameworkPaths;AssignTargetPaths</ResolveAssemblyReferencesDependsOn>
 
1008
    </PropertyGroup>
 
1009
    <Target
 
1010
        Name="ResolveAssemblyReferences"
 
1011
        Condition="'@(Reference)@(NetAssemblyReference)@(ResolvedProjectReferencePaths)'!=''"
 
1012
        DependsOnTargets="$(ResolveAssemblyReferencesDependsOn)"
 
1013
     >
 
1014
        <Message Text="(in) The list of all assembly references: '@(Reference);@(NetAssemblyReference)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1015
        <Message Text="(in) The list of all project references: '@(ResolvedProjectReferencePaths)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1016
        <Message Text="(in) Candidate assembly files from Content and None groups: '@(Content);@(None)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1017
        <Message Text="(in) Search paths: $(AssemblySearchPaths)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1018
 
 
1019
        <!--
 
1020
        Only read and write cache file at build time, skip it for load time because its more
 
1021
        expensive to write the newly created cache file.
 
1022
        -->
 
1023
        <CreateProperty
 
1024
            Value="$(IntermediateOutputPath)ResolveAssemblyReference.cache"
 
1025
            Condition="'$(BuildingProject)'=='true'">
 
1026
 
 
1027
            <Output TaskParameter="Value" PropertyName="ResolveAssemblyReferencesStateFile" />
 
1028
 
 
1029
        </CreateProperty>
 
1030
 
 
1031
        <!--
 
1032
        Make an App.Config item that exists when AutoUnify is false.
 
1033
        -->
 
1034
        <CreateItem
 
1035
            Include="@(AppConfigWithTargetPath)"
 
1036
            Condition="'$(AutoUnifyAssemblyReferences)'=='false'">
 
1037
            <Output TaskParameter="Include" ItemName="ApplicationConfigFileForExes" />
 
1038
        </CreateItem>
 
1039
 
 
1040
        <ResolveAssemblyReference
 
1041
            Assemblies="@(Reference);@(NetAssemblyReference)"
 
1042
            AssemblyFiles="@(ResolvedProjectReferencePaths)"
 
1043
            TargetFrameworkDirectory="$(TargetFrameworkDirectory)"
 
1044
            CandidateAssemblyFiles="@(Content);@(None)"
 
1045
            SearchPaths="$(AssemblySearchPaths)"
 
1046
            TargetProcessorArchitecture="$(ProcessorArchitecture)"
 
1047
            AppConfigFile="@(ApplicationConfigFileForExes)"
 
1048
            AutoUnify="$(AutoUnifyAssemblyReferences)"
 
1049
            FindDependencies="$(BuildingProject)"
 
1050
            FindSatellites="$(BuildingProject)"
 
1051
            FindRelatedFiles="$(BuildingProject)"
 
1052
            Silent="!$(BuildingProject)"
 
1053
            StateFile="$(ResolveAssemblyReferencesStateFile)"
 
1054
            >
 
1055
 
 
1056
            <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
 
1057
            <Output TaskParameter="ResolvedDependencyFiles" ItemName="ReferenceDependencyPaths"/>
 
1058
            <Output TaskParameter="RelatedFiles" ItemName="ReferenceRelatedPaths"/>
 
1059
            <Output TaskParameter="SatelliteFiles" ItemName="ReferenceSatellitePaths"/>
 
1060
            <Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/>
 
1061
            <Output TaskParameter="SuggestedRedirects" ItemName="SuggestedBindingRedirects"/>
 
1062
 
 
1063
        </ResolveAssemblyReference>
 
1064
 
 
1065
 
 
1066
        <Message Text="(out) Resolved paths to primary references: '@(ReferencePath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1067
        <Message Text="(out) Files to be copied to the output directory: '@(ReferenceCopyLocalPaths)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1068
 
 
1069
    </Target>
 
1070
 
 
1071
    <PropertyGroup>
 
1072
        <ResolveReferencesDependsOn>
 
1073
            ResolveNativeReferences;
 
1074
            SplitProjectReferencesByType;
 
1075
            ResolveProjectReferences;
 
1076
            ResolveVCProjectReferences;
 
1077
            ResolveAssemblyReferences;
 
1078
            ResolveComReferences
 
1079
        </ResolveReferencesDependsOn>
 
1080
    </PropertyGroup>
 
1081
    <Target
 
1082
        Name="ResolveReferences"
 
1083
        DependsOnTargets="$(ResolveReferencesDependsOn)"/>
 
1084
 
 
1085
    <!--
 
1086
    Compile .licx files (containing information about licensed controls used by the application) into .licenses files.
 
1087
 
 
1088
        [IN]
 
1089
        @(LicxFile) - The list of .licx files in the project (usually there will be just one)
 
1090
 
 
1091
        [OUT]
 
1092
        @(CompiledLicenseFile) - The list of compiled .licenses files (there will be just one)
 
1093
    -->
 
1094
    <PropertyGroup>
 
1095
        <CompileLicxFilesDependsOn></CompileLicxFilesDependsOn>
 
1096
    </PropertyGroup>
 
1097
    <Target
 
1098
        Name="CompileLicxFiles"
 
1099
        Inputs="@(LicxFile);@(ReferencePath);@(ReferenceDependencyPaths)"
 
1100
        Outputs="$(IntermediateOutputPath)$(TargetFileName).licenses"
 
1101
        Condition="'@(LicxFile)'!=''"
 
1102
        DependsOnTargets="$(CompileLicxFilesDependsOn)">
 
1103
 
 
1104
        <Message Text="(in) The list of .licx files: '@(LicxFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1105
 
 
1106
        <LC
 
1107
            Sources="@(LicxFile)"
 
1108
            LicenseTarget="$(TargetFileName)"
 
1109
            OutputDirectory="$(IntermediateOutputPath)"
 
1110
            OutputLicenses="$(IntermediateOutputPath)$(TargetFileName).licenses"
 
1111
            ReferencedAssemblies="@(ReferencePath);@(ReferenceDependencyPaths)">
 
1112
 
 
1113
            <Output
 
1114
                TaskParameter="OutputLicenses"
 
1115
                ItemName="CompiledLicenseFile"/>
 
1116
        </LC>
 
1117
 
 
1118
        <Message Text="(out) The list of .licenses files: '@(CompiledLicenseFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1119
 
 
1120
    </Target>
 
1121
 
 
1122
 
 
1123
    <!--
 
1124
    Determine whether any XML manifests should be generated.
 
1125
    XML manifests are required if the application has any native or reg-free COM references,
 
1126
    or if the ClickOnce option is enabled.
 
1127
    The purpose of the set of three targets below is to cause the GenerateManifests target
 
1128
        to run if any of the following conditions are met:
 
1129
    a) If one or more NativeReference or ResolvedIsolatedComModules items are present.
 
1130
    b) If GenerateClickOnceManifests property is true.
 
1131
    -->
 
1132
    <Target
 
1133
        Name="BuildNativeManifest"
 
1134
        Condition="'@(NativeReference)@(ResolvedIsolatedComModules)'!=''"
 
1135
        DependsOnTargets="GenerateManifests"/>
 
1136
    <Target
 
1137
        Name="BuildClickOnceManifests"
 
1138
        Condition="'$(GenerateClickOnceManifests)'=='true'"
 
1139
        DependsOnTargets="GenerateManifests"/>
 
1140
    <Target
 
1141
        Name="BuildManifests"
 
1142
        DependsOnTargets="BuildNativeManifest;BuildClickOnceManifests"/>
 
1143
 
 
1144
 
 
1145
    <!--
 
1146
    Compute info for native manifest generation
 
1147
 
 
1148
        [IN]
 
1149
        @(IntermediateAssembly) - Path to built assembly, used to obtain version for generated manifest.
 
1150
 
 
1151
        [OUT]
 
1152
        $(ManifestVersion) - Version of generated manifest.
 
1153
    -->
 
1154
    <Target
 
1155
        Name="ComputeNativeManifestInfo"
 
1156
        Condition="'$(GenerateClickOnceManifests)'!='true'">
 
1157
 
 
1158
        <!-- Obtain manifest version from the built assembly -->
 
1159
        <Message Text="(in) IntermediateAssembly: '@(IntermediateAssembly)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1160
        <GetAssemblyIdentity AssemblyFiles="@(IntermediateAssembly)">
 
1161
            <Output TaskParameter="Assemblies" ItemName="IntermediateAssemblyIdentity"/>
 
1162
        </GetAssemblyIdentity>
 
1163
        <Message Text="(out) IntermediateAssemblyIdentity: '@(IntermediateAssemblyIdentity)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1164
        <CreateProperty Value="@(IntermediateAssemblyIdentity->'%(Version)')">
 
1165
            <Output TaskParameter="Value" PropertyName="ManifestVersion"/>
 
1166
        </CreateProperty>
 
1167
        <Message Text="(out) ManifestVersion: '$(ManifestVersion)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1168
 
 
1169
    </Target>
 
1170
 
 
1171
 
 
1172
    <!--
 
1173
    Compute info for  ClickOnce manifest generation
 
1174
 
 
1175
        [IN]
 
1176
        $(ApplicationVersion) - Application version, can be either 1.0.0.0 or 1.0.0.*.
 
1177
        $(ApplicationRevision) - Application revision, used if ApplicationVersion is 1.0.0.*.
 
1178
        $(TargetCulture) - Determines the set of sattelites to include in the manifest.
 
1179
        @(BaseManifestWithTargetPath) - The base app.manifest from project.
 
1180
        @(ReferencePath) - List of project references.
 
1181
        @(ReferenceDependencyPaths) - List of dependent project references.
 
1182
        $(IntermediateOutputPath) - Used to obtain debug symbols and documentation files for project.
 
1183
        @(ReferenceRelatedPaths) - Used to obtain debug symbols and documentation files for dependent projects.
 
1184
        @(Content) - Content files to include in manifest.
 
1185
        @(PublishFile) - List that determines whether corresponding items are flagged in the manifest with attributes such as group, optional, etc.
 
1186
        @(AppConfigWithTargetPath) - App config file, if present.
 
1187
        @(ManifestIconFile) - Icon file, if present.
 
1188
        @(SatelliteAssemblies) - List of satellites for project.
 
1189
        @(ReferenceSatellitePaths) - List of satellites for dependent projects.
 
1190
        $(TargetUrl) - Deployment provider url for manifest, required for all installed applications.
 
1191
        $(SupportUrl) - Support url for manifest.
 
1192
 
 
1193
        [OUT]
 
1194
        @(ManifestDependencies) - List of assemblies to be expressed as dependencies in the manifest.
 
1195
        @(ManifestEntryPoint) - Identifies the manifest that defines the entry point for the application.
 
1196
        @(ManifestFiles) - List of files to be expressed in the manifest, including icon file and config file if present.
 
1197
        @(ManifestPrerequisites) - List of assemblies to be expressed as prerequisites in the manifest.
 
1198
        @(ManifestSatellites) - List of assemblies to be expressed as satellites in the manifest.
 
1199
        $(ManifestVersion) - Version of generated manifest.
 
1200
        $(FormattedTargetUrl) - Formatted version of corresponding input url.
 
1201
        $(FormattedSupportUrl) - Formatted version of corresponding input url.
 
1202
    -->
 
1203
    <Target
 
1204
        Name="ComputeClickOnceManifestInfo"
 
1205
        Condition="'$(GenerateClickOnceManifests)'=='true'"
 
1206
        DependsOnTargets="AssignTargetPaths"
 
1207
        >
 
1208
 
 
1209
        <!-- Create list of items for manifest generation -->
 
1210
        <Message Text="(in) BaseManifestWithTargetPath: '@(BaseManifestWithTargetPath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1211
        <Message Text="(in) EntryPoint: '@(ManifestEntryPoint)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1212
        <Message Text="(in) ReferencePath: '@(ReferencePath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1213
        <Message Text="(in) ReferenceDependencyPaths: '@(ReferenceDependencyPaths)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1214
        <Message Text="(in) Prerequisites: '@(ManifestPrerequisites)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1215
        <Message Text="(in) Satellites: '@(SatelliteAssemblies);@(ReferenceSatellitePaths)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1216
        <Message Text="(in) Files: '@(Content)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1217
        <Message Text="(in) ExtraFiles: '$(IntermediateOutputPath)$(TargetName).pdb;$(IntermediateOutputPath)$(TargetName).xml;@(ReferenceRelatedPaths)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1218
        <Message Text="(in) PublishFiles: '@(PublishFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1219
        <Message Text="(in) ManifestConfigFile: '@(AppConfigWithTargetPath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1220
        <Message Text="(in) ManifestIconFile: '@(ManifestIconFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1221
        <Message Text="(in) TargetCulture: '$(TargetCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1222
        <ResolveManifestFiles
 
1223
            BaseManifest="@(BaseManifestWithTargetPath)"
 
1224
            Dependencies="@(ReferencePath);@(ReferenceDependencyPaths)"
 
1225
            EntryPoint="@(ManifestEntryPoint)"
 
1226
            ExcludedPermissions="$(ExcludedPermissions)"
 
1227
            ExtraFiles="$(IntermediateOutputPath)$(TargetName).pdb;$(IntermediateOutputPath)$(TargetName).xml;@(ReferenceRelatedPaths)"
 
1228
            Files="@(ContentWithTargetPath);@(ManifestIconFile);@(AppConfigWithTargetPath)"
 
1229
            PublishFiles="@(PublishFile)"
 
1230
            Satellites="@(SatelliteAssemblies);@(ReferenceSatellitePaths)"
 
1231
            TargetCulture="$(TargetCulture)"
 
1232
            TargetZone="$(TargetZone)"
 
1233
            TrustInfoFile="$(IntermediateOutputPath)TrustInfo.xml"
 
1234
            >
 
1235
            <Output TaskParameter="OutputDependencies" ItemName="ManifestDependencies"/>
 
1236
            <Output TaskParameter="OutputFiles" ItemName="ManifestFiles"/>
 
1237
            <Output TaskParameter="OutputPrerequisites" ItemName="ManifestPrerequisites"/>
 
1238
            <Output TaskParameter="OutputSatellites" ItemName="ManifestSatellites"/>
 
1239
            <Output TaskParameter="OutputTrustInfoFile" PropertyName="TrustInfoFile" Condition="'$(TargetZone)'!=''"/>
 
1240
        </ResolveManifestFiles>
 
1241
        <Message Text="(out) ManifestDependencies: '@(ManifestDependencies)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1242
        <Message Text="(out) ManifestFiles: '@(ManifestFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1243
        <Message Text="(out) ManifestPrerequisites: '@(ManifestPrerequisites)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1244
        <Message Text="(out) ManifestSatellites: '@(ManifestSatellites)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1245
        <Message Text="(out) TrustInfoFile: '$(TrustInfoFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1246
 
 
1247
        <!-- Obtain manifest version from ApplicationVersion and ApplicationRevision properties -->
 
1248
        <Message Text="(in) ApplicationVersion: '$(ApplicationVersion)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1249
        <Message Text="(in) ApplicationRevision: '$(ApplicationRevision)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1250
        <FormatVersion
 
1251
            Version="$(ApplicationVersion)"
 
1252
            Revision="$(ApplicationRevision)"
 
1253
            >
 
1254
                <Output TaskParameter="OutputVersion" PropertyName="ManifestVersion"/>
 
1255
        </FormatVersion>
 
1256
        <Message Text="(out) ManifestVersion: '$(ManifestVersion)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1257
 
 
1258
        <Message Text="(in) TargetUrl: '$(TargetUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1259
        <FormatUrl
 
1260
            InputUrl="$(TargetUrl)"
 
1261
            >
 
1262
                <Output TaskParameter="OutputUrl" PropertyName="FormattedTargetUrl"/>
 
1263
        </FormatUrl>
 
1264
        <Message Text="(out) FormattedTargetUrl: '$(FormattedTargetUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1265
 
 
1266
        <Message Text="(in) SupportUrl: '$(SupportUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1267
        <FormatUrl
 
1268
            InputUrl="$(SupportUrl)"
 
1269
            >
 
1270
            <Output TaskParameter="OutputUrl" PropertyName="FormattedSupportUrl"/>
 
1271
        </FormatUrl>
 
1272
        <Message Text="(out) FormattedSupportUrl: '$(FormattedSupportUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1273
 
 
1274
    </Target>
 
1275
 
 
1276
 
 
1277
    <!--
 
1278
    Generate manifests
 
1279
 
 
1280
        [IN]
 
1281
        @(BaseManifestWithTargetPath) - The base app.manifest from project.
 
1282
        @(ResolvedIsolatedComModules) - The list of COM references to be isolated as reg-free COM dependencies for native assembly loader.
 
1283
        @(NativeReferenceFile) - The list of native assembly dependencies for native assembly loader.
 
1284
        @(ManifestFiles) - The list of loose files (content, pdb, xml, etc.) for ClickOnce.
 
1285
        @(ManifestDependencies) - The list of application dependencies (typically this is the set of assembly dependencies in bin\) for ClickOnce.
 
1286
        @(ManifestPrerequisites) - The list of application prerequisistes (typically this is the set of assembly dependencies not in bin\) for ClickOnce.
 
1287
        @(ManifestSatellites) - The list of satellite assemblies for ClickOnce.
 
1288
        @(AppConfigWithTargetPath) - App config file, if present.
 
1289
        @(ManifestIconFile) - Icon file, if present.
 
1290
 
 
1291
        [OUT]
 
1292
        @(ApplicationManifest) - Generated native or ClickOnce application manifest, i.e. WindowsApplication1.exe.manifest
 
1293
        @(DeployManifest) - Generated ClickOnce deployment manifest, i.e. WindowsApplication1.application
 
1294
    -->
 
1295
    <Target
 
1296
        Name="GenerateManifests"
 
1297
        DependsOnTargets="ComputeNativeManifestInfo;ComputeClickOnceManifestInfo">
 
1298
 
 
1299
        <Message Text="(in) ApplicationManifestIdentitity: '$(ApplicationManifestIdentitity)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1300
        <Message Text="(in) ApplicationManifest: '@(ApplicationManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1301
        <Message Text="(in) BaseManifestWithTargetPath: '@(BaseManifestWithTargetPath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1302
        <Message Text="(in) IsolatedComReferences: '@(ResolvedIsolatedComModules)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1303
        <Message Text="(in) NativeReferenceFile: '@(NativeReferenceFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1304
        <Message Text="(in) Files: '@(ManifestFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1305
        <Message Text="(in) EntryPoint: '@(ManifestEntryPoint)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1306
        <Message Text="(in) Dependencies: '@(ManifestDependencies)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1307
        <Message Text="(in) Prerequisites: '@(ManifestPrerequisites)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1308
        <Message Text="(in) Satellites: '@(ManifestSatellites)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1309
        <Message Text="(in) ManifestConfigFile: '@(AppConfigWithTargetPath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1310
        <Message Text="(in) ManifestIconFile: '@(ManifestIconFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1311
        <GenerateApplicationManifest
 
1312
            AssemblyName="$(ApplicationManifestIdentitity)"
 
1313
            AssemblyVersion="$(ManifestVersion)"
 
1314
            ConfigFile="@(AppConfigWithTargetPath)"
 
1315
            CertificateFile="$(CertificateFile)"
 
1316
            CertificatePassword="$(CertificatePassword)"
 
1317
            DelaySign="$(DelaySign)"
 
1318
            Dependencies="@(ManifestDependencies)"
 
1319
            Description="$(Description)"
 
1320
            EntryPoint="@(ManifestEntryPoint)"
 
1321
            FallbackCulture="$(FallbackCulture)"
 
1322
            Files="@(ManifestFiles)"
 
1323
            FXVersion="$(FXVersion)"
 
1324
            IconFile="@(ManifestIconFile)"
 
1325
            InputManifest="@(BaseManifestWithTargetPath)"
 
1326
            IsolatedComReferences="@(ResolvedIsolatedComModules)"
 
1327
            KeyContainer="$(ManifestKeyContainerName)"
 
1328
            KeyFile="$(ManifestKeyOriginatorFile)"
 
1329
            KeyProvider="$(KeyProviderName)"
 
1330
            NativeReferences="@(NativeReferenceFile)"
 
1331
            OutputManifest="@(ApplicationManifest)"
 
1332
            OSVersion="$(TargetOSVersion)"
 
1333
            Platform="$(PlatformTarget)"
 
1334
            Prerequisites="@(ManifestPrerequisites)"
 
1335
            Satellites="@(ManifestSatellites)"
 
1336
            TargetCulture="$(TargetCulture)"
 
1337
            TrustInfoFile="$(TrustInfoFile)"
 
1338
            />
 
1339
        <Message Text="(out) ApplicationManifest: '@(ApplicationManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1340
 
 
1341
        <Message Text="(in) DeployManifestIdentitity: '$(DeployManifestIdentitity)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1342
        <Message Text="(in) DeployManifest: '@(DeployManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1343
        <GenerateDeploymentManifest
 
1344
            Condition="'$(GenerateClickOnceManifests)'=='true'"
 
1345
            AssemblyName="$(DeployManifestIdentitity)"
 
1346
            AssemblyVersion="$(ManifestVersion)"
 
1347
            CertificateFile="$(CertificateFile)"
 
1348
            CertificatePassword="$(CertificatePassword)"
 
1349
            DelaySign="$(DelaySign)"
 
1350
            Description="$(Description)"
 
1351
            EntryPoint="@(ApplicationManifest)"
 
1352
            Install="$(Install)"
 
1353
            KeyContainer="$(ManifestKeyContainerName)"
 
1354
            KeyFile="$(ManifestKeyOriginatorFile)"
 
1355
            KeyProvider="$(KeyProviderName)"
 
1356
            OutputManifest="@(DeployManifest)"
 
1357
            Platform="$(PlatformTarget)"
 
1358
            Product="$(ProductName)"
 
1359
            Publisher="$(PublisherName)"
 
1360
            SupportUrl="$(FormattedSupportUrl)"
 
1361
            TargetCulture="$(TargetCulture)"
 
1362
            TargetUrl="$(FormattedTargetUrl)"
 
1363
            TrustLicenses="@(TrustLicenses)"
 
1364
            UpdateEnabled="$(UpdateEnabled)"
 
1365
            UpdateInterval="$(UpdateInterval)"
 
1366
            UpdateMode="$(UpdateMode)"
 
1367
            UpdatePeriodically="$(UpdatePeriodically)"
 
1368
            UpdateRequired="$(UpdateRequired)"
 
1369
            UpdateUnit="$(UpdateIntervalUnits)"
 
1370
            />
 
1371
        <Message Text="(out) DeployManifest: '@(DeployManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1372
 
 
1373
        <CreateProperty Value="true">
 
1374
            <Output TaskParameter="Value" PropertyName="CopyApplicationManifest" />
 
1375
        </CreateProperty>
 
1376
        <Message Text="(out) CopyApplicationManifest: '$(CopyApplicationManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1377
 
 
1378
    </Target>
 
1379
 
 
1380
 
 
1381
    <!--
 
1382
    Compute the paths to the intermediate satellite assemblies,
 
1383
    with culture attributes so we can copy them to the right place
 
1384
    -->
 
1385
    <Target
 
1386
        Name="ComputeIntermediateSatelliteAssemblies"
 
1387
        Condition="'@(ManifestResourceWithCulture)@(ManifestNonResxWithCultureOnDisk)'!=''"
 
1388
     >
 
1389
        <CreateItem
 
1390
              Include="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
 
1391
              AddAttributeName="Culture"
 
1392
              AddAttributeValue="%(Culture)"
 
1393
              Condition="'@(ManifestResourceWithCulture)@(ManifestNonResxWithCulture)' != ''">
 
1394
 
 
1395
              <Output TaskParameter="Include" ItemName="IntermediateSatelliteAssemblies"/>
 
1396
        </CreateItem>
 
1397
    </Target>
 
1398
 
 
1399
    <!--
 
1400
    Copy references that are marked as "CopyLocal" and their dependencies, including .pdbs, .xmls and satellites.
 
1401
    -->
 
1402
    <Target
 
1403
        Name="CopyCopyLocalFilesToOutputDirectory">
 
1404
 
 
1405
        <Copy
 
1406
            SourceFiles="@(ReferenceCopyLocalPaths)"
 
1407
            DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)\%(Filename)%(Extension)')"
 
1408
            SkipUnchangedFiles="true"
 
1409
            />
 
1410
 
 
1411
    </Target>
 
1412
 
 
1413
    <!--
 
1414
    Create a list of items that have the CopyToOutputDirectory attribute set to 'true'.
 
1415
    -->
 
1416
    <Target
 
1417
        Name="CreateCopyToOutputDirectoryItems"
 
1418
        DependsOnTargets="AssignTargetPaths"
 
1419
        >
 
1420
            <CreateItem Include="@(ContentWithTargetPath);@(EmbeddedResourceWithTargetPath);@(CompileWithTargetPath);@(NoneWithTargetPath)">
 
1421
                <Output TaskParameter="Include" ItemName="AllItemsWithTargetPath"/>
 
1422
            </CreateItem>
 
1423
                
 
1424
            <CreateItem
 
1425
                Include="@(AllItemsWithTargetPath)"
 
1426
                Condition="'%(AllItemsWithTargetPath.CopyToOutputDirectory)'=='True'"
 
1427
                >
 
1428
                
 
1429
                <Output TaskParameter="Include" ItemName="CopyToOutputDirectoryFiles"/>
 
1430
                
 
1431
            </CreateItem>
 
1432
    </Target>
 
1433
 
 
1434
    <!--
 
1435
    Copy files that have the CopyToOutputDirectory attribute set to 'true'.
 
1436
    -->
 
1437
    <Target
 
1438
        Name="CopyCopyToOutputDirectoryFiles"
 
1439
        Inputs="@(CopyToOutputDirectoryFiles)"
 
1440
        Outputs="$(OutputPath)%(TargetPath)"
 
1441
        DependsOnTargets="CreateCopyToOutputDirectoryItems"
 
1442
        >
 
1443
 
 
1444
        <Copy
 
1445
            SourceFiles = "@(CopyToOutputDirectoryFiles)"
 
1446
            DestinationFiles = "$(OutputPath)%(TargetPath)"
 
1447
            />
 
1448
 
 
1449
    </Target>
 
1450
 
 
1451
    <!--
 
1452
    Copy all build outputs, satellites and other necessary files to the final directory.
 
1453
    -->
 
1454
    <Target
 
1455
        Name="CopyFilesToOutputDirectory"
 
1456
        DependsOnTargets="ComputeIntermediateSatelliteAssemblies;CopyCopyLocalFilesToOutputDirectory;CopyCopyToOutputDirectoryFiles">
 
1457
 
 
1458
        <!-- Copy the build product (.dll or .exe). -->
 
1459
        <Copy
 
1460
            SourceFiles="@(IntermediateAssembly)"
 
1461
            DestinationFiles="$(OutDir)$(TargetFileName)"
 
1462
            SkipUnchangedFiles="true"
 
1463
            >
 
1464
 
 
1465
            <Output ItemName="MainAssembly" TaskParameter="DestinationFiles" />
 
1466
        </Copy>
 
1467
 
 
1468
        <!-- Mini-clean.  Delete the destination PDB from the last build.  If DebugInformation
 
1469
             has been turned off, then we may not end up copying a new PDB on top of it. -->
 
1470
        <Delete Files="$(OutDir)$(TargetName).pdb"/>
 
1471
        
 
1472
        <!-- Copy the debug information file (.pdb), if any -->
 
1473
        <Copy
 
1474
            SourceFiles="$(IntermediateOutputPath)$(TargetName).pdb"
 
1475
            DestinationFiles="$(OutDir)$(TargetName).pdb"
 
1476
            SkipUnchangedFiles="true"
 
1477
            Condition="Exists('$(IntermediateOutputPath)$(TargetName).pdb')"
 
1478
            />
 
1479
 
 
1480
        <!-- Copy the resulting XML documentation file, if any. -->
 
1481
        <Copy
 
1482
            SourceFiles="$(DocFile)"
 
1483
            DestinationFiles="@(FinalDocFile)"
 
1484
            SkipUnchangedFiles="true"
 
1485
            Condition="Exists('$(DocFile)')"
 
1486
        />
 
1487
 
 
1488
        <!-- Copy the application's .config file, if any. -->
 
1489
        <Copy
 
1490
            SourceFiles="@(AppConfigWithTargetPath)"
 
1491
            DestinationFiles="$(OutDir)%(TargetPath)"
 
1492
            SkipUnchangedFiles="true"
 
1493
        />
 
1494
 
 
1495
        <!-- Copy satellite assemblies. -->
 
1496
        <Copy
 
1497
            SourceFiles="@(IntermediateSatelliteAssemblies)"
 
1498
            DestinationFiles="@(IntermediateSatelliteAssemblies->'$(OutDir)%(Culture)\$(TargetName).resources.dll')"
 
1499
            SkipUnchangedFiles="true"
 
1500
            />
 
1501
 
 
1502
        <!-- Copy COM reference wrappers if any. -->
 
1503
        <Copy
 
1504
            SourceFiles="@(ReferenceComWrappersToCopyLocal)"
 
1505
            DestinationFolder="$(OutDir)"
 
1506
            SkipUnchangedFiles="true"
 
1507
            />
 
1508
 
 
1509
        <!-- Copy isolated COM references, if any. -->
 
1510
        <Copy
 
1511
            SourceFiles="@(ResolvedIsolatedComModules)"
 
1512
            DestinationFolder="$(OutDir)"
 
1513
            SkipUnchangedFiles="true"
 
1514
            />
 
1515
 
 
1516
        <!-- Copy COM references included by native (manifest) references, if any. -->
 
1517
        <Copy
 
1518
            Condition="'@(LooseManifestFile)'!=''"
 
1519
            SourceFiles="@(LooseManifestFile)"
 
1520
            DestinationFolder="$(OutDir)"
 
1521
            SkipUnchangedFiles="true"
 
1522
            />
 
1523
 
 
1524
        <!-- Copy native (manifest) reference files themselves, if any. -->
 
1525
        <Copy
 
1526
            Condition="'@(NativeReferenceFile)'!=''"
 
1527
            SourceFiles="@(NativeReferenceFile)"
 
1528
            DestinationFolder="$(OutDir)"
 
1529
            SkipUnchangedFiles="true"
 
1530
            />
 
1531
 
 
1532
        <!-- Copy the built manifests (.exe.manifest, .application) to the final directory. -->
 
1533
        <Copy
 
1534
            Condition="'$(CopyApplicationManifest)'=='true'"
 
1535
            SourceFiles="@(ApplicationManifest)"
 
1536
            DestinationFolder="$(OutDir)"
 
1537
            SkipUnchangedFiles="true"
 
1538
            />
 
1539
        <Copy
 
1540
            Condition="'$(GenerateClickOnceManifests)'=='true'"
 
1541
            SourceFiles="@(DeployManifest)"
 
1542
            DestinationFolder="$(OutDir)"
 
1543
            SkipUnchangedFiles="true"
 
1544
            />
 
1545
 
 
1546
 
 
1547
    </Target>
 
1548
 
 
1549
    <!--
 
1550
    Delete the empty source file if one was created at the start of the build.
 
1551
    -->
 
1552
    <Target
 
1553
        Name="RemoveEmptyGeneratedSource"
 
1554
        Condition="Exists('$(IntermediateOutputPath)VisualStudio.Empty$(DefaultLanguageSourceExtension)')"
 
1555
        >
 
1556
 
 
1557
        <Delete
 
1558
            Files="$(IntermediateOutputPath)VisualStudio.Empty$(DefaultLanguageSourceExtension)"/>
 
1559
 
 
1560
    </Target>
 
1561
 
 
1562
    <PropertyGroup>
 
1563
        <UnmanagedRegistrationDependsOn></UnmanagedRegistrationDependsOn>
 
1564
    </PropertyGroup>
 
1565
    <Target
 
1566
        Name="UnmanagedRegistration"
 
1567
        Condition="'$(RegisterForComInterop)_and_$(OutputType)'=='true_and_library'"
 
1568
        DependsOnTargets="$(UnmanagedRegistrationDependsOn)"
 
1569
        >
 
1570
 
 
1571
        <RegisterAssembly
 
1572
            Assemblies="@(OutputPathItem->'%(FullPath)$(TargetFileName)')"
 
1573
            TypeLibFiles="@(OutputPathItem->'%(FullPath)$(TargetName).tlb')"
 
1574
            CreateCodeBase="true"
 
1575
        />
 
1576
 
 
1577
    </Target>
 
1578
 
 
1579
    <Target
 
1580
      Name="RunFxCop"
 
1581
      Condition="'$(RunFxCop)'=='true'"
 
1582
      Inputs="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
 
1583
      Outputs="$(IntermediateOutputPath)FxCopLog.xml;$(IntermediateOutputPath)$(TargetName).FxCop"
 
1584
      DependsOnTargets="Compile"
 
1585
    >
 
1586
      <FxCop
 
1587
        ToolPath="$(FxCopDir)"
 
1588
        Assemblies="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
 
1589
        Rules="$(FxCopRules)"
 
1590
        SynthesizedProject="$(IntermediateOutputPath)$(TargetName).FxCop"
 
1591
        LogFile="$(IntermediateOutputPath)FxCopLog.xml"
 
1592
        ExclusionsFile="$(FxCopExclusionsFile)"
 
1593
      />
 
1594
    </Target>
 
1595
 
 
1596
    <!--
 
1597
    Run the post-build event if there is one.
 
1598
    -->
 
1599
    <PropertyGroup>
 
1600
        <PostBuildEventDependsOn></PostBuildEventDependsOn>
 
1601
    </PropertyGroup>
 
1602
    <Target
 
1603
        Name="PostBuildEvent"
 
1604
        Condition="'$(PostBuildEvent)'!=''"
 
1605
        DependsOnTargets="$(PostBuildEventDependsOn)"
 
1606
        >
 
1607
 
 
1608
        <Exec
 
1609
              WorkingDirectory="$(OutDir)"
 
1610
              Command="$(PostBuildEvent)" />
 
1611
 
 
1612
    </Target>
 
1613
 
 
1614
    <!--
 
1615
    Prepare the names of resource files.
 
1616
    -->
 
1617
    <PropertyGroup>
 
1618
        <PrepareResourceNamesDependsOn>
 
1619
            SplitResourcesByCulture;CreateManifestResourceNames
 
1620
        </PrepareResourceNamesDependsOn>
 
1621
    </PropertyGroup>
 
1622
    <Target
 
1623
        Name="PrepareResourceNames"
 
1624
        DependsOnTargets="$(PrepareResourceNamesDependsOn)"
 
1625
        />
 
1626
 
 
1627
    <!--
 
1628
    Prepare resources for the Compile step.
 
1629
    -->
 
1630
    <PropertyGroup>
 
1631
        <PrepareResourcesDependsOn>
 
1632
            PrepareResourceNames;CopyNonResxEmbeddedResources;ResGen;CompileLicxFiles
 
1633
        </PrepareResourcesDependsOn>
 
1634
    </PropertyGroup>
 
1635
    <Target
 
1636
        Name="PrepareResources"
 
1637
        DependsOnTargets="$(PrepareResourcesDependsOn)"
 
1638
        />
 
1639
 
 
1640
    <!--
 
1641
    Copy the build outputs to the final directory if they have changed.
 
1642
    -->
 
1643
    <PropertyGroup>
 
1644
        <PrepareForRunDependsOn>
 
1645
            RemoveEmptyGeneratedSource;
 
1646
            CopyFilesToOutputDirectory
 
1647
        </PrepareForRunDependsOn>
 
1648
    </PropertyGroup>
 
1649
    <Target
 
1650
        Name="PrepareForRun"
 
1651
        DependsOnTargets="$(PrepareForRunDependsOn)"
 
1652
        />
 
1653
 
 
1654
    <!--
 
1655
    Delete all intermediate and final build outputs.
 
1656
    -->
 
1657
    <PropertyGroup>
 
1658
        <CleanDependsOn>
 
1659
            PrepareResourceNames;
 
1660
            UnmanagedUnregistration
 
1661
        </CleanDependsOn>
 
1662
    </PropertyGroup>
 
1663
    <Target
 
1664
        Name="Clean"
 
1665
        DependsOnTargets="$(CleanDependsOn)"
 
1666
        >
 
1667
 
 
1668
        <Delete
 
1669
            Files=
 
1670
            "$(OutDir)$(TargetFileName).config;
 
1671
             $(OutDir)$(TargetFileName);
 
1672
             $(OutDir)$(TargetName).pdb;
 
1673
             @(FinalDocFile);
 
1674
             $(IntermediateOutputPath)$(TargetFileName);
 
1675
             $(IntermediateOutputPath)$(TargetName).pdb;
 
1676
             @(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)');
 
1677
             @(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)');
 
1678
             @(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources');
 
1679
             @(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources');
 
1680
             @(DocFileItem);
 
1681
             $(IntermediateOutputPath)ResolveAssemblyReference.cache;
 
1682
             $(IntermediateOutputPath)ResGen.cache;
 
1683
             $(IntermediateOutputPath)$(TargetFileName).licenses"
 
1684
             />
 
1685
 
 
1686
        <Delete
 
1687
            Files=
 
1688
            "$(OutDir)%(ManifestNonResxWithCulture.Culture)\$(TargetName).resources.dll;
 
1689
             $(IntermediateOutputPath)%(ManifestNonResxWithCulture.Culture)\$(TargetName).resources.dll"
 
1690
             />
 
1691
 
 
1692
        <Delete
 
1693
            Files=
 
1694
            "$(OutDir)%(ManifestResourceWithCultureName.Culture)\$(TargetName).resources.dll;
 
1695
             $(IntermediateOutputPath)%(ManifestResourceWithCultureName.Culture)\$(TargetName).resources.dll"
 
1696
             />
 
1697
 
 
1698
    </Target>
 
1699
 
 
1700
    <!--
 
1701
    Delete all intermediate and final build outputs.
 
1702
    -->
 
1703
    <PropertyGroup>
 
1704
        <RebuildDependsOn>
 
1705
            Clean;
 
1706
            Build
 
1707
        </RebuildDependsOn>
 
1708
    </PropertyGroup>
 
1709
    <Target
 
1710
        Name="Rebuild"
 
1711
        DependsOnTargets="$(RebuildDependsOn)"
 
1712
        />
 
1713
 
 
1714
    <!--
 
1715
    This stand-alone target returns the name of the build product (i.e. EXE, DLL)
 
1716
    that would be produced if we built this project.
 
1717
    -->
 
1718
    <Target
 
1719
        Name="MainBuiltProjectOutputGroup"
 
1720
        Outputs="$(TargetPath)"
 
1721
        />
 
1722
 
 
1723
    <!--
 
1724
    Dump the names of certain important properties.
 
1725
    -->
 
1726
    <Target
 
1727
        Name="DumpSpecialMacros"
 
1728
        Condition="'$(MSBuildTargetsVerbose)'=='true'"
 
1729
        >
 
1730
 
 
1731
        <Message Text="ConfigurationName  =$(ConfigurationName)"/>
 
1732
        <Message Text="DevEnvDir          =$(DevEnvDir)"/>
 
1733
        <Message Text="OutDir             =$(OutDir)"/>
 
1734
        <Message Text="PlatformName       =$(PlatformName)"/>
 
1735
        <Message Text="ProjectExt         =$(ProjectExt)"/>
 
1736
        <Message Text="ProjectFileName    =$(ProjectFileName)"/>
 
1737
        <Message Text="ProjectName        =$(ProjectName)"/>
 
1738
        <Message Text="SolutionDir        =$(SolutionDir)"/>
 
1739
        <Message Text="SolutionExt        =$(SolutionExt)"/>
 
1740
        <Message Text="SolutionFileName   =$(SolutionFileName)"/>
 
1741
        <Message Text="SolutionName       =$(SolutionName)"/>
 
1742
        <Message Text="SolutionPath       =$(SolutionPath)"/>
 
1743
        <Message Text="TargetExt          =$(TargetExt)"/>
 
1744
        <Message Text="TargetFileName     =$(TargetFileName)"/>
 
1745
        <Message Text="TargetName         =$(TargetName)"/>
 
1746
        <Message Text="MSBuildAllProjects =$(MSBuildAllProjects)"/>
 
1747
        <Message Text="FxCopDir            =$(FxCopDir)"/>
 
1748
 
 
1749
        <Message Text="ProjectDir"/>
 
1750
        <Message Text="$(ProjectDir)"/>
 
1751
        <Message Text="ProjectPath"/>
 
1752
        <Message Text="$(ProjectPath)"/>
 
1753
        <Message Text="TargetDir"/>
 
1754
        <Message Text="$(TargetDir)"/>
 
1755
        <Message Text="TargetPath"/>
 
1756
        <Message Text="$(TargetPath)"/>
 
1757
 
 
1758
    </Target>
 
1759
 
 
1760
    <PropertyGroup>
 
1761
        <PublishDependsOn Condition="'$(PublishDependsOn)'==''">Build</PublishDependsOn>
 
1762
    </PropertyGroup>
 
1763
    <Target
 
1764
        Name="Publish"
 
1765
        DependsOnTargets="$(PublishDependsOn)"
 
1766
        >
 
1767
 
 
1768
        <!-- Copy manifest files -->
 
1769
        <Message Text="(in) ApplicationManifest: '@(ApplicationManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1770
        <Message Text="(in) ManifestEntryPoint: '@(ManifestEntryPoint)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1771
        <Message Text="(in) ManifestDependencies: '@(ManifestDependencies)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1772
        <Message Text="(in) ManifestSatellites: '@(ManifestSatellites)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1773
        <Message Text="(in) ManifestFiles: '@(ManifestFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1774
        <Copy
 
1775
            SourceFiles="@(ManifestEntryPoint);
 
1776
                         @(ManifestDependencies);
 
1777
                         @(ManifestFiles);
 
1778
                         @(ApplicationManifest);
 
1779
                         @(ManifestSatellites)"
 
1780
            DestinationFiles="$(PublishDir)$(AssemblyName)_$(ManifestVersion)\%(TargetPath)"
 
1781
            SkipUnchangedFiles="true"
 
1782
            />
 
1783
 
 
1784
        <!-- Copy COM files -->
 
1785
        <Message Text="(in) @(ReferenceComWrappersToCopyLocal): '@(ReferenceComWrappersToCopyLocal)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1786
        <Message Text="(in) @(ResolvedIsolatedComModules): '@(ResolvedIsolatedComModules)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1787
        <Message Text="(in) @(NativeReferenceFile): '@(NativeReferenceFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1788
        <Message Text="(in) @(LooseManifestFile): '@(LooseManifestFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1789
        <Copy
 
1790
            SourceFiles="@(ReferenceComWrappersToCopyLocal);@(ResolvedIsolatedComModules);@(NativeReferenceFile);@(LooseManifestFile)"
 
1791
            DestinationFolder="$(PublishDir)$(AssemblyName)_$(ManifestVersion)"
 
1792
            SkipUnchangedFiles="true"
 
1793
            />
 
1794
 
 
1795
        <!-- Update entry point path in deploy manifest and resign -->
 
1796
        <Message Text="(in) DeployManifest: '@(DeployManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1797
        <UpdateManifest
 
1798
            ApplicationPath="$(AssemblyName)_$(ManifestVersion)\$(TargetApplicationManifestFileName)"
 
1799
            CertificateFile="$(CertificateFile)"
 
1800
            CertificatePassword="$(CertificatePassword)"
 
1801
            DelaySign="$(DelaySign)"
 
1802
            InputManifest="@(DeployManifest)"
 
1803
            KeyContainer="$(ManifestKeyContainerName)"
 
1804
            KeyFile="$(ManifestKeyOriginatorFile)"
 
1805
            KeyProvider="$(KeyProviderName)"
 
1806
            OutputManifest="$(PublishDir)$(TargetDeployManifestFileName)"
 
1807
            >
 
1808
            <Output TaskParameter="OutputManifest" ItemName="PublishedDeployManifest"/>
 
1809
        </UpdateManifest>
 
1810
        <Message Text="(out) PublishedDeployManifest: '$(PublishedDeployManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1811
 
 
1812
        <Message Text="(in) ApplicationUrl: '$(ApplicationUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1813
        <FormatUrl
 
1814
            InputUrl="$(ApplicationUrl)"
 
1815
            >
 
1816
            <Output TaskParameter="OutputUrl" PropertyName="FormattedApplicationUrl"/>
 
1817
        </FormatUrl>
 
1818
        <Message Text="(out) FormattedApplicationUrl: '$(FormattedApplicationUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1819
 
 
1820
        <Message Text="(in) ComponentsUrl: '$(ComponentsUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1821
        <FormatUrl
 
1822
            InputUrl="$(ComponentsUrl)"
 
1823
            >
 
1824
            <Output TaskParameter="OutputUrl" PropertyName="FormattedComponentsUrl"/>
 
1825
        </FormatUrl>
 
1826
        <Message Text="(out) FormattedComponentsUrl: '$(FormattedComponentsUrl)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1827
 
 
1828
        <!-- Build setup.exe bootstrapper and copy referenced packages -->
 
1829
        <Message Text="(in) BootstrapperFile: '@(BootstrapperFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
1830
        <GenerateBootstrapper
 
1831
            Condition="'$(BootstrapperEnabled)'=='true'"
 
1832
            ApplicationFile="$(TargetDeployManifestFileName)"
 
1833
            ApplicationName="$(AssemblyName)"
 
1834
            ApplicationUrl="$(FormattedApplicationUrl)"
 
1835
            BootstrapperItems="@(BootstrapperFile)"
 
1836
            ComponentsUrl="$(FormattedComponentsUrl)"
 
1837
            Culture="$(TargetCulture)"
 
1838
            FallbackCulture="$(FallbackCulture)"
 
1839
            OutputPath="$(PublishDir)"/>
 
1840
 
 
1841
    </Target>
 
1842
 
 
1843
    <!--
 
1844
    If post-built events are set to fire "OnOutputUpdated" then take before
 
1845
    and after timestamps so that we can compare them.
 
1846
    -->
 
1847
    <Target
 
1848
        Name="TimeStampBeforeCompile"
 
1849
        Condition="'$(RunPostBuildEvent)'=='OnOutputUpdated'"
 
1850
        >
 
1851
 
 
1852
        <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
 
1853
            <Output TaskParameter="Include" ItemName="IntermediateAssemblyBeforeTimeStamp"/>
 
1854
        </CreateItem>
 
1855
    </Target>
 
1856
 
 
1857
    <Target
 
1858
        Name="TimeStampAfterCompile"
 
1859
        Condition="'$(RunPostBuildEvent)'=='OnOutputUpdated'"
 
1860
        >
 
1861
 
 
1862
        <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
 
1863
            <Output TaskParameter="Include" ItemName="IntermediateAssemblyAfterTimeStamp"/>
 
1864
        </CreateItem>
 
1865
    </Target>
 
1866
 
 
1867
    <Target Name="ObjectRelationalValidator"
 
1868
        Condition=" '@(MappingSchemaFile)@(EmbeddedMappingSchemaFile)' != '' "
 
1869
        DependsOnTargets="AssignTargetPaths"
 
1870
        >
 
1871
        <Microsoft.VisualStudio.EnterpriseTools.MappingTool.CompileTime.ObjectRelationalValidator
 
1872
            ProjectReferences="@(ReferencePath)"
 
1873
            ProjectTarget="$(TargetPath)"
 
1874
            MappingSchemaFiles="@(MappingSchemaFile);@(EmbeddedMappingSchemaFile)"
 
1875
            ProjectDirectory="$(ProjectDir)"
 
1876
            />
 
1877
    </Target>
 
1878
 
 
1879
 
 
1880
    <!--
 
1881
    Run the final build output.
 
1882
    -->
 
1883
    <PropertyGroup>
 
1884
        <RunDependsOn></RunDependsOn>
 
1885
    </PropertyGroup>
 
1886
    <Target
 
1887
        Name="Run"
 
1888
        DependsOnTargets="$(RunDependsOn)"
 
1889
        >
 
1890
        <Error Text="Cannot run '$(TargetPath)' because project output type is not '.exe'" Condition="'$(TargetExt)'!='.exe'"/>
 
1891
        <Exec Command="$(TargetPath)"/>
 
1892
    </Target>
 
1893
 
 
1894
    <!--
 
1895
    The core build step calls each of the build targets.
 
1896
    -->
 
1897
    <PropertyGroup>
 
1898
        <CoreBuildDependsOn>
 
1899
            BuildOnlySettings;
 
1900
            PrepareForBuild;
 
1901
            PreBuildEvent;
 
1902
            UnmanagedUnregistration;
 
1903
            ResolveReferences;
 
1904
            PrepareResources;
 
1905
            ResolveKeySource;
 
1906
            TimeStampBeforeCompile;
 
1907
            Compile;
 
1908
            TimeStampAfterCompile;
 
1909
            CreateSatelliteAssemblies;
 
1910
            BuildManifests;
 
1911
            PrepareForRun;
 
1912
            ObjectRelationalValidator;
 
1913
            UnmanagedRegistration;
 
1914
            RunFxCop;
 
1915
            DumpSpecialMacros
 
1916
        </CoreBuildDependsOn>
 
1917
    </PropertyGroup>
 
1918
    <Target
 
1919
        Name="CoreBuild"
 
1920
        DependsOnTargets="$(CoreBuildDependsOn)"
 
1921
        >
 
1922
 
 
1923
        <OnError Condition="'$(RunPostBuildEvent)'=='Always'" ExecuteTargets="PostBuildEvent"/>
 
1924
        <OnError ExecuteTargets="PostBuildOnOutputChange"/>
 
1925
 
 
1926
     </Target>
 
1927
 
 
1928
    <!--
 
1929
    The following targets are needed to support post-build. These steps are driven by two parameters.
 
1930
 
 
1931
    (1) The $(RunPostBuildEvent) property is set by the user through VS and can be one of four values.
 
1932
 
 
1933
        - OnBuildSuccess: In this case, every step of the build must succeed for the post-build step to run.
 
1934
        - <Blank>: This is the same as OnBuildSuccess.
 
1935
        - OnOutputUpdated: In this case, the post-build step will run only if the main output assembly was
 
1936
        actually updated.
 
1937
        - Always: The post-build step is always run.
 
1938
 
 
1939
    (2) The @(IntermediateAssemblyBeforeTimeStamp) and @(IntermediateAssemblyAfterTimeStamp) values are
 
1940
        set by the TimeStampBeforeCompile and TimeStampAfterCompile targets.  If the assembly was actually
 
1941
        rebuilt during this build, then the two values will be different.
 
1942
    -->
 
1943
    <Target
 
1944
        Name="PostBuildOnSuccess"
 
1945
        Condition="'$(RunPostBuildEvent)'!='OnOutputUpdated'"
 
1946
        DependsOnTargets="PostBuildEvent"/>
 
1947
 
 
1948
    <Target
 
1949
        Name="PostBuildOnOutputChangeCheckTimestamps"
 
1950
        Condition="'@(IntermediateAssemblyBeforeTimeStamp)'!='@(IntermediateAssemblyAfterTimeStamp)'"
 
1951
        DependsOnTargets="PostBuildEvent"/>
 
1952
 
 
1953
    <Target
 
1954
        Name="PostBuildOnOutputChange"
 
1955
        Condition="'$(RunPostBuildEvent)'=='OnOutputUpdated'"
 
1956
        DependsOnTargets="PostBuildOnOutputChangeCheckTimestamps"/>
 
1957
 
 
1958
    <Target
 
1959
        Name="CoreBuildSucceeded"
 
1960
        DependsOnTargets="PostBuildOnSuccess;PostBuildOnOutputChange"/>
 
1961
 
 
1962
    <!--
 
1963
    This target is used by the UpToDateCheck target in order to compute the
 
1964
    list of satellite assemblies that will be built by this project.
 
1965
    -->
 
1966
    <Target Name="ComputeSatelliteAssemblies"
 
1967
            DependsOnTargets="PrepareResourceNames">
 
1968
 
 
1969
        <CreateItem
 
1970
              Include="$(OutDir)%(Culture)\$(TargetName).resources.dll"
 
1971
              Condition="'@(ResxWithCulture)@(NonResxWithCulture)' != ''">
 
1972
 
 
1973
              <Output TaskParameter="Include" ItemName="SatelliteAssembly"/>
 
1974
        </CreateItem>
 
1975
 
 
1976
    </Target>
 
1977
 
 
1978
    <!--
 
1979
    ResX files can contain "linked" items which are not necessairly listed
 
1980
    as items in the project.  This target, used by the UpToDateCheck target,
 
1981
    collects all such files so that we can do timestamp checking on them.
 
1982
    -->
 
1983
    <Target Name="GetLinkedFilesFromResX"
 
1984
            DependsOnTargets="PrepareResourceNames">
 
1985
 
 
1986
        <GetLinkedFilesFromResX
 
1987
              StateFile="$(IntermediateOutputPath)ResGen.cache"
 
1988
              UseSourcePath="$(UseSourcePath)"
 
1989
              Sources="@(ResxWithCulture);@(ResxWithNoCulture)"
 
1990
              Condition="'@(ResxWithCulture)@(ResxWithNoCulture)' != ''">
 
1991
 
 
1992
            <Output TaskParameter="LinkedFiles" ItemName="LinkedResXFiles" />
 
1993
 
 
1994
        </GetLinkedFilesFromResX>
 
1995
 
 
1996
    </Target>
 
1997
 
 
1998
    <!--
 
1999
    This target performs an up-to-date check on behalf of the IDE.  The target
 
2000
    performs timestamp checking of all known inputs against all known outputs.
 
2001
 
 
2002
    This target will copy referenced assemblies into the output directory if
 
2003
    they are not already there.
 
2004
    -->
 
2005
    <Target Name="UpToDateCheck"
 
2006
            Inputs="@(Compile);
 
2007
                @(EmbeddedResource);
 
2008
                @(LinkedResXFiles);
 
2009
                @(Content);
 
2010
                @(None);
 
2011
                $(MSBuildAllProjects);
 
2012
                $(MSBuildProjectFullPath).user;
 
2013
                @(ReferencePath);
 
2014
                @(ResolvedProjectReferencePaths);
 
2015
                $(ApplicationIcon);
 
2016
                $(AssemblyOriginatorKeyFile)"
 
2017
            Outputs="$(TargetPath);@(SatelliteAssembly)"
 
2018
            DependsOnTargets="BuildOnlySettings;
 
2019
                              ResolveReferences;
 
2020
                              ComputeSatelliteAssemblies;
 
2021
                              GetLinkedFilesFromResX;
 
2022
                              CopyCopyLocalFilesToOutputDirectory;
 
2023
                              AssignTargetPaths">
 
2024
 
 
2025
            <CreateProperty Value="false">
 
2026
                <Output PropertyName="UpToDate" TaskParameter="ValueSetByTask"/>
 
2027
            </CreateProperty>
 
2028
    </Target>
 
2029
 
 
2030
    <!--
 
2031
    The targets below drive output groups, which provide generic information about a
 
2032
    project's inputs (e.g., content files, compilation sources, etc.) and built outputs
 
2033
    (e.g., built EXE/DLL, PDB, XML documentation files, etc.)
 
2034
 
 
2035
    Each target may produce two kinds of items:  outputs and dependencies.  Outputs are
 
2036
    items from the current project; dependencies are items that are brought into the
 
2037
    current project as a result of referencing other projects or components.
 
2038
 
 
2039
    Output items must be named "{TargetName}Output".  Dependency items must be named
 
2040
    "{TargetName}Dependency".  For both outputs and dependencies, the Include attribute
 
2041
    specifies the location of the output/dependency; it must be a full path.  Any number
 
2042
    of additional attributes may be placed on an output/dependency item.
 
2043
    -->
 
2044
 
 
2045
    <!--
 
2046
    This target performs population of the Built project output group.
 
2047
    -->
 
2048
    <Target Name="PrepareForProjectBuiltOutputGroupPopulation">
 
2049
        <MakeDir Directories="$(IntermediateOutputPath)"/>
 
2050
    </Target>
 
2051
 
 
2052
    <ItemGroup>
 
2053
        <BuiltProjectOutputGroupMainOutput1 Include="@(IntermediateAssembly->'%(FullPath)')">
 
2054
            <IsKeyOutput>true</IsKeyOutput>
 
2055
            <InProject>false</InProject>
 
2056
        </BuiltProjectOutputGroupMainOutput1>
 
2057
    </ItemGroup>
 
2058
 
 
2059
    <Target Name="BuiltProjectOutputGroup"
 
2060
            DependsOnTargets="PrepareForProjectBuiltOutputGroupPopulation"
 
2061
            Outputs="@(BuiltProjectOutputGroupOutput->'%(FullPath)')"
 
2062
            >
 
2063
 
 
2064
        <!-- This item represents the main built output -->
 
2065
        <CreateItem Include="@(BuiltProjectOutputGroupMainOutput1)" AddAttributeName="OUTPUTLOC" AddAttributeValue="$(TargetPath)">
 
2066
            <Output ItemName="BuiltProjectOutputGroupMainOutput2" TaskParameter="Include"/>
 
2067
        </CreateItem>
 
2068
 
 
2069
        <CreateItem Include="@(BuiltProjectOutputGroupMainOutput2)" AddAttributeName="TargetPath" AddAttributeValue="$(TargetFileName)">
 
2070
            <Output ItemName="BuiltProjectOutputGroupMainOutput3" TaskParameter="Include"/>
 
2071
        </CreateItem>
 
2072
 
 
2073
        <CreateItem Include="@(BuiltProjectOutputGroupMainOutput3)" AddAttributeName="COM2REG" AddAttributeValue="true"
 
2074
              Condition="'$(RegisterForComInterop)_and_$(OutputType)'=='true_and_library'">
 
2075
            <Output ItemName="BuiltProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2076
        </CreateItem>
 
2077
 
 
2078
        <CreateItem Include="@(BuiltProjectOutputGroupMainOutput3)"
 
2079
              Condition="'$(RegisterForComInterop)_and_$(OutputType)'!='true_and_library'">
 
2080
            <Output ItemName="BuiltProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2081
        </CreateItem>
 
2082
 
 
2083
        <!-- This item represents the app.config file -->
 
2084
        <CreateItem Include="@(AppConfigWithTargetPath)" AddAttributeName="OUTPUTLOC" AddAttributeValue="$(TargetDir)%(TargetPath)">
 
2085
            <Output ItemName="BuiltProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2086
        </CreateItem>
 
2087
 
 
2088
        <!-- This item represents the native manifest, example: WindowsApplication1.exe.manifest or Native.ClassLibrary1.manifest -->
 
2089
        <CreateItem Include="@(COMReference)"
 
2090
              Condition=" '%(COMReference.Isolated)' == 'true' ">
 
2091
 
 
2092
            <Output ItemName="IsolatedComReference" TaskParameter="Include"/>
 
2093
        </CreateItem>
 
2094
 
 
2095
        <CreateItem Include="$(OutDir)$(TargetApplicationManifestFileName)"
 
2096
                    AddAttributeName="TargetPath" AddAttributeValue="$(TargetApplicationManifestFileName)"
 
2097
                    Condition="'@(NativeReference)@(IsolatedComReference)'!=''">
 
2098
            <Output ItemName="BuiltProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2099
        </CreateItem>
 
2100
 
 
2101
        <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
 
2102
        <CreateItem Include="@(BuiltProjectOutputGroupOutputIntermediate->'%(FullPath)')">
 
2103
            <Output ItemName="BuiltProjectOutputGroupOutput" TaskParameter="Include"/>
 
2104
        </CreateItem>
 
2105
 
 
2106
        <Message Text="Built Output Group Outputs:  @(BuiltProjectOutputGroupOutput)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2107
 
 
2108
    </Target>
 
2109
 
 
2110
 
 
2111
    <!--
 
2112
    This target performs population of the Debug Symbols project output group.
 
2113
    -->
 
2114
    <Target
 
2115
        Name="DebugSymbolsProjectOutputGroup"
 
2116
        Outputs="@(DebugSymbolsProjectOutputGroupOutput->'%(FullPath)')"
 
2117
        Condition="'$(DebugSymbols)'!='false'">
 
2118
 
 
2119
        <!-- This item represents the PDB built by the project -->
 
2120
 
 
2121
        <CreateItem Include="$(IntermediateOutputPath)$(TargetName).pdb" AddAttributeName="OUTPUTLOC" AddAttributeValue="@(OutputPathItem->'%(FullPath)$(TargetName).pdb')">
 
2122
            <Output ItemName="DebugSymbolsProjectOutputGroup1" TaskParameter="Include"/>
 
2123
        </CreateItem>
 
2124
 
 
2125
        <CreateItem Include="@(DebugSymbolsProjectOutputGroup1)" AddAttributeName="TargetPath" AddAttributeValue="$(TargetName).pdb">
 
2126
            <Output ItemName="DebugSymbolsProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2127
        </CreateItem>
 
2128
 
 
2129
        <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
 
2130
        <CreateItem Include="@(DebugSymbolsProjectOutputGroupOutputIntermediate->'%(FullPath)')">
 
2131
            <Output ItemName="DebugSymbolsProjectOutputGroupOutput" TaskParameter="Include"/>
 
2132
        </CreateItem>
 
2133
 
 
2134
        <Message Text="Debug Symbols Output Group Outputs:  @(DebugSymbolsProjectOutputGroupOutput)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2135
 
 
2136
    </Target>
 
2137
 
 
2138
    <!--
 
2139
        This target performs population of the Documentation project output group.
 
2140
    -->
 
2141
    <ItemGroup>
 
2142
        <DocumentationProjectOutputGroup1 Include="$(DocFile)" Condition="'$(DocumentationFile)'!=''">
 
2143
            <IsKeyOutput>true</IsKeyOutput>
 
2144
            <InProject>false</InProject>
 
2145
        </DocumentationProjectOutputGroup1>
 
2146
    </ItemGroup>
 
2147
 
 
2148
    <Target
 
2149
        Name="DocumentationProjectOutputGroup"
 
2150
        Outputs="@(DocumentationProjectOutputGroupOutput->'%(FullPath)')"
 
2151
        Condition="'$(DocumentationFile)'!=''">
 
2152
 
 
2153
        <!-- This item represents the XML file built by the project -->
 
2154
        <CreateItem Include="@(DocumentationProjectOutputGroup1)" AddAttributeName="OUTPUTLOC" AddAttributeValue="@(FinalDocFile)">
 
2155
            <Output ItemName="DocumentationProjectOutputGroup2" TaskParameter="Include"/>
 
2156
        </CreateItem>
 
2157
 
 
2158
        <CreateItem Include="@(DocumentationProjectOutputGroup2)" AddAttributeName="TargetPath" AddAttributeValue="@(DocFileItem->'%(Filename)%(Extension)')">
 
2159
            <Output ItemName="DocumentationProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2160
        </CreateItem>
 
2161
 
 
2162
        <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
 
2163
        <CreateItem Include="@(DocumentationProjectOutputGroupOutputIntermediate->'%(FullPath)')">
 
2164
            <Output ItemName="DocumentationProjectOutputGroupOutput" TaskParameter="Include"/>
 
2165
        </CreateItem>
 
2166
 
 
2167
        <Message Text="Documentation Outputs:  @(DocumentationProjectOutputGroupOutput)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2168
 
 
2169
    </Target>
 
2170
 
 
2171
    <!--
 
2172
    This target performs population of the Satellite Files project output group.
 
2173
    -->
 
2174
    <Target
 
2175
            Name="SatelliteDllsProjectOutputGroup"
 
2176
            DependsOnTargets="PrepareResourceNames"
 
2177
            Outputs="@(SatelliteDllsProjectOutputGroupOutput->'%(FullPath)')">
 
2178
 
 
2179
        <CreateItem
 
2180
              Include="$(IntermediateOutputPath)%(ResxWithCulture.Culture)\$(TargetName).resources.dll"
 
2181
              AddAttributeName="TargetPath"
 
2182
              AddAttributeValue="%(ResxWithCulture.Culture)\$(TargetName).resources.dll"
 
2183
              Condition="'@(ResxWithCulture)' != ''">
 
2184
 
 
2185
              <Output ItemName="SatelliteDllsProjectOutputGroupOutputIntermediate" TaskParameter="Include" />
 
2186
        </CreateItem>
 
2187
 
 
2188
        <CreateItem
 
2189
              Include="$(IntermediateOutputPath)%(NonResxWithCulture.Culture)\$(TargetName).resources.dll"
 
2190
              AddAttributeName="TargetPath"
 
2191
              AddAttributeValue="%(NonResxWithCulture.Culture)\$(TargetName).resources.dll"
 
2192
              Condition="'@(NonResxWithCulture)' != ''">
 
2193
 
 
2194
              <Output ItemName="SatelliteDllsProjectOutputGroupOutputIntermediate" TaskParameter="Include" />
 
2195
        </CreateItem>
 
2196
 
 
2197
        <CreateItem Include="$(IntermediateOutputPath)">
 
2198
            <Output ItemName="SatelliteDllsProjectOutputGroupRootRelativeUrlBaseIntermediate" TaskParameter="Include"/>
 
2199
        </CreateItem>
 
2200
 
 
2201
        <!-- Convert intermediate items into final items; this way we can get the full path for each item. -->
 
2202
        <CreateItem Include="@(SatelliteDllsProjectOutputGroupOutputIntermediate->'%(FullPath)')">
 
2203
            <Output ItemName="SatelliteDllsProjectOutputGroupOutput" TaskParameter="Include"/>
 
2204
        </CreateItem>
 
2205
 
 
2206
        <Message Text="SatelliteDlls Outputs:  @(SatelliteDllsProjectOutputGroupOutput)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2207
 
 
2208
    </Target>
 
2209
 
 
2210
    <!--
 
2211
    This target performs population of the Content Files project output group.
 
2212
    Content files are items in the project whose type is "Content".
 
2213
    -->
 
2214
    <Target
 
2215
        Name="ContentFilesProjectOutputGroup"
 
2216
        Outputs="@(ContentFilesProjectOutputGroupOutput->'%(FullPath)')"
 
2217
        DependsOnTargets="AssignTargetPaths">
 
2218
 
 
2219
        <!-- Convert items into final items; this way we can get the full path for each item. -->
 
2220
        <CreateItem Include="@(ContentWithTargetPath->'%(FullPath)')">
 
2221
            <Output ItemName="ContentFilesProjectOutputGroupOutput" TaskParameter="Include"/>
 
2222
        </CreateItem>
 
2223
 
 
2224
        <Message Text="Content Files Outputs:  @(ContentFilesProjectOutputGroupOutput)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2225
 
 
2226
    </Target>
 
2227
 
 
2228
    <!--
 
2229
    This target performs population of the Source Files project output group.
 
2230
    Source files are items in the project whose type is "Compile" and "EmbeddedResource".
 
2231
 
 
2232
    Note:  the source files output group also includes the project file as well
 
2233
    as the Application Config File - but only provided that the application configuration
 
2234
    file's type is "None".
 
2235
    -->
 
2236
    <Target
 
2237
        Name="SourceFilesProjectOutputGroup"
 
2238
        Outputs="@(SourceFilesProjectOutputGroupOutput->'%(FullPath)')">
 
2239
 
 
2240
        <!-- First we deal with Compile, EmbeddedResource and AppConfig -->
 
2241
        <CreateItem Include="@(CompileWithTargetPath);@(EmbeddedResourceWithTargetPath);@(AppConfigWithTargetPath)">
 
2242
            <Output ItemName="SourceFilesProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2243
        </CreateItem>
 
2244
 
 
2245
        <!-- Include the project file -->
 
2246
        <CreateItem Include="$(ProjectPath)" AddAttributeName="TargetPath" AddAttributeValue="$(ProjectFileName)">
 
2247
            <Output ItemName="SourceFilesProjectOutputGroupOutputIntermediate" TaskParameter="Include"/>
 
2248
        </CreateItem>
 
2249
 
 
2250
        <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
 
2251
        <CreateItem Include="@(SourceFilesProjectOutputGroupOutputIntermediate->'%(FullPath)')">
 
2252
            <Output ItemName="SourceFilesProjectOutputGroupOutput" TaskParameter="Include"/>
 
2253
        </CreateItem>
 
2254
 
 
2255
        <Message Text="Source Files Outputs:  @(SourceFilesProjectOutputGroupOutput)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2256
 
 
2257
    </Target>
 
2258
 
 
2259
    <Target Name="AllProjectOutputGroups"
 
2260
            DependsOnTargets="BuiltProjectOutputGroup;DebugSymbolsProjectOutputGroup;
 
2261
                              DocumentationProjectOutputGroup;SatelliteDllsProjectOutputGroup;
 
2262
                              SourceFilesProjectOutputGroup;ContentFilesProjectOutputGroup"/>
 
2263
 
 
2264
    <!--
 
2265
        This target performs population of the Built project output group dependencies.
 
2266
    -->
 
2267
    <Target Name="BuiltProjectOutputGroupDependencies"
 
2268
            DependsOnTargets="ResolveReferences"
 
2269
            Outputs="@(BuiltProjectOutputGroupDependency->'%(FullPath)')"
 
2270
            >
 
2271
 
 
2272
        <!-- This item represents dependencies (resolved references) -->
 
2273
 
 
2274
        <CreateItem Include="@(ReferencePath->'%(FullPath)');@(ReferenceDependencyPaths->'%(FullPath)')">
 
2275
            <Output ItemName="BuiltProjectOutputGroupDependency" TaskParameter="Include"/>
 
2276
        </CreateItem>
 
2277
 
 
2278
        <CreateItem Include="@(NativeReferenceFile->'%(FullPath)')">
 
2279
            <Output ItemName="BuiltProjectOutputGroupDependency" TaskParameter="Include"/>
 
2280
        </CreateItem>
 
2281
 
 
2282
        <CreateItem Include="@(LooseManifestFile->'%(FullPath)')">
 
2283
            <Output ItemName="BuiltProjectOutputGroupDependency" TaskParameter="Include"/>
 
2284
        </CreateItem>
 
2285
 
 
2286
        <CreateItem Include="@(ResolvedIsolatedComModules->'%(FullPath)')">
 
2287
            <Output ItemName="BuiltProjectOutputGroupDependency" TaskParameter="Include"/>
 
2288
        </CreateItem>
 
2289
 
 
2290
        <Message Text="Built Output Group Dependencies:  @(BuiltProjectOutputGroupDependency)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2291
 
 
2292
    </Target>
 
2293
 
 
2294
    <!--
 
2295
    This target performs population of the dependencies for the debug symbols project output group.
 
2296
    -->
 
2297
    <Target
 
2298
        Name="DebugSymbolsProjectOutputGroupDependencies"
 
2299
        DependsOnTargets="ResolveReferences"
 
2300
        Outputs="@(DebugSymbolsProjectOutputGroupDependency->'%(FullPath)')"
 
2301
        Condition="'$(DebugSymbols)'!='false'">
 
2302
 
 
2303
        <!-- This item represents dependent PDB's -->
 
2304
 
 
2305
        <CreateItem Include="@(ReferenceRelatedPaths)" Condition="'%(Extension)' == '.pdb'">
 
2306
            <Output ItemName="DebugSymbolsProjectOutputGroupDependencyIntermediate" TaskParameter="Include"/>
 
2307
        </CreateItem>
 
2308
 
 
2309
 
 
2310
        <CreateItem Include="@(DebugSymbolsProjectOutputGroupDependencyIntermediate->'%(FullPath)')">
 
2311
            <Output ItemName="DebugSymbolsProjectOutputGroupDependency" TaskParameter="Include"/>
 
2312
        </CreateItem>
 
2313
 
 
2314
        <Message Text="Debug Symbols Output Group Dependencies:  @(DebugSymbolsProjectOutputGroupDependency)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2315
    </Target>
 
2316
 
 
2317
 
 
2318
    <!--
 
2319
    This target performs population of the dependencies for the satellite files project output group.
 
2320
    -->
 
2321
    <Target
 
2322
            Name="SatelliteDllsProjectOutputGroupDependencies"
 
2323
            DependsOnTargets="ResolveReferences"
 
2324
            Outputs="@(SatelliteDllsProjectOutputGroupDependency->'%(FullPath)')">
 
2325
 
 
2326
        <!-- This item represents dependent satellites -->
 
2327
 
 
2328
        <CreateItem Include="@(ReferenceSatellitePaths->'%(FullPath)')">
 
2329
            <Output ItemName="SatelliteDllsProjectOutputGroupDependency" TaskParameter="Include"/>
 
2330
        </CreateItem>
 
2331
 
 
2332
        <Message Text="SatelliteDlls Dependencies:  @(SatelliteDllsProjectOutputGroupDependency)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2333
    </Target>
 
2334
 
 
2335
    <!--
 
2336
        This target performs population of the dependencies for the documentation project output group.
 
2337
    -->
 
2338
    <Target
 
2339
        Name="DocumentationProjectOutputGroupDependencies"
 
2340
        DependsOnTargets="ResolveReferences"
 
2341
        Outputs="@(DocumentationProjectOutputGroupDependency->'%(FullPath)')"
 
2342
        Condition="'$(DocumentationFile)'!=''">
 
2343
 
 
2344
        <!-- This item represents dependent XML's -->
 
2345
 
 
2346
        <CreateItem Include="@(ReferenceRelatedPaths)" Condition="'%(Extension)' == '.xml'">
 
2347
            <Output ItemName="DocumentationProjectOutputGroupDependencyIntermediate" TaskParameter="Include"/>
 
2348
        </CreateItem>
 
2349
 
 
2350
        <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
 
2351
 
 
2352
        <CreateItem Include="@(DocumentationProjectOutputGroupDependencyIntermediate->'%(FullPath)')">
 
2353
            <Output ItemName="DocumentationProjectOutputGroupDependency" TaskParameter="Include"/>
 
2354
        </CreateItem>
 
2355
 
 
2356
        <Message Text="Documentation Dependencies:  @(DocumentationProjectOutputGroupDependency)" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
2357
 
 
2358
    </Target>
 
2359
 
 
2360
    <Target Name="AllProjectOutputGroupsDependencies"
 
2361
            DependsOnTargets="BuildOnlySettings;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroupDependencies;
 
2362
                              SatelliteDllsProjectOutputGroupDependencies;DocumentationProjectOutputGroupDependencies"/>
 
2363
</Project>