Debian Codegraph @

mcs/tools/xbuild/data/14.0/Microsoft.Common.targets

raw
1 <Project DefaultTargets="Build" InitialTargets="_CheckForInvalidConfigurationAndPlatform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="'$(MicrosoftCommonPropsHasBeenImported)' != 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
3
4 <PropertyGroup>
5 <ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
6 <ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
7 </PropertyGroup>
8
9 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore\*"
10 Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore')"/>
11
12 <Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/>
13
14 <PropertyGroup>
15 <OutputType Condition="'$(OutputType)' == ''">Exe</OutputType>
16 <TargetExt Condition="'$(OutputType)' == 'Winexe'">.exe</TargetExt>
17 <TargetExt Condition="'$(OutputType)' == 'Exe'">.exe</TargetExt>
18 <TargetExt Condition="'$(OutputType)' == 'Library'">.dll</TargetExt>
19 <TargetExt Condition="'$(OutputType)' == 'Netmodule'">.netmodule</TargetExt>
20 </PropertyGroup>
21
22 <PropertyGroup>
23 <ProjectDir Condition="'$(ProjectDir)' == ''">$(MSBuildProjectDirectory)\</ProjectDir>
24 </PropertyGroup>
25
26 <!-- MSBuild defines this even outside of VS, and F# projects depend on it -->
27 <PropertyGroup>
28 <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
29 </PropertyGroup>
30
31 <PropertyGroup>
32 <AssemblyName Condition="'$(AssemblyName)' == ''">$(MSBuildProjectName)</AssemblyName>
33 <OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
34 <OutputPath Condition=" '$(Platform)'=='' and '$(Configuration)'=='' and '$(OutputPath)'=='' ">bin\Debug\</OutputPath>
35
36 <TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
37 <TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
38
39 <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$(TargetFrameworkProfile)' != ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
40 <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
41 </PropertyGroup>
42
43 <PropertyGroup>
44 <OutDir Condition="'$(OutDir)' == ''">$(OutputPath)</OutDir>
45 <OutDir Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')">$(OutDir)\</OutDir>
46
47 <_OriginalConfiguration>$(Configuration)</_OriginalConfiguration>
48 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
49 <ConfigurationName Condition="'$(ConfigurationName)' == ''">$(Configuration)</ConfigurationName>
50
51 <_OriginalPlatform>$(Platform)</_OriginalPlatform>
52 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
53 <PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
54 </PropertyGroup>
55
56 <!-- in MSBuild, these properties are set in a separate file that is only imported for .NETFramework -->
57 <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
58 <AddAdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == ''">true</AddAdditionalExplicitAssemblyReferences>
59 <AdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == 'true' and '$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0'">System.Core;$(AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
60 </PropertyGroup>
61
62 <PropertyGroup>
63 <SkipCopyUnchangedFiles Condition="'$(SkipCopyUnchangedFiles)' == ''">true</SkipCopyUnchangedFiles>
64 </PropertyGroup>
65
66 <PropertyGroup>
67 <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">obj\</BaseIntermediateOutputPath>
68 <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')">$(BaseIntermediateOutputPath)\</BaseIntermediateOutputPath>
69 <CleanFile Condition="'$(CleanFile)'==''">$(MSBuildProjectFile).FilesWrittenAbsolute.txt</CleanFile>
70 </PropertyGroup>
71
72 <PropertyGroup Condition="'$(IntermediateOutputPath)' == ''">
73 <IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
74 <IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
75 </PropertyGroup>
76
77 <PropertyGroup>
78 <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath>
79 </PropertyGroup>
80
81 <ItemGroup>
82 <IntermediateAssembly Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)" />
83
84 <!-- creating this as a item to use FullPath on it, to build TargetPath -->
85 <_OutDirItem Include="$(OutDir)"/>
86 </ItemGroup>
87
88 <PropertyGroup>
89 <TargetName Condition="'$(TargetName)' == '' ">$(AssemblyName)</TargetName>
90 <TargetFileName Condition="'$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName>
91 <TargetDir Condition=" '$(TargetDir)' == '' ">@(_OutDirItem->'%(FullPath)')</TargetDir>
92 <TargetPath Condition=" '$(TargetPath)' == '' ">@(_OutDirItem->'%(FullPath)\$(TargetFileName)')</TargetPath>
93 <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildProjectFullPath);$(MSBuildToolsPath)\Microsoft.Common.targets</MSBuildAllProjects>
94 <KeyOriginatorFile Condition=" '$(SignAssembly)' == 'true' ">$(AssemblyOriginatorKeyFile)</KeyOriginatorFile>
95 <TargetingClr2Framework Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5')">true</TargetingClr2Framework>
96 </PropertyGroup>
97
98 <Target Name="_CheckForInvalidConfigurationAndPlatform">
99 <Error Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' != 'true'"
100 Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
101
102 <Warning Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' == 'true'"
103 Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
104
105 <!-- If OutDir is specified via the command line, then the earlier check
106 to add a trailing slash won't have any affect, so error here. -->
107 <Error
108 Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')"
109 Text="OutDir property must end with a slash."/>
110 </Target>
111
112 <PropertyGroup>
113 <PrepareForBuildDependsOn>AssignLinkMetadata</PrepareForBuildDependsOn>
114 </PropertyGroup>
115 <Target Name="PrepareForBuild" DependsOnTargets="$(PrepareForBuildDependsOn)">
116 <Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/>
117
118 <!-- Look for app.config, if $(AppConfig) is specified, then use that. Else look in
119 @(None) and @(Content) -->
120 <CreateItem Include="$(AppConfig)" Condition="'$(AppConfig)' != ''"
121 AdditionalMetadata="TargetPath=$(TargetFileName).config">
122 <Output TaskParameter="Include" ItemName="AppConfigWithTargetPath" />
123 </CreateItem>
124
125 <FindAppConfigFile PrimaryList="@(None)" SecondaryList="@(Content)" TargetPath="$(TargetFileName).config"
126 Condition="'$(AppConfig)' == ''">
127 <Output TaskParameter="AppConfigFile" ItemName="AppConfigWithTargetPath"/>
128 </FindAppConfigFile>
129
130 <MakeDir
131 Directories="$(OutDir);$(IntermediateOutputPath);@(DocFileItem->'%(RelativeDir)')"
132 />
133 </Target>
134
135 <Target Name="AssignLinkMetadata">
136 <AssignLinkMetadata Items="@(EmbeddedResource)" Condition="'@(EmbeddedResource)' != '' and '%(EmbeddedResource.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
137 <Output TaskParameter="OutputItems" ItemName="_EmbeddedResourceWithLinkAssigned" />
138 </AssignLinkMetadata>
139
140 <ItemGroup>
141 <EmbeddedResource Remove="@(_EmbeddedResourceWithLinkAssigned)" />
142 <EmbeddedResource Include="@(_EmbeddedResourceWithLinkAssigned)" />
143 <_EmbeddedResourceWithLinkAssigned Remove="@(_EmbeddedResourceWithLinkAssigned)" />
144 </ItemGroup>
145 </Target>
146
147 <PropertyGroup>
148 <GetFrameworkPathsDependsOn />
149 </PropertyGroup>
150 <Target Name="GetFrameworkPaths"
151 Condition="'$(TargetFrameworkIdentifier)' == '' or '$(TargetFrameworkIdentifier)' == '.NETFramework'"
152 DependsOnTargets="$(GetFrameworkPathsDependsOn)">
153 <GetFrameworkPath>
154 <Output Condition="'$(TargetFrameworkVersion)' == 'v4.5' or '$(TargetFrameworkVersion)' == 'v4.5.1' or '$(TargetFrameworkVersion)' == 'v4.5.2' or '$(TargetFrameworkVersion)' == 'v4.6' or '$(TargetFrameworkVersion)' == 'v4.6.1' or '$(TargetFrameworkVersion)' == 'v4.6.2'"
155 TaskParameter="FrameworkVersion45Path"
156 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
157 <Output Condition="'$(TargetFrameworkVersion)' == 'v4.0'"
158 TaskParameter="FrameworkVersion40Path"
159 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
160 <Output Condition="'$(TargetFrameworkVersion)' == 'v3.5'"
161 TaskParameter="FrameworkVersion35Path"
162 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
163 <Output Condition="'$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'"
164 TaskParameter="FrameworkVersion30Path"
165 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
166 <Output Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'"
167 TaskParameter="FrameworkVersion20Path"
168 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
169 </GetFrameworkPath>
170 <CreateProperty Value="@(_CombinedTargetFrameworkDirectoriesItem)">
171 <Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/>
172 </CreateProperty>
173
174 <Warning Text="TargetFrameworkVersion '$(TargetFrameworkVersion)' not supported by this toolset (ToolsVersion: $(MSBuildToolsVersion))."
175 Condition="'$(TargetFrameworkVersion)' != 'v4.6.2' and '$(TargetFrameworkVersion)' != 'v4.6.1' and '$(TargetFrameworkVersion)' != 'v4.6' and '$(TargetFrameworkVersion)' != 'v4.5.2' and '$(TargetFrameworkVersion)' != 'v4.5.1' and '$(TargetFrameworkVersion)' != 'v4.5' and '$(TargetFrameworkVersion)' != 'v4.0' and '$(TargetFrameworkVersion)' != 'v3.5' and '$(TargetFrameworkVersion)' != 'v3.0' and '$(TargetFrameworkVersion)' != 'v2.0'"/>
176 </Target>
177
178 <PropertyGroup>
179 <GetReferenceAssemblyPathsDependsOn />
180 </PropertyGroup>
181 <Target Name="GetReferenceAssemblyPaths" DependsOnTargets="$(GetReferenceAssemblyPathsDependsOn)">
182 <!-- in case of .NETFramework, $(TargetFrameworkDirectory) would have been set by
183 GetFrameworkPaths, if it hasn't been changed, then clear it, to avoid duplicates -->
184 <CreateProperty Value="" Condition="'@(_CombinedTargetFrameworkDirectoriesItem)' == '$(TargetFrameworkDirectory)'">
185 <Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/>
186 </CreateProperty>
187
188 <GetReferenceAssemblyPaths
189 Condition="'$(TargetFrameworkMoniker)' != '' and '$(_TargetFrameworkDirectories)' == ''"
190 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
191 RootPath="$(TargetFrameworkRootPath)">
192
193 <Output TaskParameter="ReferenceAssemblyPaths" PropertyName="_TargetFrameworkDirectories"/>
194 <Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="_FullFrameworkReferenceAssemblyPaths"/>
195 <Output TaskParameter="TargetFrameworkMonikerDisplayName" PropertyName="TargetFrameworkMonikerDisplayName"/>
196 </GetReferenceAssemblyPaths>
197
198
199 <!-- Remove duplicates. -->
200 <ItemGroup>
201 <_TargetFrameworkDirectories Include="$(_TargetFrameworkDirectories);$(TargetFrameworkDirectory)" KeepDuplicates="false" />
202 </ItemGroup>
203 <PropertyGroup>
204 <TargetFrameworkDirectory>@(_TargetFrameworkDirectories)</TargetFrameworkDirectory>
205 </PropertyGroup>
206
207 <ItemGroup Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'">
208 <DesignTimeFacadeDirectoryRoots Include="$(TargetFrameworkDirectory)" />
209 <DesignTimeFacadeDirectories Include="%(DesignTimeFacadeDirectoryRoots.Identity)\Facades\" Condition="Exists('%(DesignTimeFacadeDirectoryRoots.Identity)\Facades\')" />
210 <_DesignTimeFacadeAssemblies Include="%(DesignTimeFacadeDirectories.Identity)\*.dll"/>
211 </ItemGroup>
212
213 <PropertyGroup Condition="'@(DesignTimeFacadeDirectories)' != ''">
214 <TargetFrameworkDirectory>$(TargetFrameworkDirectory);@(DesignTimeFacadeDirectories)</TargetFrameworkDirectory>
215 </PropertyGroup>
216
217 </Target>
218
219 <PropertyGroup>
220 <AllowedReferenceAssemblyFileExtensions Condition=" '$(AllowedReferenceAssemblyFileExtensions)' == '' ">
221 .exe;
222 .dll
223 </AllowedReferenceAssemblyFileExtensions>
224
225 <AllowedReferenceRelatedFileExtensions Condition=" '$(AllowedReferenceRelatedFileExtensions)' == '' ">
226 .exe.mdb;
227 .dll.mdb;
228 .pdb;
229 .xml
230 </AllowedReferenceRelatedFileExtensions>
231
232 <AssemblySearchPaths Condition="'$(AssemblySearchPaths)' == ''">
233 {CandidateAssemblyFiles};
234 $(ReferencePath);
235 @(AdditionalReferencePath);
236 {HintPathFromItem};
237 {TargetFrameworkDirectory};
238 {PkgConfig};
239 {GAC};
240 {RawFileName};
241 $(OutDir)
242 </AssemblySearchPaths>
243
244 <ResolveReferencesDependsOn>
245 BeforeResolveReferences;
246 ResolveProjectReferences;
247 ResolveAssemblyReferences;
248 AfterResolveReferences
249 </ResolveReferencesDependsOn>
250
251 <ResolveAssemblyReferencesDependsOn>
252 GetFrameworkPaths;
253 GetReferenceAssemblyPaths;
254 PrepareForBuild
255 </ResolveAssemblyReferencesDependsOn>
256 </PropertyGroup>
257
258 <PropertyGroup Condition="'$(TargetFrameworkMoniker)' != ''">
259 <TargetFrameworkMonikerAssemblyAttributesPath Condition="'$(TargetFrameworkMonikerAssemblyAttributesPath)' == ''">$(IntermediateOutputPath)$(TargetFrameworkMoniker).AssemblyAttribute$(DefaultLanguageSourceExtension)</TargetFrameworkMonikerAssemblyAttributesPath>
260 <GenerateTargetFrameworkAttribute Condition="'$(GenerateTargetFrameworkAttribute)' == '' and '$(TargetFrameworkMoniker)'
261 != '' and '$(TargetingClr2Framework)' != 'true'">true</GenerateTargetFrameworkAttribute>
262 </PropertyGroup>
263
264 <ItemGroup Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
265 <FileWrites Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
266 </ItemGroup>
267
268 <Target Name="_GenerateTargetFrameworkMonikerAttribute"
269 DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
270 Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
271 Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)">
272
273 <WriteLinesToFile
274 File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
275 Lines="$(TargetFrameworkMonikerAssemblyAttributeText)"
276 Overwrite="true"
277 ContinueOnError="true"
278 Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"
279 />
280 </Target>
281
282 <Target Name="GenerateTargetFrameworkMonikerAttribute"
283 DependsOnTargets="_GenerateTargetFrameworkMonikerAttribute"
284 Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
285
286 <ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
287 <Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
288 </ItemGroup>
289 </Target>
290
291 <Target Name="ResolveReferences" DependsOnTargets="$(ResolveReferencesDependsOn)"/>
292
293 <Target Name="BeforeResolveReferences" />
294 <Target Name="AfterResolveReferences" />
295
296 <Target Name="ResolveAssemblyReferences" DependsOnTargets="$(ResolveAssemblyReferencesDependsOn)">
297 <CreateItem Include="@(Reference)" Exclude="$(AdditionalExplicitAssemblyReferences)">
298 <Output TaskParameter="Include" ItemName="_Reference"/>
299 </CreateItem>
300
301 <CreateItem Include="$(AdditionalExplicitAssemblyReferences)">
302 <Output TaskParameter="Include" ItemName="_Reference"/>
303 </CreateItem>
304
305 <ResolveAssemblyReference
306 Assemblies="@(_Reference)"
307 AssemblyFiles="@(ChildProjectReferences);@(_ExplicitReference)"
308 SearchPaths="$(AssemblySearchPaths)"
309 CandidateAssemblyFiles="@(Content);@(None)"
310 TargetFrameworkDirectories="$(TargetFrameworkDirectory)"
311 AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
312 AllowedRelatedFileExtensions="$(AllowedReferenceRelatedFileExtensions)"
313 FindDependencies="true"
314 FindSatellites="true"
315 FindRelatedFiles="true"
316 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
317 TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)"
318 TargetFrameworkVersion="$(TargetFrameworkVersion)"
319 >
320 <Output TaskParameter="ResolvedFiles" ItemName="ResolvedFiles"/>
321 <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
322 <Output TaskParameter="ResolvedDependencyFiles" ItemName="ReferenceDependencyPaths"/>
323 <Output TaskParameter="RelatedFiles" ItemName="_ReferenceRelatedPaths"/>
324 <Output TaskParameter="SatelliteFiles" ItemName="ReferenceSatellitePaths"/>
325 <Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/>
326 <Output TaskParameter="DependsOnSystemRuntime" PropertyName="DependsOnSystemRuntime"/>
327
328 <!-- FIXME: backwards compatibility -->
329 <Output TaskParameter="ResolvedDependencyFiles" ItemName="_ResolvedDependencyFiles"/>
330 </ResolveAssemblyReference>
331 </Target>
332
333 <Target
334 Name="AssignProjectConfiguration"
335 Condition="'@(ProjectReference)' != ''">
336
337 <!-- assign configs if building a solution file -->
338 <AssignProjectConfiguration
339 ProjectReferences = "@(ProjectReference)"
340 SolutionConfigurationContents = "$(CurrentSolutionConfigurationContents)"
341 Condition="$(CurrentSolutionConfigurationContents) != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')">
342
343 <Output TaskParameter = "AssignedProjects" ItemName = "ProjectReferenceWithConfiguration"/>
344 </AssignProjectConfiguration>
345
346 <!-- Else, just -->
347 <CreateItem Include="@(ProjectReference)" Condition="$(CurrentSolutionConfigurationContents) == '' or ('$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true')">
348 <Output TaskParameter="Include" ItemName="ProjectReferenceWithConfiguration"/>
349 </CreateItem>
350
351 </Target>
352
353 <!-- Split projects into 2 lists
354 ProjectReferenceWithConfigurationExistent: Projects existent on disk
355 ProjectReferenceWithConfigurationNonExistent: Projects non-existent on disk -->
356
357 <Target Name="SplitProjectReferencesByExistent"
358 DependsOnTargets="AssignProjectConfiguration">
359
360 <CreateItem Include="@(ProjectReferenceWithConfiguration)" Condition="'@(ProjectReferenceWithConfiguration)' != ''">
361 <Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationExistent"
362 Condition="Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/>
363
364 <Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationNonExistent"
365 Condition="!Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/>
366 </CreateItem>
367 </Target>
368
369 <Target
370 Name="ResolveProjectReferences"
371 DependsOnTargets="SplitProjectReferencesByExistent"
372 >
373 <!-- If building from a .sln.proj or from IDE, then referenced projects have already
374 been built, so just get the target paths -->
375 <MSBuild
376 Projects="@(ProjectReferenceWithConfigurationExistent)"
377 Targets="GetTargetPath"
378 Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)"
379 Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')">
380
381 <Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" Condition="'%(ProjectReferenceWithConfigurationExistent.ReferenceOutputAssembly)' != 'false'"/>
382 </MSBuild>
383
384 <!-- Building a project directly, build the referenced the projects also -->
385 <MSBuild
386 Projects="@(ProjectReferenceWithConfigurationExistent)"
387 Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)"
388 Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' ">
389
390 <Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" Condition="'%(ProjectReferenceWithConfigurationExistent.ReferenceOutputAssembly)' != 'false'"/>
391 </MSBuild>
392
393 <Warning Text="Referenced Project %(ProjectReferenceWithConfigurationNonExistent.Identity) not found, ignoring."
394 Condition="'@(ProjectReferenceWithConfigurationNonExistent)' != ''"/>
395 </Target>
396
397 <Target Name = "CopyFilesMarkedCopyLocal">
398 <Copy
399 SourceFiles="@(ReferenceCopyLocalPaths)"
400 DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')"
401 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
402 <Output TaskParameter = "DestinationFiles" ItemName = "FileWritesShareable"/>
403 </Copy>
404 </Target>
405
406 <Target Name="_ComputeNonExistentFileProperty" Condition='false'>
407 <CreateProperty Value="__NonExistentSubDir__\__NonExistentFile__">
408 <Output TaskParameter="Value" PropertyName="NonExistentFile"/>
409 </CreateProperty>
410 </Target>
411
412 <PropertyGroup>
413 <BuildDependsOn>
414 BuildOnlySettings;
415 BeforeBuild;
416 CoreBuild;
417 AfterBuild
418 </BuildDependsOn>
419 </PropertyGroup>
420
421 <Target Name="BuildOnlySettings"/>
422 <Target Name="BeforeBuild"/>
423 <Target Name="AfterBuild"/>
424
425 <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)"/>
426
427 <PropertyGroup>
428 <CoreBuildDependsOn>
429 PrepareForBuild;
430 GetFrameworkPaths;
431 GetReferenceAssemblyPaths;
432 PreBuildEvent;
433 ResolveReferences;
434 CopyFilesMarkedCopyLocal;
435 PrepareResources;
436 Compile;
437 PrepareForRun;
438 DeployOutputFiles;
439 _RecordCleanFile;
440 PostBuildEvent
441 </CoreBuildDependsOn>
442 </PropertyGroup>
443
444 <Target
445 Name="CoreBuild"
446 DependsOnTargets="$(CoreBuildDependsOn)"
447 Outputs="$(OutDir)$(AssemblyName)$(TargetExt)">
448
449 <OnError ExecuteTargets="_TimestampAfterCompile;PostBuildEvent"
450 Condition=" '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated'"/>
451
452 <OnError ExecuteTargets="_RecordCleanFile" />
453 </Target>
454
455 <PropertyGroup>
456 <CompileDependsOn>
457 ResolveReferences;
458 GenerateTargetFrameworkMonikerAttribute;
459 BeforeCompile;
460 _TimestampBeforeCompile;
461 CoreCompile;
462 _TimestampAfterCompile;
463 AfterCompile
464 </CompileDependsOn>
465 </PropertyGroup>
466
467 <Target Name="BeforeCompile" />
468 <Target Name="AfterCompile" />
469
470 <Target Name="Compile" DependsOnTargets="$(CompileDependsOn)"/>
471
472 <PropertyGroup>
473 <PrepareForRunDependsOn>
474 DeployOutputFiles
475 </PrepareForRunDependsOn>
476 </PropertyGroup>
477 <Target Name="PrepareForRun" DependsOnTargets="$(PrepareForRunDependsOn)"/>
478
479 <PropertyGroup>
480 <PrepareResourcesDependsOn>
481 AssignTargetPaths;
482 SplitResourcesByCulture;
483 CreateManifestResourceNames;
484 CopyNonResxEmbeddedResources;
485 GenerateResources;
486 GenerateSatelliteAssemblies;
487 CompileLicxFiles
488 </PrepareResourcesDependsOn>
489 </PropertyGroup>
490 <Target Name="PrepareResources" DependsOnTargets="$(PrepareResourcesDependsOn)" />
491
492 <Target Name="SplitResourcesByCulture" DependsOnTargets="AssignTargetPaths">
493 <!-- Extract .licx files into @(LicxFiles) -->
494 <CreateItem Include="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' == '.licx'">
495 <Output TaskParameter="Include" ItemName="LicxFiles"/>
496 </CreateItem>
497
498 <!-- Split *remaining* resource files into various groups.. -->
499 <AssignCulture Files="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' != '.licx'">
500 <Output TaskParameter="AssignedFilesWithNoCulture" ItemName="ResourcesWithNoCulture"/>
501 <Output TaskParameter="AssignedFilesWithCulture" ItemName="ResourcesWithCulture"/>
502 </AssignCulture>
503
504 <CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' == '.resx'">
505 <Output TaskParameter="Include" ItemName="ResxWithNoCulture"/>
506 </CreateItem>
507
508 <CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' != '.resx'">
509 <Output TaskParameter="Include" ItemName="NonResxWithNoCulture"/>
510 </CreateItem>
511
512 <CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' == '.resx'">
513 <Output TaskParameter="Include" ItemName="ResxWithCulture"/>
514 </CreateItem>
515
516 <CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' != '.resx'">
517 <Output TaskParameter="Include" ItemName="NonResxWithCulture"/>
518 </CreateItem>
519 </Target>
520
521 <!-- Copy non-resx resources to their manifest resource names, this is what the compiler expects -->
522 <Target Name = "CopyNonResxEmbeddedResources"
523 Condition = "'@(NonResxWithCulture)' != '' or '@(NonResxWithNoCulture)' != '' or '@(ManifestNonResxWithCulture)' != '' or '@(ManifestNonResxWithNoCulture)' != ''">
524
525 <MakeDir Directories="$(IntermediateOutputPath)%(ManifestNonResxWithCulture.Culture)"/>
526 <Copy SourceFiles = "@(NonResxWithCulture)"
527 DestinationFiles = "@(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)')"
528 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
529 <Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithCultureOnDisk"/>
530 <Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
531 </Copy>
532
533 <Copy SourceFiles = "@(NonResxWithNoCulture)"
534 DestinationFiles = "@(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)')"
535 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
536 <Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithNoCultureOnDisk"/>
537 <Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
538 </Copy>
539 </Target>
540
541 <Target Name = "GenerateResources">
542 <GenerateResource
543 Sources = "@(ResxWithNoCulture)"
544 UseSourcePath = "true"
545 OutputResources = "@(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
546 Condition = "'@(ResxWithNoCulture)' != '' ">
547
548 <Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithNoCulture"/>
549 <Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
550 </GenerateResource>
551
552 <GenerateResource
553 Sources = "@(ResxWithCulture)"
554 UseSourcePath = "true"
555 OutputResources = "@(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
556 Condition = "'@(ResxWithCulture)' != '' ">
557
558 <Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithCulture"/>
559 <Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
560 </GenerateResource>
561 </Target>
562
563 <Target Name="GenerateSatelliteAssemblies"
564 Inputs="@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
565 Outputs="$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" >
566 <!-- @(NonResxWithCulture) - rename files to ManifestNon.. and then use for AL -->
567 <MakeDir Directories = "$(IntermediateOutputPath)%(ManifestResourceWithCulture.Culture)" Condition = "'@(ManifestResourceWithCulture)' != ''" />
568 <MakeDir Directories = "$(IntermediateOutputPath)%(ManifestNonResxWithCultureOnDisk.Culture)" Condition = "'@(ManifestNonResxWithCultureOnDisk)' != ''" />
569
570 <AL
571 Culture = "%(Culture)"
572 DelaySign="$(DelaySign)"
573 EmbedResources = "@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
574 KeyFile="$(KeyOriginatorFile)"
575 ToolExe="$(AlToolExe)"
576 ToolPath="$(AlToolPath)"
577 OutputAssembly = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" >
578 <Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
579 </AL>
580
581
582 <CreateItem
583 Include = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll"
584 AdditionalMetadata = "Culture=%(Culture)"
585 Condition = "'@(ManifestResourceWithCulture)' != '' or '@(ManifestNonResxWithCultureOnDisk)' != ''">
586 <Output TaskParameter = "Include" ItemName = "IntermediateSatelliteAssemblies" />
587 </CreateItem>
588 </Target>
589
590 <PropertyGroup>
591 <CompileLicxFilesDependsOn></CompileLicxFilesDependsOn>
592 </PropertyGroup>
593
594 <Target Name = "CompileLicxFiles"
595 Condition = "'@(LicxFiles)' != ''"
596 DependsOnTargets = "$(CompileLicxFilesDependsOn)"
597 Outputs = "$(IntermediateOutputPath)$(TargetFileName).licenses">
598 <LC
599 Sources = "@(LicxFiles)"
600 LicenseTarget = "$(TargetFileName)"
601 OutputDirectory = "$(IntermediateOutputPath)"
602 OutputLicense = "$(IntermediateOutputPath)$(TargetFileName).licenses"
603 ReferencedAssemblies = "@(ReferencePath);@(ReferenceDependencyPaths)"
604 ToolPath = "$(LCToolPath)"
605 ToolExe = "$(LCToolExe)">
606
607 <Output TaskParameter="OutputLicense" ItemName="CompiledLicenseFile"/>
608 <Output TaskParameter="OutputLicense" ItemName="FileWrites"/>
609 </LC>
610 </Target>
611
612 <!-- Assign target paths to files that will need to be copied along with the project -->
613 <Target Name = "AssignTargetPaths">
614 <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
615 <Output TaskParameter="AssignedFiles" ItemName="NoneWithTargetPath"/>
616 </AssignTargetPath>
617
618 <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)">
619 <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath"/>
620 </AssignTargetPath>
621
622 <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
623 <Output TaskParameter="AssignedFiles" ItemName="EmbeddedResourceWithTargetPath"/>
624 </AssignTargetPath>
625 </Target>
626
627 <Target Name="DeployOutputFiles"
628 DependsOnTargets="PrepareResources;CoreCompile;_CopyDeployFilesToOutputDirectory;_CopyAppConfigFile">
629
630 <Copy
631 SourceFiles="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
632 Condition="'$(OutDir)' != '' and Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')"
633 DestinationFolder="$(OutDir)"
634 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" >
635 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
636 </Copy>
637
638 <Copy
639 SourceFiles="$(IntermediateOutputPath)$(AssemblyName).pdb"
640 Condition="'$(OutDir)' != '' and Exists('$(IntermediateOutputPath)$(AssemblyName).pdb')"
641 DestinationFolder="$(OutDir)"
642 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" >
643 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
644 </Copy>
645
646 <Copy SourceFiles="@(IntermediateAssembly)" Condition="'$(OutDir)' != '' and Exists ('@(IntermediateAssembly)')" DestinationFolder="$(OutDir)" SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
647 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
648 </Copy>
649
650 <Copy
651 SourceFiles = "@(IntermediateSatelliteAssemblies)"
652 DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(OutDir)\%(Culture)\$(AssemblyName).resources.dll')"
653 Condition = "'@(IntermediateSatelliteAssemblies)' != ''"
654 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
655 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
656 </Copy>
657 </Target>
658
659 <Target Name="_CopyDeployFilesToOutputDirectory"
660 DependsOnTargets="GetCopyToOutputDirectoryItems;
661 _CopyDeployFilesToOutputDirectoryAlways;
662 _CopyDeployFilesToOutputDirectoryPreserveNewest"/>
663
664 <Target Name="_CopyDeployFilesToOutputDirectoryPreserveNewest"
665 Condition="'@(ItemsToCopyToOutputDirectoryPreserveNewest)' != ''"
666 Inputs="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
667 Outputs="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')">
668
669 <Copy SourceFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
670 DestinationFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')"
671 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
672 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
673 </Copy>
674 </Target>
675
676 <!-- Copy if newer -->
677 <Target Name="_CopyDeployFilesToOutputDirectoryAlways"
678 Condition="'@(ItemsToCopyToOutputDirectoryAlways)' != ''">
679
680 <Copy SourceFiles="@(ItemsToCopyToOutputDirectoryAlways)"
681 DestinationFiles="@(ItemsToCopyToOutputDirectoryAlways->'$(OutDir)%(TargetPath)')">
682 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
683 </Copy>
684 </Target>
685
686
687 <Target Name="_CopyAppConfigFile" Condition="'@(AppConfigWithTargetPath)' != ''"
688 Inputs="@(AppConfigWithTargetPath)"
689 Outputs="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
690
691 <Copy SourceFiles="@(AppConfigWithTargetPath)"
692 DestinationFiles="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
693 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
694 </Copy>
695 </Target>
696
697 <Target Name="GetTargetPath" Outputs="$(TargetPath)"/>
698
699 <Target Name="GetCopyToOutputDirectoryItems"
700 Outputs="@(AllItemsFullPathWithTargetPath)"
701 DependsOnTargets="AssignTargetPaths;SplitProjectReferencesByExistent">
702
703 <!-- FIXME: handle .vcproj
704 FIXME: Private ProjectReferences are honored only in 3.5
705 -->
706 <MSBuild
707 Projects="@(ProjectReferenceWithConfigurationExistent)"
708 Targets="GetCopyToOutputDirectoryItems"
709 Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '%(ProjectReferenceWithConfigurationExistent.Private)' != 'false'">
710
711 <Output TaskParameter="TargetOutputs" ItemName="AllChildProjectItemsWithTargetPath"/>
712 </MSBuild>
713
714 <!-- Process items from child project. The outputs need to have full path
715 as they'll be used from other projects -->
716
717 <CreateItem
718 Include="@(AllChildProjectItemsWithTargetPath->'%(FullPath)')"
719 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
720
721 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
722 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
723 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
724 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
725 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
726
727 </CreateItem>
728
729 <!-- Process _this_ project's items -->
730
731 <CreateItem
732 Include="@(NoneWithTargetPath->'%(FullPath)')"
733 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(NoneWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
734 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
735 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
736 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
737 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
738 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
739 </CreateItem>
740
741 <CreateItem
742 Include="@(ContentWithTargetPath->'%(FullPath)')"
743 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(ContentWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
744 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
745 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
746 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
747 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
748 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
749 </CreateItem>
750
751 <CreateItem
752 Include="@(EmbeddedResourceWithTargetPath->'%(FullPath)')"
753 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
754 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
755 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
756 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
757 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
758 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
759 </CreateItem>
760
761 </Target>
762
763 <!-- Pre/Post BuildEvents -->
764 <PropertyGroup>
765 <PreBuildEventDependsOn />
766 </PropertyGroup>
767
768 <Target Name="PreBuildEvent"
769 Condition="'$(PreBuildEvent)' != ''"
770 DependsOnTargets="$(PreBuildEventDependsOn)">
771
772 <Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" />
773 </Target>
774
775 <!-- PostBuildEvent depends on $(RunPostBuildEvent)
776
777 Default: OnBuildSuccess
778 OnBuildSuccess: Run after a successful build
779 OnOutputUpdated: Run only if the output assembly got updates
780 Always: Run always
781 -->
782 <PropertyGroup>
783 <PostBuildEventDependsOn />
784 </PropertyGroup>
785
786 <!-- this gets invoked in two cases, from CoreBuildDependsOn, if the build completes
787 successfully, OR from OnError in CoreBuild, if the build failed and $(RunPostBuildEvent)
788 is 'Always' or 'OnOutputUpdated'. Invoke $(PostBuildEvent) if its either Empty (== OnBuildSuccess)
789 or OnBuildSuccess or Always OR (OnOutputUpdated and output assembly got updated) -->
790 <Target Name="PostBuildEvent"
791 Condition="'$(PostBuildEvent)' != '' and
792 ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
793 '$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')"
794 DependsOnTargets="$(PostBuildEventDependsOn)">
795
796 <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
797 </Target>
798
799 <!-- Timestamp the output assemblies, required for PostBuildEvent -->
800 <Target Name="_TimestampBeforeCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
801 <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
802 <Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeBeforeCompile" />
803 </CreateItem>
804 </Target>
805 <Target Name="_TimestampAfterCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
806 <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
807 <Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeAfterCompile" />
808 </CreateItem>
809 </Target>
810
811 <!-- Rebuild -->
812 <PropertyGroup>
813 <RebuildDependsOn>
814 BeforeRebuild;
815 Clean;
816 $(MSBuildProjectDefaultTargets);
817 AfterRebuild;
818 </RebuildDependsOn>
819
820 <RebuildDependsOn Condition="'$(MSBuildProjectDefaultTargets)' == 'Rebuild'">
821 BeforeRebuild;
822 Clean;
823 Build;
824 AfterRebuild;
825 </RebuildDependsOn>
826 </PropertyGroup>
827
828 <Target Name="BeforeRebuild" />
829 <Target Name="AfterRebuild" />
830
831 <Target Name="Rebuild"
832 DependsOnTargets="$(RebuildDependsOn)"
833 Outputs="$(TargetPath)"/>
834
835 <!-- Clean -->
836 <Target Name="_RecordCleanFile"
837 DependsOnTargets="_GetCompileOutputsForClean">
838
839 <!-- add to list of previous writes for this platform/config -->
840
841 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
842 <Output TaskParameter="Lines" ItemName="PreviousFileWrites"/>
843 </ReadLinesFromFile>
844
845 <!-- CopyLocal files: In case all the projects build to common output
846 directory, then other projects might depend on some of these
847 CopyLocal files, so delete only the ones under *this* project
848 directory -->
849 <FindUnderPath Path="$(MSBuildProjectDirectory)" Files="@(FileWritesShareable)">
850 <Output TaskParameter="InPath" ItemName="FileWrites"/>
851 </FindUnderPath>
852
853 <RemoveDuplicates Inputs="@(PreviousFileWrites);@(FileWrites->'%(FullPath)')">
854 <Output TaskParameter="Filtered" ItemName="CombinedFileWrites"/>
855 </RemoveDuplicates>
856
857 <WriteLinesToFile
858 File="$(IntermediateOutputPath)$(CleanFile)"
859 Lines="@(CombinedFileWrites)"
860 Overwrite="true"/>
861 </Target>
862
863 <PropertyGroup>
864 <CleanDependsOn>
865 BeforeClean;
866 CleanReferencedProjects;
867 CoreClean;
868 AfterClean
869 </CleanDependsOn>
870 </PropertyGroup>
871
872 <Target Name="_GetCompileOutputsForClean">
873 <!-- assembly and debug file in the *intermediate output path* -->
874 <CreateItem Include="@(IntermediateAssembly)" Condition="Exists('@(IntermediateAssembly)')">
875 <Output TaskParameter="Include" ItemName="FileWrites"/>
876 </CreateItem>
877
878 <CreateItem Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
879 Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')">
880 <Output TaskParameter="Include" ItemName="FileWrites"/>
881 </CreateItem>
882
883 <CreateItem Include="$(IntermediateOutputPath)$(AssemblyName).pdb"
884 Condition="Exists('$(IntermediateOutputPath)$(AssemblyName).pdb')">
885 <Output TaskParameter="Include" ItemName="FileWrites"/>
886 </CreateItem>
887 </Target>
888
889 <!-- Get the list of files written, for clean -->
890 <Target Name="_GetCleanFileWrites"
891 DependsOnTargets="_GetCompileOutputsForClean">
892 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
893 <Output TaskParameter="Lines" ItemName="PreviousFileWrites"/>
894 </ReadLinesFromFile>
895 </Target>
896
897 <Target Name="CleanReferencedProjects"
898 DependsOnTargets="AssignProjectConfiguration">
899
900 <!-- If building from .sln.proj or from IDE, clean will get handled by them,
901 else we are building a project directly, from the command line, so
902 clean the referenced projects -->
903 <MSBuild Projects="@(ProjectReferenceWithConfigurationExistent)"
904 Targets="Clean"
905 Condition=" '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' and '@(ProjectReferenceWithConfigurationExistent)' != ''" />
906
907 </Target>
908
909 <Target Name="Clean" DependsOnTargets="$(CleanDependsOn)"/>
910
911 <!-- Override in project to run before/after clean tasks -->
912 <Target Name="BeforeClean" />
913 <Target Name="AfterClean" />
914
915 <Target Name="CoreClean" DependsOnTargets="_GetCleanFileWrites">
916 <Delete Files="@(PreviousFileWrites);@(FileWrites)" TreatErrorsAsWarnings="true"/>
917
918 <!-- all previous files written for this platform/config have been deleted,
919 we can safely remove the file list now -->
920 <Delete Files="$(IntermediateOutputPath)$(CleanFile)" TreatErrorsAsWarnings="true" />
921 </Target>
922
923 <PropertyGroup>
924 <ImplicitlyExpandDesignTimeFacades>true</ImplicitlyExpandDesignTimeFacades>
925
926 <ResolveReferencesDependsOn>
927 $(ResolveReferencesDependsOn);
928 ImplicitlyExpandDesignTimeFacades
929 </ResolveReferencesDependsOn>
930
931 <ImplicitlyExpandDesignTimeFacadesDependsOn>
932 $(ImplicitlyExpandDesignTimeFacadesDependsOn);
933 GetReferenceAssemblyPaths
934 </ImplicitlyExpandDesignTimeFacadesDependsOn>
935 </PropertyGroup>
936
937 <Target Name="ImplicitlyExpandDesignTimeFacades" Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'" DependsOnTargets="$(ImplicitlyExpandDesignTimeFacadesDependsOn)">
938
939 <PropertyGroup>
940 <!-- Does one of our dependencies reference a System.Runtime-based portable library? -->
941 <_HasReferenceToSystemRuntime Condition="'$(DependsOnSystemRuntime)' == 'true' or '%(_ResolvedProjectReferencePaths.TargetPlatformIdentifier)' == 'Portable'">true</_HasReferenceToSystemRuntime>
942 </PropertyGroup>
943
944 <ItemGroup Condition="'$(_HasReferenceToSystemRuntime)' == 'true'">
945 <!-- If the user has manually referenced these assemblies, remove them so we don't end up with duplicates -->
946 <ReferencePath Remove="@(_DesignTimeFacadeAssemblies)"/>
947 <ReferencePath Include="%(_DesignTimeFacadeAssemblies.Identity)">
948 <WinMDFile>false</WinMDFile>
949 <CopyLocal>false</CopyLocal>
950 <ResolvedFrom>ImplicitlyExpandDesignTimeFacades</ResolvedFrom>
951 </ReferencePath>
952 <_ResolveAssemblyReferenceResolvedFiles Include="@(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" />
953 </ItemGroup>
954
955 <Message Importance="Low" Text="Including @(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" />
956
957 </Target>
958
959 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\*"
960 Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter')"/>
961 </Project>