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"/>
319 Not needed at the moment
320 <Target Name="_ComputeNonExistentFileProperty" Condition='false'>
321 <CreateProperty Value="__NonExistentSubDir__\__NonExistentFile__">
322 <Output TaskParameter="Value" PropertyName="NonExistentFile"/>
335 <Target Name="BeforeBuild"/>
336 <Target Name="AfterBuild"/>
338 <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)"/>
344 GetReferenceAssemblyPaths;
347 CopyFilesMarkedCopyLocal;
354 </CoreBuildDependsOn>
359 DependsOnTargets="$(CoreBuildDependsOn)"
360 Outputs="$(OutDir)$(AssemblyName)$(TargetExt)">
362 <OnError ExecuteTargets="_TimestampAfterCompile;PostBuildEvent"
363 Condition=" '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated'"/>
365 <OnError ExecuteTargets="_RecordCleanFile" />
372 _TimestampBeforeCompile;
374 _TimestampAfterCompile;
379 <Target Name="BeforeCompile" />
380 <Target Name="AfterCompile" />
382 <Target Name="Compile" DependsOnTargets="$(CompileDependsOn)"/>
385 <PrepareForRunDependsOn>
387 </PrepareForRunDependsOn>
389 <Target Name="PrepareForRun" DependsOnTargets="$(PrepareForRunDependsOn)"/>
392 <PrepareResourcesDependsOn>
394 SplitResourcesByCulture;
395 CreateManifestResourceNames;
396 CopyNonResxEmbeddedResources;
398 GenerateSatelliteAssemblies;
400 </PrepareResourcesDependsOn>
402 <Target Name="PrepareResources" DependsOnTargets="$(PrepareResourcesDependsOn)" />
404 <Target Name="SplitResourcesByCulture" DependsOnTargets="AssignTargetPaths">
405 <!-- Extract .licx files into @(LicxFiles) -->
406 <CreateItem Include="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' == '.licx'">
407 <Output TaskParameter="Include" ItemName="LicxFiles"/>
410 <!-- Split *remaining* resource files into various groups.. -->
411 <AssignCulture Files="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' != '.licx'">
412 <Output TaskParameter="AssignedFilesWithNoCulture" ItemName="ResourcesWithNoCulture"/>
413 <Output TaskParameter="AssignedFilesWithCulture" ItemName="ResourcesWithCulture"/>
416 <CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' == '.resx'">
417 <Output TaskParameter="Include" ItemName="ResxWithNoCulture"/>
420 <CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' != '.resx'">
421 <Output TaskParameter="Include" ItemName="NonResxWithNoCulture"/>
424 <CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' == '.resx'">
425 <Output TaskParameter="Include" ItemName="ResxWithCulture"/>
428 <CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' != '.resx'">
429 <Output TaskParameter="Include" ItemName="NonResxWithCulture"/>
433 <!-- Copy non-resx resources to their manifest resource names, this is what the compiler expects -->
434 <Target Name = "CopyNonResxEmbeddedResources"
435 Condition = "'@(NonResxWithCulture)' != '' or '@(NonResxWithNoCulture)' != '' or '@(ManifestNonResxWithCulture)' != '' or '@(ManifestNonResxWithNoCulture)' != ''">
437 <MakeDir Directories="$(IntermediateOutputPath)%(ManifestNonResxWithCulture.Culture)"/>
438 <Copy SourceFiles = "@(NonResxWithCulture)"
439 DestinationFiles = "@(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)')"
440 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
441 <Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithCultureOnDisk"/>
442 <Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
445 <Copy SourceFiles = "@(NonResxWithNoCulture)"
446 DestinationFiles = "@(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)')"
447 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
448 <Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithNoCultureOnDisk"/>
449 <Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
453 <Target Name = "GenerateResources">
455 Sources = "@(ResxWithNoCulture)"
456 UseSourcePath = "true"
457 OutputResources = "@(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
458 Condition = "'@(ResxWithNoCulture)' != '' ">
460 <Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithNoCulture"/>
461 <Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
465 Sources = "@(ResxWithCulture)"
466 UseSourcePath = "true"
467 OutputResources = "@(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
468 Condition = "'@(ResxWithCulture)' != '' ">
470 <Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithCulture"/>
471 <Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
475 <Target Name="GenerateSatelliteAssemblies"
476 Inputs="@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
477 Outputs="$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" >
478 <!-- @(NonResxWithCulture) - rename files to ManifestNon.. and then use for AL -->
479 <MakeDir Directories = "$(IntermediateOutputPath)%(ManifestResourceWithCulture.Culture)" Condition = "'@(ManifestResourceWithCulture)' != ''" />
480 <MakeDir Directories = "$(IntermediateOutputPath)%(ManifestNonResxWithCultureOnDisk.Culture)" Condition = "'@(ManifestNonResxWithCultureOnDisk)' != ''" />
483 Culture = "%(Culture)"
484 DelaySign="$(DelaySign)"
485 EmbedResources = "@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
486 KeyFile="$(KeyOriginatorFile)"
487 ToolExe="$(AlToolExe)"
488 ToolPath="$(AlToolPath)"
489 OutputAssembly = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" >
490 <Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
495 Include = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll"
496 AdditionalMetadata = "Culture=%(Culture)"
497 Condition = "'@(ManifestResourceWithCulture)' != '' or '@(ManifestNonResxWithCultureOnDisk)' != ''">
498 <Output TaskParameter = "Include" ItemName = "IntermediateSatelliteAssemblies" />
503 <CompileLicxFilesDependsOn></CompileLicxFilesDependsOn>
506 <Target Name = "CompileLicxFiles"
507 Condition = "'@(LicxFiles)' != ''"
508 DependsOnTargets = "$(CompileLicxFilesDependsOn)"
509 Outputs = "$(IntermediateOutputPath)$(TargetFileName).licenses">
511 Sources = "@(LicxFiles)"
512 LicenseTarget = "$(TargetFileName)"
513 OutputDirectory = "$(IntermediateOutputPath)"
514 OutputLicense = "$(IntermediateOutputPath)$(TargetFileName).licenses"
515 ReferencedAssemblies = "@(ReferencePath);@(_ResolvedDependencyFiles)"
516 ToolPath = "$(LCToolPath)"
517 ToolExe = "$(LCToolExe)">
519 <Output TaskParameter="OutputLicense" ItemName="CompiledLicenseFile"/>
520 <Output TaskParameter="OutputLicense" ItemName="FileWrites"/>
524 <!-- Assign target paths to files that will need to be copied along with the project -->
525 <Target Name = "AssignTargetPaths">
526 <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
527 <Output TaskParameter="AssignedFiles" ItemName="NoneWithTargetPath"/>
530 <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)">
531 <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath"/>
534 <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
535 <Output TaskParameter="AssignedFiles" ItemName="EmbeddedResourceWithTargetPath"/>
539 <Target Name="DeployOutputFiles"
540 DependsOnTargets="PrepareResources;CoreCompile;_CopyDeployFilesToOutputDirectory;_CopyAppConfigFile">
543 SourceFiles="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
544 Condition="'$(OutDir)' != '' and Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')"
545 DestinationFolder="$(OutDir)"
546 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" >
547 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
550 <Copy SourceFiles="@(IntermediateAssembly)" Condition="'$(OutDir)' != '' and Exists ('@(IntermediateAssembly)')" DestinationFolder="$(OutDir)" SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
551 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
555 SourceFiles = "@(IntermediateSatelliteAssemblies)"
556 DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(OutDir)\%(Culture)\$(AssemblyName).resources.dll')"
557 Condition = "'@(IntermediateSatelliteAssemblies)' != ''"
558 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
559 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
563 <Target Name="_CopyDeployFilesToOutputDirectory"
564 DependsOnTargets="GetCopyToOutputDirectoryItems;
565 _CopyDeployFilesToOutputDirectoryAlways;
566 _CopyDeployFilesToOutputDirectoryPreserveNewest"/>
568 <Target Name="_CopyDeployFilesToOutputDirectoryPreserveNewest"
569 Condition="'@(ItemsToCopyToOutputDirectoryPreserveNewest)' != ''"
570 Inputs="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
571 Outputs="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')">
573 <Copy SourceFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
574 DestinationFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')"
575 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)">
576 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
580 <!-- Copy if newer -->
581 <Target Name="_CopyDeployFilesToOutputDirectoryAlways"
582 Condition="'@(ItemsToCopyToOutputDirectoryAlways)' != ''">
584 <Copy SourceFiles="@(ItemsToCopyToOutputDirectoryAlways)"
585 DestinationFiles="@(ItemsToCopyToOutputDirectoryAlways->'$(OutDir)%(TargetPath)')">
586 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
591 <Target Name="_CopyAppConfigFile" Condition="'@(AppConfigWithTargetPath)' != ''"
592 Inputs="@(AppConfigWithTargetPath)"
593 Outputs="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
595 <Copy SourceFiles="@(AppConfigWithTargetPath)"
596 DestinationFiles="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
597 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
601 <Target Name="GetTargetPath" Outputs="$(TargetPath)"/>
603 <Target Name="GetCopyToOutputDirectoryItems"
604 Outputs="@(AllItemsFullPathWithTargetPath)"
605 DependsOnTargets="AssignTargetPaths;SplitProjectReferencesByExistent">
607 <!-- FIXME: handle .vcproj
608 FIXME: Private ProjectReferences are honored only in 3.5
611 Projects="@(ProjectReferenceWithConfigurationExistent)"
612 Targets="GetCopyToOutputDirectoryItems"
613 Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '%(ProjectReferenceWithConfigurationExistent.Private)' != 'false'">
615 <Output TaskParameter="TargetOutputs" ItemName="AllChildProjectItemsWithTargetPath"/>
618 <!-- Process items from child project. The outputs need to have full path
619 as they'll be used from other projects -->
622 Include="@(AllChildProjectItemsWithTargetPath->'%(FullPath)')"
623 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
625 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
626 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
627 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
628 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
629 Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
633 <!-- Process _this_ project's items -->
636 Include="@(NoneWithTargetPath->'%(FullPath)')"
637 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(NoneWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
638 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
639 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
640 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
641 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
642 Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
646 Include="@(ContentWithTargetPath->'%(FullPath)')"
647 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(ContentWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
648 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
649 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
650 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
651 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
652 Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
656 Include="@(EmbeddedResourceWithTargetPath->'%(FullPath)')"
657 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'">
658 <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/>
659 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways"
660 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
661 <Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest"
662 Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
667 <!-- Pre/Post BuildEvents -->
669 <PreBuildEventDependsOn />
672 <Target Name="PreBuildEvent"
673 Condition="'$(PreBuildEvent)' != ''"
674 DependsOnTargets="$(PreBuildEventDependsOn)">
676 <Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" />
679 <!-- PostBuildEvent depends on $(RunPostBuildEvent)
681 Default: OnBuildSuccess
682 OnBuildSuccess: Run after a successful build
683 OnOutputUpdated: Run only if the output assembly got updates
687 <PostBuildEventDependsOn />
690 <!-- this gets invoked in two cases, from CoreBuildDependsOn, if the build completes
691 successfully, OR from OnError in CoreBuild, if the build failed and $(RunPostBuildEvent)
692 is 'Always' or 'OnOutputUpdated'. Invoke $(PostBuildEvent) if its either Empty (== OnBuildSuccess)
693 or OnBuildSuccess or Always OR (OnOutputUpdated and output assembly got updated) -->
694 <Target Name="PostBuildEvent"
695 Condition="'$(PostBuildEvent)' != '' and
696 ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or
697 '$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')"
698 DependsOnTargets="$(PostBuildEventDependsOn)">
700 <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
703 <!-- Timestamp the output assemblies, required for PostBuildEvent -->
704 <Target Name="_TimestampBeforeCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
705 <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
706 <Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeBeforeCompile" />
709 <Target Name="_TimestampAfterCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
710 <CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
711 <Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeAfterCompile" />
720 $(MSBuildProjectDefaultTargets);
724 <RebuildDependsOn Condition="'$(MSBuildProjectDefaultTargets)' == 'Rebuild'">
732 <Target Name="BeforeRebuild" />
733 <Target Name="AfterRebuild" />
735 <Target Name="Rebuild"
736 DependsOnTargets="$(RebuildDependsOn)"
737 Outputs="$(TargetPath)"/>
740 <Target Name="_RecordCleanFile"
741 DependsOnTargets="_GetCompileOutputsForClean">
743 <!-- add to list of previous writes for this platform/config -->
745 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
746 <Output TaskParameter="Lines" ItemName="PreviousFileWrites"/>
749 <RemoveDuplicates Inputs="@(PreviousFileWrites);@(FileWrites->'%(FullPath)')">
750 <Output TaskParameter="Filtered" ItemName="CombinedFileWrites"/>
753 <!-- CopyLocal files: In case all the projects build to common output
754 directory, then other projects might depend on some of these
755 CopyLocal files, so delete only the ones under *this* project
757 <FindUnderPath Path="$(MSBuildProjectDirectory)" Files="@(FileWritesShareable)">
758 <Output TaskParameter="InPath" ItemName="FileWrites"/>
762 File="$(IntermediateOutputPath)$(CleanFile)"
763 Lines="@(CombinedFileWrites)"
770 CleanReferencedProjects;
776 <Target Name="_GetCompileOutputsForClean">
777 <!-- assembly and debug file in the *intermediate output path* -->
778 <CreateItem Include="@(IntermediateAssembly)" Condition="Exists('@(IntermediateAssembly)')">
779 <Output TaskParameter="Include" ItemName="FileWrites"/>
782 <CreateItem Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
783 Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')">
784 <Output TaskParameter="Include" ItemName="FileWrites"/>
788 <!-- Get the list of files written, for clean -->
789 <Target Name="_GetCleanFileWrites"
790 DependsOnTargets="_GetCompileOutputsForClean">
791 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
792 <Output TaskParameter="Lines" ItemName="PreviousFileWrites"/>
796 <Target Name="CleanReferencedProjects"
797 DependsOnTargets="AssignProjectConfigurations">
799 <!-- If building from .sln.proj or from IDE, clean will get handled by them,
800 else we are building a project directly, from the command line, so
801 clean the referenced projects -->
802 <MSBuild Projects="@(ProjectReferenceWithConfigurationExistent)"
804 Condition=" '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' and '@(ProjectReferenceWithConfigurationExistent)' != ''" />
808 <Target Name="Clean" DependsOnTargets="$(CleanDependsOn)"/>
810 <!-- Override in project to run before/after clean tasks -->
811 <Target Name="BeforeClean" />
812 <Target Name="AfterClean" />
814 <Target Name="CoreClean" DependsOnTargets="_GetCleanFileWrites">
815 <Delete Files="@(PreviousFileWrites);@(FileWrites)" TreatErrorsAsWarnings="true"/>
817 <!-- all previous files written for this platform/config have been deleted,
818 we can safely remove the file list now -->
819 <Delete Files="$(IntermediateOutputPath)$(CleanFile)" TreatErrorsAsWarnings="true" />
822 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\*"
823 Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter')"/>