1 <Project DefaultTargets="Build" InitialTargets="_ValidateEssentialProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
4 <ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
7 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore\*"
8 Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore')"/>
11 <TargetExt Condition="'$(OutputType)' == 'Winexe'">.exe</TargetExt>
12 <TargetExt Condition="'$(OutputType)' == 'Exe'">.exe</TargetExt>
13 <TargetExt Condition="'$(OutputType)' == 'Library'">.dll</TargetExt>
14 <TargetExt Condition="'$(OutputType)' == 'Netmodule'">.netmodule</TargetExt>
18 <ProjectDir Condition="'$(ProjectDir)' == ''">$(MSBuildProjectDirectory)\</ProjectDir>
22 <AssemblyName Condition="'$(AssemblyName)' == ''">$(RootNamespace)</AssemblyName>
23 <OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
24 <OutputPath Condition=" '$(Platform)'=='' and '$(Configuration)'=='' and '$(OutputPath)'=='' ">bin\Debug\</OutputPath>
25 <WarningLevel Condition="'$(WarningLevel)' == ''" >2</WarningLevel>
27 <TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
28 <TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
30 <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$(TargetFrameworkProfile)' != ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
31 <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
35 <OutDir Condition="'$(OutDir)' == ''">$(OutputPath)</OutDir>
36 <OutDir Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')">$(OutDir)\</OutDir>
38 <_OriginalConfiguration>$(Configuration)</_OriginalConfiguration>
39 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
40 <ConfigurationName Condition="'$(ConfigurationName)' == ''">$(Configuration)</ConfigurationName>
42 <_OriginalPlatform>$(Platform)</_OriginalPlatform>
43 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
44 <PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
46 <AddAdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == ''">true</AddAdditionalExplicitAssemblyReferences>
47 <AdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == 'true' and '$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0'">System.Core;$(AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
51 <SkipCopyUnchangedFiles Condition="'$(SkipCopyUnchangedFiles)' == ''">true</SkipCopyUnchangedFiles>
55 <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">obj\</BaseIntermediateOutputPath>
56 <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')">$(BaseIntermediateOutputPath)\</BaseIntermediateOutputPath>
57 <CleanFile Condition="'$(CleanFile)'==''">$(MSBuildProjectFile).FilesWrittenAbsolute.txt</CleanFile>
60 <PropertyGroup Condition="'$(IntermediateOutputPath)' == ''">
61 <IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
62 <IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
66 <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath>
70 <IntermediateAssembly Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)" />
72 <!-- creating this as a item to use FullPath on it, to build TargetPath -->
73 <_OutDirItem Include="$(OutDir)"/>
77 <TargetName Condition="'$(TargetName)' == '' ">$(AssemblyName)</TargetName>
78 <TargetFileName Condition="'$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName>
79 <TargetDir Condition=" '$(TargetDir)' == '' ">@(_OutDirItem->'%(FullPath)')</TargetDir>
80 <TargetPath Condition=" '$(TargetPath)' == '' ">@(_OutDirItem->'%(FullPath)\$(TargetFileName)')</TargetPath>
81 <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildProjectFullPath);$(MSBuildToolsPath)\Microsoft.Common.targets</MSBuildAllProjects>
82 <KeyOriginatorFile Condition=" '$(SignAssembly)' == 'true' ">$(AssemblyOriginatorKeyFile)</KeyOriginatorFile>
85 <Target Name="_ValidateEssentialProperties">
86 <Error Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' != 'true'"
87 Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
89 <Warning Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' == 'true'"
90 Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
92 <!-- If OutDir is specified via the command line, then the earlier check
93 to add a trailing slash won't have any affect, so error here. -->
95 Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')"
96 Text="OutDir property must end with a slash."/>
99 <Target Name="PrepareForBuild">
100 <Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/>
102 <!-- Look for app.config, if $(AppConfig) is specified, then use that. Else look in
103 @(None) and @(Content) -->
104 <CreateItem Include="$(AppConfig)" Condition="'$(AppConfig)' != ''"
105 AdditionalMetadata="TargetPath=$(TargetFileName).config">
106 <Output TaskParameter="Include" ItemName="AppConfigWithTargetPath" />
109 <FindAppConfigFile PrimaryList="@(None)" SecondaryList="@(Content)" TargetPath="$(TargetFileName).config"
110 Condition="'$(AppConfig)' == ''">
111 <Output TaskParameter="AppConfigFile" ItemName="AppConfigWithTargetPath"/>
115 Directories="$(OutDir);$(IntermediateOutputPath);@(DocFileItem->'%(RelativeDir)')"
120 <GetFrameworkPathsDependsOn />
122 <Target Name="GetFrameworkPaths"
123 Condition="'$(TargetFrameworkIdentifier)' == '' or '$(TargetFrameworkIdentifier)' == '.NETFramework'"
124 DependsOnTargets="$(GetFrameworkPathsDependsOn)">
126 <Output Condition="'$(TargetFrameworkVersion)' == 'v4.0'"
127 TaskParameter="FrameworkVersion40Path"
128 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
129 <Output Condition="'$(TargetFrameworkVersion)' == 'v3.5'"
130 TaskParameter="FrameworkVersion35Path"
131 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
132 <Output Condition="'$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'"
133 TaskParameter="FrameworkVersion30Path"
134 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
135 <Output Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'"
136 TaskParameter="FrameworkVersion20Path"
137 ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
139 <CreateProperty Value="@(_CombinedTargetFrameworkDirectoriesItem)">
140 <Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/>
143 <Warning Text="TargetFrameworkVersion '$(TargetFrameworkVersion)' not supported by this toolset (ToolsVersion: $(MSBuildToolsVersion))."
144 Condition="'$(TargetFrameworkVersion)' != 'v4.0' and '$(TargetFrameworkVersion)' != 'v3.5' and '$(TargetFrameworkVersion)' != 'v3.0' and '$(TargetFrameworkVersion)' != 'v2.0'"/>
148 <GetReferenceAssemblyPathsDependsOn />
150 <Target Name="GetReferenceAssemblyPaths" DependsOnTargets="$(GetReferenceAssemblyPathsDependsOn)">
151 <!-- in case of .NETFramework, $(TargetFrameworkDirectory) would have been set by
152 GetFrameworkPaths, if it hasn't been changed, then clear it, to avoid duplicates -->
153 <CreateProperty Value="" Condition="'@(_CombinedTargetFrameworkDirectoriesItem)' == '$(TargetFrameworkDirectory)'">
154 <Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/>
157 <GetReferenceAssemblyPaths
158 Condition="'$(TargetFrameworkMoniker)' != '' and '$(_TargetFrameworkDirectories)' == ''"
159 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
160 RootPath="$(TargetFrameworkRootPath)">
162 <Output TaskParameter="ReferenceAssemblyPaths" PropertyName="_TargetFrameworkDirectories"/>
163 <Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="_FullFrameworkReferenceAssemblyPaths"/>
164 <Output TaskParameter="TargetFrameworkMonikerDisplayName" PropertyName="TargetFrameworkMonikerDisplayName"/>
165 </GetReferenceAssemblyPaths>
167 <CreateProperty Value="$(_TargetFrameworkDirectories);$(TargetFrameworkDirectory)">
168 <Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/>
173 <AllowedReferenceAssemblyFileExtensions Condition=" '$(AllowedReferenceAssemblyFileExtensions)' == '' ">
176 </AllowedReferenceAssemblyFileExtensions>
178 <AllowedReferenceRelatedFileExtensions Condition=" '$(AllowedReferenceRelatedFileExtensions)' == '' ">
180 </AllowedReferenceRelatedFileExtensions>
182 <AssemblySearchPaths Condition="'$(AssemblySearchPaths)' == ''">
183 {CandidateAssemblyFiles};
186 {TargetFrameworkDirectory};
191 </AssemblySearchPaths>
193 <ResolveReferencesDependsOn>
194 BeforeResolveReferences;
195 ResolveProjectReferences;
196 ResolveAssemblyReferences;
197 AfterResolveReferences
198 </ResolveReferencesDependsOn>
200 <ResolveAssemblyReferencesDependsOn>
202 GetReferenceAssemblyPaths;
204 </ResolveAssemblyReferencesDependsOn>
207 <Target Name="ResolveReferences" DependsOnTargets="$(ResolveReferencesDependsOn)"/>
209 <Target Name="BeforeResolveReferences" />
210 <Target Name="AfterResolveReferences" />
212 <Target Name="ResolveAssemblyReferences" DependsOnTargets="$(ResolveAssemblyReferencesDependsOn)">
213 <CreateItem Include="@(Reference)" Exclude="$(AdditionalExplicitAssemblyReferences)">
214 <Output TaskParameter="Include" ItemName="_Reference"/>
217 <CreateItem Include="$(AdditionalExplicitAssemblyReferences)">
218 <Output TaskParameter="Include" ItemName="_Reference"/>
221 <ResolveAssemblyReference
222 Assemblies="@(_Reference)"
223 AssemblyFiles="@(ChildProjectReferences)"
224 SearchPaths="$(AssemblySearchPaths)"
225 CandidateAssemblyFiles="@(Content);@(None)"
226 TargetFrameworkDirectories="$(TargetFrameworkDirectory)"
227 AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
228 AllowedRelatedFileExtensions="$(AllowedReferenceRelatedFileExtensions)"
229 FindDependencies="true"
230 FindSatellites="true"
231 FindRelatedFiles="true"
232 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
233 TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)"
234 TargetFrameworkVersion="$(TargetFrameworkVersion)"
236 <Output TaskParameter="ResolvedFiles" ItemName="ResolvedFiles"/>
237 <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
238 <Output TaskParameter="ResolvedDependencyFiles" ItemName="_ResolvedDependencyFiles"/>
239 <Output TaskParameter="RelatedFiles" ItemName="_ReferenceRelatedPaths"/>
240 <Output TaskParameter="SatelliteFiles" ItemName="ReferenceSatellitePaths"/>
241 <Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/>
242 </ResolveAssemblyReference>
246 Name="AssignProjectConfigurations"
247 Condition="'@(ProjectReference)' != ''">
249 <!-- assign configs if building a solution file -->
250 <AssignProjectConfiguration
251 ProjectReferences = "@(ProjectReference)"
252 SolutionConfigurationContents = "$(CurrentSolutionConfigurationContents)"
253 Condition="'$(BuildingSolutionFile)' == 'true'">
255 <Output TaskParameter = "AssignedProjects" ItemName = "ProjectReferenceWithConfiguration"/>
256 </AssignProjectConfiguration>
259 <CreateItem Include="@(ProjectReference)" Condition="'$(BuildingSolutionFile)' != 'true'">
260 <Output TaskParameter="Include" ItemName="ProjectReferenceWithConfiguration"/>
265 <!-- Split projects into 2 lists
266 ProjectReferenceWithConfigurationExistent: Projects existent on disk
267 ProjectReferenceWithConfigurationNonExistent: Projects non-existent on disk -->
269 <Target Name="SplitProjectReferencesByExistent"
270 DependsOnTargets="AssignProjectConfigurations">
272 <CreateItem Include="@(ProjectReferenceWithConfiguration)" Condition="'@(ProjectReferenceWithConfiguration)' != ''">
273 <Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationExistent"
274 Condition="Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/>
276 <Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationNonExistent"
277 Condition="!Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/>
282 Name="ResolveProjectReferences"
283 DependsOnTargets="SplitProjectReferencesByExistent"
285 <!-- If building from a .sln.proj or from IDE, then referenced projects have already
286 been built, so just get the target paths -->
288 Projects="@(ProjectReferenceWithConfigurationExistent)"
289 Targets="GetTargetPath"
290 Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)"
291 Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')">
293 <Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" />
296 <!-- Building a project directly, build the referenced the projects also -->
298 Projects="@(ProjectReferenceWithConfigurationExistent)"
299 Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)"
300 Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' ">
302 <Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" />
305 <Warning Text="Referenced Project %(ProjectReferenceWithConfigurationNonExistent.Identity) not found, ignoring."
306 Condition="'@(ProjectReferenceWithConfigurationNonExistent)' != ''"/>
309 <Target Name = "CopyFilesMarkedCopyLocal">
311 SourceFiles="@(ReferenceCopyLocalPaths)"
312 DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')"
313 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
314 <Output TaskParameter = "DestinationFiles" ItemName = "FileWritesShareable"/>
318 <Target Name="_ComputeNonExistentFileProperty" Condition='false'>
319 <CreateProperty Value="__NonExistentSubDir__\__NonExistentFile__">
320 <Output TaskParameter="Value" PropertyName="NonExistentFile"/>
332 <Target Name="BeforeBuild"/>
333 <Target Name="AfterBuild"/>
335 <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)"/>
341 GetReferenceAssemblyPaths;
344 CopyFilesMarkedCopyLocal;
351 </CoreBuildDependsOn>
356 DependsOnTargets="$(CoreBuildDependsOn)"
357 Outputs="$(OutDir)$(AssemblyName)$(TargetExt)">
359 <OnError ExecuteTargets="_TimestampAfterCompile;PostBuildEvent"
360 Condition=" '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated'"/>
362 <OnError ExecuteTargets="_RecordCleanFile" />
369 _TimestampBeforeCompile;
371 _TimestampAfterCompile;
376 <Target Name="BeforeCompile" />
377 <Target Name="AfterCompile" />
379 <Target Name="Compile" DependsOnTargets="$(CompileDependsOn)"/>
382 <PrepareForRunDependsOn>
384 </PrepareForRunDependsOn>
386 <Target Name="PrepareForRun" DependsOnTargets="$(PrepareForRunDependsOn)"/>
389 <PrepareResourcesDependsOn>
391 SplitResourcesByCulture;
392 CreateManifestResourceNames;
393 CopyNonResxEmbeddedResources;
395 GenerateSatelliteAssemblies;
397 </PrepareResourcesDependsOn>
399 <Target Name="PrepareResources" DependsOnTargets="$(PrepareResourcesDependsOn)" />
401 <Target Name="SplitResourcesByCulture" DependsOnTargets="AssignTargetPaths">
402 <!-- Extract .licx files into @(LicxFiles) -->
403 <CreateItem Include="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' == '.licx'">
404 <Output TaskParameter="Include" ItemName="LicxFiles"/>
407 <!-- Split *remaining* resource files into various groups.. -->
408 <AssignCulture Files="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' != '.licx'">
409 <Output TaskParameter="AssignedFilesWithNoCulture" ItemName="ResourcesWithNoCulture"/>
410 <Output TaskParameter="AssignedFilesWithCulture" ItemName="ResourcesWithCulture"/>
413 <CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' == '.resx'">
414 <Output TaskParameter="Include" ItemName="ResxWithNoCulture"/>
417 <CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' != '.resx'">
418 <Output TaskParameter="Include" ItemName="NonResxWithNoCulture"/>
421 <CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' == '.resx'">
422 <Output TaskParameter="Include" ItemName="ResxWithCulture"/>
425 <CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' != '.resx'">
426 <Output TaskParameter="Include" ItemName="NonResxWithCulture"/>
430 <!-- Copy non-resx resources to their manifest resource names, this is what the compiler expects -->
431 <Target Name = "CopyNonResxEmbeddedResources"
432 Condition = "'@(NonResxWithCulture)' != '' or '@(NonResxWithNoCulture)' != '' or '@(ManifestNonResxWithCulture)' != '' or '@(ManifestNonResxWithNoCulture)' != ''">
434 <MakeDir Directories="$(IntermediateOutputPath)%(ManifestNonResxWithCulture.Culture)"/>
435 <Copy SourceFiles = "@(NonResxWithCulture)"
436 DestinationFiles = "@(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)')"
437 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
438 <Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithCultureOnDisk"/>
439 <Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
442 <Copy SourceFiles = "@(NonResxWithNoCulture)"
443 DestinationFiles = "@(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)')"
444 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
445 <Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithNoCultureOnDisk"/>
446 <Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
450 <Target Name = "GenerateResources">
452 Sources = "@(ResxWithNoCulture)"
453 UseSourcePath = "true"
454 OutputResources = "@(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
455 Condition = "'@(ResxWithNoCulture)' != '' ">
457 <Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithNoCulture"/>
458 <Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
462 Sources = "@(ResxWithCulture)"
463 UseSourcePath = "true"
464 OutputResources = "@(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
465 Condition = "'@(ResxWithCulture)' != '' ">
467 <Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithCulture"/>
468 <Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
472 <Target Name="GenerateSatelliteAssemblies"
473 Inputs="@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
474 Outputs="$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" >
475 <!-- @(NonResxWithCulture) - rename files to ManifestNon.. and then use for AL -->
476 <MakeDir Directories = "$(IntermediateOutputPath)%(ManifestResourceWithCulture.Culture)" Condition = "'@(ManifestResourceWithCulture)' != ''" />
477 <MakeDir Directories = "$(IntermediateOutputPath)%(ManifestNonResxWithCultureOnDisk.Culture)" Condition = "'@(ManifestNonResxWithCultureOnDisk)' != ''" />
480 Culture = "%(Culture)"
481 DelaySign="$(DelaySign)"
482 EmbedResources = "@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
483 KeyFile="$(KeyOriginatorFile)"
484 ToolExe="$(AlToolExe)"
485 ToolPath="$(AlToolPath)"
486 OutputAssembly = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" >
487 <Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
492 Include = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll"
493 AdditionalMetadata = "Culture=%(Culture)"
494 Condition = "'@(ManifestResourceWithCulture)' != '' or '@(ManifestNonResxWithCultureOnDisk)' != ''">
495 <Output TaskParameter = "Include" ItemName = "IntermediateSatelliteAssemblies" />
500 <CompileLicxFilesDependsOn></CompileLicxFilesDependsOn>
503 <Target Name = "CompileLicxFiles"
504 Condition = "'@(LicxFiles)' != ''"
505 DependsOnTargets = "$(CompileLicxFilesDependsOn)"
506 Outputs = "$(IntermediateOutputPath)$(TargetFileName).licenses">
508 Sources = "@(LicxFiles)"
509 LicenseTarget = "$(TargetFileName)"
510 OutputDirectory = "$(IntermediateOutputPath)"
511 OutputLicense = "$(IntermediateOutputPath)$(TargetFileName).licenses"
512 ReferencedAssemblies = "@(ReferencePath);@(_ResolvedDependencyFiles)"
513 ToolPath = "$(LCToolPath)"
514 ToolExe = "$(LCToolExe)">
516 <Output TaskParameter="OutputLicense" ItemName="CompiledLicenseFile"/>
517 <Output TaskParameter="OutputLicense" ItemName="FileWrites"/>
521 <!-- Assign target paths to files that will need to be copied along with the project -->
522 <Target Name = "AssignTargetPaths">
523 <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
524 <Output TaskParameter="AssignedFiles" ItemName="NoneWithTargetPath"/>
527 <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)">
528 <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath"/>
531 <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
532 <Output TaskParameter="AssignedFiles" ItemName="EmbeddedResourceWithTargetPath"/>
536 <Target Name="DeployOutputFiles"
537 DependsOnTargets="PrepareResources;CoreCompile;_CopyDeployFilesToOutputDirectory;_CopyAppConfigFile">
540 SourceFiles="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
541 Condition="'$(OutDir)' != '' and Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')"
542 DestinationFolder="$(OutDir)"
543 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" >
544 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
547 <Copy SourceFiles="@(IntermediateAssembly)" Condition="'$(OutDir)' != '' and Exists ('@(IntermediateAssembly)')" DestinationFolder="$(OutDir)" SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
548 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
552 SourceFiles = "@(IntermediateSatelliteAssemblies)"
553 DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(OutDir)\%(Culture)\$(AssemblyName).resources.dll')"
554 Condition = "'@(IntermediateSatelliteAssemblies)' != ''"
555 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
556 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
560 <Target Name="_CopyDeployFilesToOutputDirectory"
561 DependsOnTargets="GetCopyToOutputDirectoryItems;
562 _CopyDeployFilesToOutputDirectoryAlways;
563 _CopyDeployFilesToOutputDirectoryPreserveNewest"/>
565 <Target Name="_CopyDeployFilesToOutputDirectoryPreserveNewest"
566 Condition="'@(ItemsToCopyToOutputDirectoryPreserveNewest)' != ''"
567 Inputs="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
568 Outputs="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')">
570 <Copy SourceFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
571 DestinationFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')"
572 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
573 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
577 <!-- Copy if newer -->
578 <Target Name="_CopyDeployFilesToOutputDirectoryAlways"
579 Condition="'@(ItemsToCopyToOutputDirectoryAlways)' != ''">
581 <Copy SourceFiles="@(ItemsToCopyToOutputDirectoryAlways)"
582 DestinationFiles="@(ItemsToCopyToOutputDirectoryAlways->'$(OutDir)%(TargetPath)')">
583 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
588 <Target Name="_CopyAppConfigFile" Condition="'@(AppConfigWithTargetPath)' != ''"
589 Inputs="@(AppConfigWithTargetPath)"
590 Outputs="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
592 <Copy SourceFiles="@(AppConfigWithTargetPath)"
593 DestinationFiles="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
594 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
598 <Target Name="GetTargetPath" Outputs="$(TargetPath)"/>
600 <Target Name="GetCopyToOutputDirectoryItems"
601 Outputs="@(AllItemsFullPathWithTargetPath)"
602 DependsOnTargets="AssignTargetPaths;SplitProjectReferencesByExistent">
604 <!-- FIXME: handle .vcproj
605 FIXME: Private ProjectReferences are honored only in 3.5
608 Projects="@(ProjectReferenceWithConfigurationExistent)"
609 Targets="GetCopyToOutputDirectoryItems"
610 Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '%(ProjectReferenceWithConfigurationExistent.Private)' != 'false'">
612 <Output TaskParameter="TargetOutputs" ItemName="AllChildProjectItemsWithTargetPath"/>
615 <!-- Process items from child project. The outputs need to have full path
616 as they'll be used from other projects -->
619 Include="@(AllChildProjectItemsWithTargetPath->'%(FullPath)')"
620 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
622 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
623 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
624 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
625 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
626 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
630 <!-- Process _this_ project's items -->
633 Include="@(NoneWithTargetPath->'%(FullPath)')"
634 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(NoneWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
635 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
636 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
637 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
638 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
639 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
643 Include="@(ContentWithTargetPath->'%(FullPath)')"
644 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(ContentWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
645 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
646 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
647 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
648 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
649 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
653 Include="@(EmbeddedResourceWithTargetPath->'%(FullPath)')"
654 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
655 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
656 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
657 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
658 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
659 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
664 <!-- Pre/Post BuildEvents -->
666 <PreBuildEventDependsOn />
669 <Target Name="PreBuildEvent"
670 Condition="'$(PreBuildEvent)' != ''"
671 DependsOnTargets="$(PreBuildEventDependsOn)">
673 <Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" />
676 <!-- PostBuildEvent depends on $(RunPostBuildEvent)
678 Default: OnBuildSuccess
679 OnBuildSuccess: Run after a successful build
680 OnOutputUpdated: Run only if the output assembly got updates
684 <PostBuildEventDependsOn />
687 <!-- this gets invoked in two cases, from CoreBuildDependsOn, if the build completes
688 successfully, OR from OnError in CoreBuild, if the build failed and $(RunPostBuildEvent)
689 is 'Always' or 'OnOutputUpdated'. Invoke $(PostBuildEvent) if its either Empty (== OnBuildSuccess)
690 or OnBuildSuccess or Always OR (OnOutputUpdated and output assembly got updated) -->
691 <Target Name="PostBuildEvent"
692 Condition="'$(PostBuildEvent)' != '' and
693 ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
694 '$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')"
695 DependsOnTargets="$(PostBuildEventDependsOn)">
697 <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
700 <!-- Timestamp the output assemblies, required for PostBuildEvent -->
701 <Target Name="_TimestampBeforeCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
702 <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
703 <Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeBeforeCompile" />
706 <Target Name="_TimestampAfterCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
707 <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
708 <Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeAfterCompile" />
717 $(MSBuildProjectDefaultTargets);
721 <RebuildDependsOn Condition="'$(MSBuildProjectDefaultTargets)' == 'Rebuild'">
729 <Target Name="BeforeRebuild" />
730 <Target Name="AfterRebuild" />
732 <Target Name="Rebuild"
733 DependsOnTargets="$(RebuildDependsOn)"
734 Outputs="$(TargetPath)"/>
737 <Target Name="_RecordCleanFile"
738 DependsOnTargets="_GetCompileOutputsForClean">
740 <!-- add to list of previous writes for this platform/config -->
742 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
743 <Output TaskParameter="Lines" ItemName="PreviousFileWrites"/>
746 <RemoveDuplicates Inputs="@(PreviousFileWrites);@(FileWrites->'%(FullPath)')">
747 <Output TaskParameter="Filtered" ItemName="CombinedFileWrites"/>
750 <!-- CopyLocal files: In case all the projects build to common output
751 directory, then other projects might depend on some of these
752 CopyLocal files, so delete only the ones under *this* project
754 <FindUnderPath Path="$(MSBuildProjectDirectory)" Files="@(FileWritesShareable)">
755 <Output TaskParameter="InPath" ItemName="FileWrites"/>
759 File="$(IntermediateOutputPath)$(CleanFile)"
760 Lines="@(CombinedFileWrites)"
767 CleanReferencedProjects;
773 <Target Name="_GetCompileOutputsForClean">
774 <!-- assembly and debug file in the *intermediate output path* -->
775 <CreateItem Include="@(IntermediateAssembly)" Condition="Exists('@(IntermediateAssembly)')">
776 <Output TaskParameter="Include" ItemName="FileWrites"/>
779 <CreateItem Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
780 Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')">
781 <Output TaskParameter="Include" ItemName="FileWrites"/>
785 <!-- Get the list of files written, for clean -->
786 <Target Name="_GetCleanFileWrites"
787 DependsOnTargets="_GetCompileOutputsForClean">
788 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
789 <Output TaskParameter="Lines" ItemName="PreviousFileWrites"/>
793 <Target Name="CleanReferencedProjects"
794 DependsOnTargets="AssignProjectConfigurations">
796 <!-- If building from .sln.proj or from IDE, clean will get handled by them,
797 else we are building a project directly, from the command line, so
798 clean the referenced projects -->
799 <MSBuild Projects="@(ProjectReferenceWithConfigurationExistent)"
801 Condition=" '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' and '@(ProjectReferenceWithConfigurationExistent)' != ''" />
805 <Target Name="Clean" DependsOnTargets="$(CleanDependsOn)"/>
807 <!-- Override in project to run before/after clean tasks -->
808 <Target Name="BeforeClean" />
809 <Target Name="AfterClean" />
811 <Target Name="CoreClean" DependsOnTargets="_GetCleanFileWrites">
812 <Delete Files="@(PreviousFileWrites);@(FileWrites)" TreatErrorsAsWarnings="true"/>
814 <!-- all previous files written for this platform/config have been deleted,
815 we can safely remove the file list now -->
816 <Delete Files="$(IntermediateOutputPath)$(CleanFile)" TreatErrorsAsWarnings="true" />
819 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\*"
820 Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter')"/>