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